SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    location.replace, location.href, location changing is not working in IE

    Hi,

    I have three frames in my page

    ----------------------------------------------
    Frame 1 | Frame 2
    |
    |
    -----------|
    Frame 3 |
    |
    |
    ----------------------------------------------

    In my frame 3 i have few links which opens displays different content on different click.

    Long story short, i am trying to change the content of frame 2 from frame3 and it works perfectly fine in Firefox. But when one of the click is not working

    i tried to use all of the following


    //parent.frames['Content'].location = "http://cnn.com";
    //parent.frames['Content'].location.replace('http://cnn.com');
    //window.parent.frames['Content'].location.href='http://cnn.com';
    //window.parent.frames['Content'].location='http://cnn.com';

    It is not throwing any error in IE but it is not functioning as it is suppose to. I am able to alert before and after executing above statements. I have used fiddler also to see whether my request is going or not but found that it is not.

    Further, i am able to display cnn.com page in frame1 and frame3 using above statement but not in frame2.

    If anyone has any idea on how to change the content of frame2 using above methods (if i m doing something wrong) or some other alternative, i would appreciate if you can share it here.

    Thanks!

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    have you tried parent.frames['content'].document.location.replace('http://www.cnn.com');?

  3. #3
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for replying but it is not working. Works in FF but not in IE.

    My code works fine with IE7 (beta 3) but not in IE6.

    I am able to call frame1 and display content in it from frame3. Further, i am able to display the same content in frame3 but i don't know I am not able to access frame2.

    In my page, i am using it like this.

    In my frame 3 there are two links for each table and there are many tables .

    In each of the link i open a page in the frame area 2.

    On first click => i open page1 by this construct
    parent.frames['Content'].location = "url of the page1 i m opening" => This works

    On second clik =? i open page2 in frame area 2
    I have some AJAX logic for that click. And i check whether i have clicked on page1 and if i have clicked it then i use the following construct
    parent.frames['Content'].location.replace("url of page2)

    I have tried to use
    parent.frames['Content'].location = "url of the page2" ==> This does not work

    Since i have links for page2 and page1 in each of the table in my frame, when i click on other links for page1 it works but not for page2 at all.

    I hope i am able to explain my problem to you. I tried to trace my http request using fiddler (live http header like tool for IE) but request it not going.

    Thanks once again for replying.


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
  •