?
Solved

Firefox won't process frames['frame1'].location.href = toLocation;

Posted on 2008-10-08
9
Medium Priority
?
1,035 Views
Last Modified: 2013-12-07
having a challenge getting Firefox to work with the following javascript...it's a rado button that opens two frames:
<script type="text/javascript">
function frame1(toLocation) 
{
    frames['frame1'].location.href = toLocation;
}
    </script>
    
    
    <script type="text/javascript">
function frame2(toLocation) 
{
    frames['frame2'].location.href = toLocation;
}
    </script>
    
    
<input type="radio" checked value="1" onClick="frame1('myaddress.asp?b=<%=Request.QueryString("b")%>;frame2('myaddress2.asp?b=<%=Request.QueryString("b")%>');" name="inlinedisplay">

Open in new window

0
Comment
Question by:hessfirm1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22676225
Please show the frame definition

If you only have ID="frame1" you need document.getElementById('frame1').src
but for compatibility with older browser use NAME="frame1"
and window.frames["frame1"].location
0
 

Author Comment

by:hessfirm1
ID: 22678331
here's the code with the frames....it works in IE, but in firefox, the radio buttons don't do anything. Thanks!
<script type="text/javascript">
function frame1(toLocation) 
{
    frames['frame1'].location.href = toLocation;
}
    </script>
    
    
    <script type="text/javascript">
function frame2(toLocation) 
{
    frames['frame2'].location.href = toLocation;
}
    </script>
    
    
<input type="radio" checked value="1" onClick="frame1('myaddress.asp?b=<%=Request.QueryString("b")%>;frame2('myaddress2.asp?b=<%=Request.QueryString("b")%>');" name="inlinedisplay">
 
 
 
<iframe id="frame1" src="myurl" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none" target="_self"></iframe>
<iframe id="frame2" src="myurl2" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none;"></iframe>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22678597
So do what I suggested

change
id="frame1" to name="frame1"
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:hessfirm1
ID: 22689513
hmmm....by making it name="frame1" versus id="frame1" the frames don't open at all in firefox w/ or w/out the radio buttons.
0
 

Author Comment

by:hessfirm1
ID: 22689772
hang in there...i'm reading that this might be a firefox radio button issue...i'll update this shortly.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22692831
You also need to close the bracket

<input type="radio" checked value="1" onClick="frame1('myaddress.asp?b=<%=Request.QueryString("b")%>;

should be

<input type="radio" checked value="1" onClick="frame1('myaddress.asp?b=<%=Request.QueryString("b")%>');

0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 22692849
Solved

You named the frames the same as the function

Here is a better solution
<script type="text/javascript">
function setFrame(frameName,toLocation) {
    window.frames[frameName].location.href = toLocation;
}
    </script>
    
    
<input type="radio" checked value="1" 
onClick="setFrame('frame1','myaddress.asp?b=<%=Request.QueryString("b")%>');
setFrame('frame2','myaddress2.asp?b=<%=Request.QueryString("b")%>');" name="inlinedisplay">
 
 
 
<iframe name="frame1" src="about:blank" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" 
style="overflow:visible; width:100%; display:none" target="_self"></iframe>
<iframe name="frame2" src="about:blank" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" 
style="overflow:visible; width:100%; display:none;"></iframe>

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question