Hi
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.
[CODE=javascript]//js page
var xmlHttp
function getPage(str)
{
xmlHttp=GetXmlH ttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var image="image";
if(str==image)
{
var url="Get_Page.p hp";
url=url+"?q="+s tr;
url=url+"&sid=" +Math.random();
xmlHttp.onready statechange=sta teChanged ;
xmlHttp.open("G ET",url,true) ;
xmlHttp.send(nu ll);
}
else
{
var url="Get_Conten t.php";
url=url+"?q="+s tr;
url=url+"&sid=" +Math.random();
xmlHttp.onready statechange=sta teChanged ;
xmlHttp.open("G ET",url,true) ;
xmlHttp.send(nu ll);
}
}
function stateChanged()
{
if (xmlHttp.readyS tate==4 || xmlHttp.readySt ate=="complete" )
{
document.getEle mentById("txtHi nt").innerHTML= xmlHttp.respons eText
}
}
function GetXmlHttpObjec t()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest( );
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(" Msxml2.XMLHTTP" );
}
catch (e)
{
xmlHttp=new ActiveXObject(" Microsoft.XMLHT TP");
}
}
return xmlHttp;
}
[/CODE]
[CODE=php]//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_Nam e1" 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>
[/CODE]
[CODE=php]//Get_Content.php
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javas cript" src="wysiwyg.js "></script>
<title>Untitl ed 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" > &n bsp; Conte nt Id </td>
<td width="86%" valign="middle" ><input type="text" name="Content_I d" value="" /></td>
</tr>
<tr align="left">
<td align="center" valign="middle" >Content Name </td>
<td valign="middle" ><input type="text" name="Content_N ame" value="" /></td>
</tr>
<tr align="left">
<td align="left" valign="top">&n bsp; Descr iption</td>
<td valign="middle" ><textarea id="textarea2" name="Content_D escription" style="height: 200px; width: 500px;">
</textarea>
<script language="javas cript1.2">
generate_wysiwy g('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.[/CODE]
Now Problem is that code works fine but it is not showing the editor which is included through wysiwyg.js when I am calling it from main 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.
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.
Code:
<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>
[CODE=javascript]//js page
var xmlHttp
function getPage(str)
{
xmlHttp=GetXmlH ttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var image="image";
if(str==image)
{
var url="Get_Page.p hp";
url=url+"?q="+s tr;
url=url+"&sid=" +Math.random();
xmlHttp.onready statechange=sta teChanged ;
xmlHttp.open("G ET",url,true) ;
xmlHttp.send(nu ll);
}
else
{
var url="Get_Conten t.php";
url=url+"?q="+s tr;
url=url+"&sid=" +Math.random();
xmlHttp.onready statechange=sta teChanged ;
xmlHttp.open("G ET",url,true) ;
xmlHttp.send(nu ll);
}
}
function stateChanged()
{
if (xmlHttp.readyS tate==4 || xmlHttp.readySt ate=="complete" )
{
document.getEle mentById("txtHi nt").innerHTML= xmlHttp.respons eText
}
}
function GetXmlHttpObjec t()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest( );
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(" Msxml2.XMLHTTP" );
}
catch (e)
{
xmlHttp=new ActiveXObject(" Microsoft.XMLHT TP");
}
}
return xmlHttp;
}
[/CODE]
[CODE=php]//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_Nam e1" 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>
[/CODE]
[CODE=php]//Get_Content.php
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javas cript" src="wysiwyg.js "></script>
<title>Untitl ed 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" > &n bsp; Conte nt Id </td>
<td width="86%" valign="middle" ><input type="text" name="Content_I d" value="" /></td>
</tr>
<tr align="left">
<td align="center" valign="middle" >Content Name </td>
<td valign="middle" ><input type="text" name="Content_N ame" value="" /></td>
</tr>
<tr align="left">
<td align="left" valign="top">&n bsp; Descr iption</td>
<td valign="middle" ><textarea id="textarea2" name="Content_D escription" style="height: 200px; width: 500px;">
</textarea>
<script language="javas cript1.2">
generate_wysiwy g('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.[/CODE]
Now Problem is that code works fine but it is not showing the editor which is included through wysiwyg.js when I am calling it from main 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.
Comment