www.webdeveloper.com
Results 1 to 4 of 4

Thread: FF and IE problem

  1. #1
    Join Date
    Jun 2009
    Posts
    39

    FF and IE problem

    Hey guys,

    I have the following code which seems to only work in IE. I tried all the different combinations in FF but can't seem to get it to work, does anyone know the FF equivalent? Or is it something unique to IE?

    Code:

    Code:
    document.frames['myFrame'].location.href = xmlhttp.responseText

    Thanks much,

    Regards,
    Pembar

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    has your iframe/frame a name, or an id?

  3. #3
    Join Date
    Jun 2009
    Posts
    39
    Hey guys,

    Here's a more complete example:

    Code:
    <html>
    <body>
    <script language="JavaScript">
    function myLocation() {
    alert(document.all.myFrame.contentWindow.location);
    }
    function changeURL(url) {
    document.getElementById("urlAddress1").value=url;
    document.frames['myFrame'].location.href = url;
    
    }
    </script>
    <iframe id="myFrame" src="http://www.google.com" style="width:200;">
    </iframe>
    <br>
    <button onclick="changeURL('http://www.yahoo.com');">Yahoo</button><P>
    		1. <input type="button" name="clickMe2" id="urlAddress1" value="CurrentURL"/><P>
    </body>
    </html>
    It works fine in IE when I click "Yahoo", the frame changes. When I click "Yahoo" in FF, nothing happens.

    Any clue?

    Thanks much.

    Regards,
    Pembar

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Try this
    Code:
    document.getElementById('myFrame').contentWindow.location.href = newurl;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles