I am calling two pages using Ajax Get_Pages.php and Get_Content.php from combo box. Both pages are displayed based on selection from combo box.
Main problem is that it is not showing the editor which is called on the Get_Content.php . in Main Page.
I have included the js files in the head section.
all the files are on the same directory.
But when I am running the Get_Content.php it is showing the Editors so what is the problem
Please help me out.
I have given the codes for the pages.
Main Page which is calling the JS Page.
Expand|Select|Wrap|Line Numbers
- <head>
- <script src="Get_Page.js" type="text/javascript"></script>
- </head>
- <body>
- <form action="insertimage.php" method="post" enctype="multipart/form-data">
- <table><tr>
- <td valign="middle">Page Type</td>
- <td align="left" valign="bottom"><select name="Page_Type" onchange="getPage(this.value)">
- <option>--Select One--</option>
- <option value="image">Image</option>
- <option value="content">Text</option>
- </td></tr>></table>
- </form>
- </body>
Expand|Select|Wrap|Line Numbers
- //js page
- var xmlHttp
- function getPage(str)
- {
- xmlHttp=GetXmlHttpObject()
- if (xmlHttp==null)
- {
- alert ("Browser does not support HTTP Request");
- return;
- }
- var image="image";
- if(str==image)
- {
- var url="Get_Page.php";
- url=url+"?q="+str;
- url=url+"&sid="+Math.random();
- xmlHttp.onreadystatechange=stateChanged ;
- xmlHttp.open("GET",url,true);
- xmlHttp.send(null);
- }
- else
- {
- var url="Get_Content.php";
- url=url+"?q="+str;
- url=url+"&sid="+Math.random();
- xmlHttp.onreadystatechange=stateChanged ;
- xmlHttp.open("GET",url,true);
- xmlHttp.send(null);
- }
- }
- function stateChanged()
- {
- if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
- {
- document.getElementById("txtHint").innerHTML=xmlHttp.responseText
- }
- }
- function GetXmlHttpObject()
- {
- var xmlHttp=null;
- try
- {
- xmlHttp=new XMLHttpRequest();
- }
- catch (e)
- {
- try
- {
- xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (e)
- {
- xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- }
- return xmlHttp;
- }
Expand|Select|Wrap|Line Numbers
- //Get_Page.php
- <table>
- <tr valign="bottom">
- <td width="20%" align="left" valign="middle">Caption1</td>
- <td width="17%" align="left" valign="middle"><input name="Image_Name1" type="text" id="Image_Name" value="" size="15" /></td>
- <td width="18%" align="center" valign="middle">File1: </td>
- <td width="45%" align="left" valign="middle"><input name="File1" type="file" id="File1" value="" size="15" /></td>
- </tr>
- <tr>
- <td height="26" align="left" valign="middle"> </td>
- <td height="26" colspan="2" align="left" valign="bottom"><input type="submit" name="Upload" value="Upload"/>
- <input type="reset" name="Reset" /></td>
- </tr>
- </table>
Expand|Select|Wrap|Line Numbers
- //Get_Content.php
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script language="javascript" src="wysiwyg.js"></script>
- <title>Untitled Document</title>
- </head>
- <body>
- <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr align="left">
- <td width="14%" align="left" valign="middle"> Content Id </td>
- <td width="86%" valign="middle"><input type="text" name="Content_Id" value="" /></td>
- </tr>
- <tr align="left">
- <td align="center" valign="middle">Content Name </td>
- <td valign="middle"><input type="text" name="Content_Name" value="" /></td>
- </tr>
- <tr align="left">
- <td align="left" valign="top"> Description</td>
- <td valign="middle"><textarea id="textarea2" name="Content_Description" style="height: 200px; width: 500px;">
- </textarea>
- <script language="javascript1.2">
- generate_wysiwyg('textarea2');
- </script> </td>
- </tr>
- <tr align="left">
- <td valign="middle"> </td>
- <td valign="middle"><input type="submit" name="Content" value="Add Content" />
- <input name="reset" type="reset" /></td>
- </tr>
- </table>
- </body>
- // end of page.
But when I am running the Get_Content.php it shows the editor.
so is there any thing that I can not call Series of Js pages. If it is then how can I do it.