Insecure JavaScript trying to access a frame with a URL - in the same domain

I'm trying to access the url of the parent window from an iFrame, but I'm getting an error on my server:

Insecure JavaScript attempt to access frame with url http://www.domain.com/folder/ from frame with url http://www.domain.com/folder/file.html . The frame is 'document.domain' on 'domain.com', but the postback to access the frame is not. Both must set the document.domain parameter to allow access.

I'm on the same domain so I don't understand why I am getting this error. For your information, everything works well on localhost.

Thank you for your help.

+3


source to share


1 answer


OK I found a solution. I put this code and it works:



document.domain = 'domain.com';

      

+1


source







All Articles