-
January 27th, 2012, 05:06 AM
#1
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...
Last edited by PeejAvery; January 27th, 2012 at 10:11 AM.
Reason: Added code tags
-
January 27th, 2012, 10:13 AM
#2
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.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 28th, 2012, 07:17 AM
#3
Re: Help me ....JavaScript is annoying me
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|