Click to See Complete Forum and Search --> : Smae origin policy


bingol10
10-17-2003, 01:24 AM
Hello
I am quite new to html and javascript and I am stuck on one problem. Hope somebody can help.

I am trying to develop a website based on dynamic html. I have installed the Apache web server and MySQL database on my PC. I have created some static html forms and cgi programs which will take the input through these static html forms and after querying the database they will output the result to a newly opened window. What happens is, after this new window is opened I cannot access any object in the parent window and vice versa. I get "access denied" error.

I made some research on the web and found the same origin policy which I believe is the cause of this error. I checked the value of document.domain in both parent and child window. While it has no value in the parent window its value is "localhost" in the child window. I tried to set the parent's document.domain to "localhost" but I got "invalid argument" error.

I think one workaround would be to output the static html forms through a cgi program but I don't really like this workaround.

I appreciate if anybody points me a solution.

Thanks

Khalid Ali
10-17-2003, 04:44 AM
you should only get "access denied" if the newly opened window is not opened with the resources residing on your same machine(server). That is if you rcgi processing is done somewehre else other then your own machine(web server) then this could happen