Results 1 to 7 of 7

Thread: Firefox IFrame Problem

  1. #1
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Firefox IFrame Problem

    hi ,

    I use javascript in a site I build and I have an IFrame and a navigation bar in my index.asp page. when user click on the bar I call the same page and use document.getElementById to get the IFrame and to change it's src, so far so good - if you use IE, if you use firefox the story is different - if you click on the navBar it will loads the index.asp inside the IFrame instead of load the page I expect to load.

    I don't understand why it is happening.....

    Any halp will be appreciated !!!

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Can you provide a link to your website/page so that we can take a look at it using Firefox and IE.

  3. #3
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Oh, just by reading the post I can tell: You can't dynamically change the source of the frame using the .src attribute.
    Use location.href instead:
    Code:
    <script language='javascript'>
    	function MClick(obj)
    	{
    		document.frames['myframe'].location.href = obj.getAttribute("linkAdd");	
    	}
    </script>
    Give your iframe a name:
    Code:
    <iframe name="myframe"...
    - Mike

  5. #5
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Maybe but the IE is execute it right, any way what I try to do is to change the source of the IFrame dynamically and call the same page - now with the IFrame new source ..... only firefox parser don't pars it the way I expect .... any suggestion ? .... I don't know how to continue from here :-(

  6. #6
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I try to use your syntx but it is doesn't work for me ?
    Code:
    function MClick(obj){
    // document.getElementById('MainContent').src = obj.linkAdd;
    alert(obj.getAttribute("linkAdd"));
    document.frames('MainContent').href = obj.getAttribute("linkAdd");
    alert(document.frames('MainContent').href);
    }
    </script>
    I did debug it and the content get into place [alert();]
    (the second alert will not fire in firefox)
    but it is not working even in IE I belive that I'm doing somthing wrong.
    Last edited by mcg; 03-05-2007 at 01:39 PM.

  7. #7
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If anyone have an idea, any idea what to do with it, I will be very happy to hear about it, Thank, me.
    Last edited by mcg; 03-06-2007 at 04:38 AM.

Bookmarks

Posting Permissions

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