Help me ....JavaScript is annoying me
Access Denied error in frames:
When I try to access a child frame from parent frame I get "Access Denied Error". I know the reason is because I am trying to access the frame in a different domain. Is there any way to tackle this problem? my code: parent frame:
Code:
<html>
<script>
function displayURL()
{
self.childframe1.location.href="http://www.google.com";
alert("child frame URL="+self.childframe1.location.href);
// above line i am getting the 'Access Denied Error'
}
</script>
<frameset id="mainframe" rows="100%,*" border="0">
<frame id="childframe1" name="childframe1" src="child1.php">
</html>
child frame:(child1.php):
<html>
<body>
Display Google
</body>
</html>
When the page is getting loaded for first time, the alert box is displaying with "http://www.ABC.com/child1.php". Suppose when I click the 'Display google' link in child frame, the google web site is displaying in my child frame but the alert box is not displaying "it's telling Access Denied Error".
Can some one solve my query.....
Any sort of help will be highly appreciated...
Re: Help me ....JavaScript is annoying me
You simply cannot use JavaScript to access properties from other domains. This would be a major security concern.
Re: Help me ....JavaScript is annoying me
Quote:
Originally Posted by
PeejAvery
You simply cannot use JavaScript to access properties from other domains. This would be a major security concern.
Thanks for your valuable concern. It will improve ability of coding.