Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission Denied Javascript Error

Status
Not open for further replies.

mstem

Programmer
Aug 3, 2000
3
GB
I am designing a system which has 4 pc's connected by a network. Each one is to run a web server and a user can connect to the any of the servers to get data from all the pc's.<br><br>I have created a display page which opens first and opens up a window for each of the pc's:<br>open('datapc1.html','DataFromPC1')<br>open('datapc2.html','DataFromPC2') etc<br>The display page also defines a Javascript function called update which modifies the icons on the screen depending on the status of the 4 pc's.<br><br>Each of the data pages ( eg datapc1.html) makes a call to the display page update function passing in status parameters:<br>window.opener.window.updatePC1(1,2,3,4)<br><br>This all works fine when the data pages are served locally (for development) as defined in the open commands above but as soon as I define an IP address for them:<br>open('http:\\100.100.100.100\datapc1.html','DataFromPC1')<br>open('http:\\100.100.100.101\datapc2.html','DataFromPC2') etc<br>The page is served OK but as soon as the page tries to execute the 'window.opener.window.updatePC1' command<br>I get a Permission Denied error. Its as if the window.opener wont work if an IP address is used?<br><br>I have looked at the Apache config help but still dont know whether its a configuration file type problem or a Javascript problem.<br><br>Can anyone save the day?<br><br>Cheers,<br><br>Michael.
 
Can't save the day unless I see your actual Javascript code... ;)
 
OK... here follows the relevant bits of code from the two pages:<br><br><br>From the main display page first code that works ok:<br><br>function RefreshStatus()<br>{LOTS of icon manipulation based on function arguments...<br>setTimeout(&quot;DataFromPC1.location.reload()&quot;,1000)<br>}<br>window.UpdateStatus=RefreshStatus<br><br>var DataFromPC1=open('datapc1.html','DataFromPC1')<br><br>Thats it really all the display window does at the moment is define a function to manipulate graphics in response to different values passed in as arguments and then opens up one or more data collection windows.<br><br><br>From the data collection page (datapc1.html):<br><br>window.opener.window.UpdateStatus(0,2)<br><br>The data collection window does nothing except to call the function defined in the display window passing in status parameters.<br><br>The basic idea being that the window in the background ie data collection page goes through the refresh and in doing so will call the update routine in the main page. This avoids the main display window repeatedly refreshing and spoiling the look of the user interface.<br><br>As can be seen from the above code when the data colection page is served locally there is no problem.<br><br>When however I change the code in the display window to give the data collection page an IP address ie<br><br>var DataFromPC1=open(''http:\\100.100.100.100\datapc1.html','DataFromPC1')<br><br>even if the IP address is for the same local web server I get the data collection page served but when the page reaches the execution of the:<br><br>window.opener.window.UpdateStatus(0,2)<br><br>function I get a Permission denied error.<br><br>I hope this helps. If the whole of the scripts is needed then I can always email them to any potential saviours if that would help.<br><br>Cheers,<br><br>Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top