ehasan
03-16-2005, 05:33 PM
Hi There,
I am a newbie in this javascript world and also in this forum. I have run into a very strange problem.
I have a page which opens a new popup window and on that window, after clicking on a link, the content of a textbox must go to the parent (opener) window's textbox. I have used the following code and it works fine in my localhost. But, after I upload it to my server, and run from then, IE shows a "Access is denied" error message...........can any1 help me resolve this issue ??
Here is the main page code:
<script LANGUAGE="JavaScript">
<!--
var newwindow = '';
function popitup(url)
{
if (!newwindow.closed && newwindow.location)
{
newwindow.location.href = url;
}
else
{
newwindow=window.open(url,'name','height=460,width=600');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
function setHTML(val ) {
var f = document.oArticleForm;
if (val != '') {
f.campaign_article_text.value = val;
}
}
// End -->
</script>
Fill out the following information as needed:
<form method="POST" name="oArticleForm" action="/myCampaignManager/index.php">
<table>
<tr>
<td align="right"><textarea NAME="campaign_article_text" rows="10" cols="70"></textarea>
<br>
<a href="#" onclick="popitup('http://www.itestweb.com/spaw/edit.php')">Edit in WYSIWYG Editor </a></td>
</tr>
..............
And the child window (edit.php), has the following code:
<script LANGUAGE="JavaScript">
<!--
function refreshForm() {
var newHTML = document.forms.HTML.spawHTML.value;
window.opener.setHTML(newHTML);
return false;
}
// End -->
</script>
<form name="HTML" action="#" method="post" onSubmit="return refreshForm();">
.............
<input type="submit" name="Submit" value=" Save ">
</form>
...........
I am a newbie in this javascript world and also in this forum. I have run into a very strange problem.
I have a page which opens a new popup window and on that window, after clicking on a link, the content of a textbox must go to the parent (opener) window's textbox. I have used the following code and it works fine in my localhost. But, after I upload it to my server, and run from then, IE shows a "Access is denied" error message...........can any1 help me resolve this issue ??
Here is the main page code:
<script LANGUAGE="JavaScript">
<!--
var newwindow = '';
function popitup(url)
{
if (!newwindow.closed && newwindow.location)
{
newwindow.location.href = url;
}
else
{
newwindow=window.open(url,'name','height=460,width=600');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
function setHTML(val ) {
var f = document.oArticleForm;
if (val != '') {
f.campaign_article_text.value = val;
}
}
// End -->
</script>
Fill out the following information as needed:
<form method="POST" name="oArticleForm" action="/myCampaignManager/index.php">
<table>
<tr>
<td align="right"><textarea NAME="campaign_article_text" rows="10" cols="70"></textarea>
<br>
<a href="#" onclick="popitup('http://www.itestweb.com/spaw/edit.php')">Edit in WYSIWYG Editor </a></td>
</tr>
..............
And the child window (edit.php), has the following code:
<script LANGUAGE="JavaScript">
<!--
function refreshForm() {
var newHTML = document.forms.HTML.spawHTML.value;
window.opener.setHTML(newHTML);
return false;
}
// End -->
</script>
<form name="HTML" action="#" method="post" onSubmit="return refreshForm();">
.............
<input type="submit" name="Submit" value=" Save ">
</form>
...........