473,385 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Javascript Error: Access is denied

I have two frames in index.html:
<frameset cols="165,*">
<frame name="NCTnav" src="NCTnavHome.htm" scrolling="auto">
<frame name="NCTmain" src="http://www.yahoo.com">
</frameset>

from frame "NCTnav", I have a link, when I click this link, I need to load http://www.google.com (for example) into frame "NCTmain". The code in NCTnavHome.htm like:

<script language="JavaScript" type="text/JavaScript">
function displaySelection(URL) {
window.parent.frames[1].document.location.href = URL;
} // displaySelection
</script>
<TITLE>NCTnavHome.htm</TITLE>
</HEAD>
<BODY>
<A HREF="javascript:displaySelection('http://www.google.com');">test</A>
</BODY>
</HTML>

When I click this link, I got JavaScript error "Access is Denied". Even if I want to load a sample html on the web server instead of www.google.com, I got same error message. It seems no way to change url in one frame from a different frame.

Can anybody help me on this issue?

Thanks a lot in advance.
Oct 23 '06 #1
2 7708
guest
25
It is not possible to manipulate pages in frames that are not in the same domain.
Nov 18 '06 #2
eviva
1
HelenWu,

Did you ever have a resolution to this problem? If so, can you please post how you resolved it? I am having the same problem with my page. Thanks in advance.

eviva


I have two frames in index.html:
<frameset cols="165,*">
<frame name="NCTnav" src="NCTnavHome.htm" scrolling="auto">
<frame name="NCTmain" src="http://www.yahoo.com">
</frameset>

from frame "NCTnav", I have a link, when I click this link, I need to load http://www.google.com (for example) into frame "NCTmain". The code in NCTnavHome.htm like:

<script language="JavaScript" type="text/JavaScript">
function displaySelection(URL) {
window.parent.frames[1].document.location.href = URL;
} // displaySelection
</script>
<TITLE>NCTnavHome.htm</TITLE>
</HEAD>
<BODY>
<A HREF="javascript:displaySelection('http://www.google.com');">test</A>
</BODY>
</HTML>

When I click this link, I got JavaScript error "Access is Denied". Even if I want to load a sample html on the web server instead of www.google.com, I got same error message. It seems no way to change url in one frame from a different frame.

Can anybody help me on this issue?

Thanks a lot in advance.
Apr 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.