SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Safari - JavaScript Frames/Links issue

    Hi,

    I have a DHTML Folder Tree, also known as a TreeView. That is, an expandable/collapsible tree of links.

    In a frame-less layout everything works great. In a frame-based layout, it doesn't work on Safari/Konqueror.

    There are two frames: the left frame contains the tree control; when you click on a link in the tree, the right frame is the target for the links in the tree.

    The tree mechanism itself works fine. But there is a problem with the links. What happens on Safari/Konqueror with the frame-based layout is the first link works fine, but all links after that do not. That is, the first click loads a picture on the right frame, but when I click on any other links after that, the target frame is not updated.

    Any ideas/suggestions/help would be much appreciated.

    Cheers,
    FF.

  2. #2
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What DOCTYPE declaration are you using?

  3. #3
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    None

    Oh, I'm not using any! Could the DOCTYPE be the cause?

    Thanks,
    FF.

  4. #4
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I imagine it might, since a valid frameset document would require a frameset DOCTYPE. The target attribute is not supported in all DOCTYPEs.

  5. #5
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for this input. I am going to get up to speed with standards-compliant coding. I'm realizing how important it is after reading all the gems of information in the the excellent JavaScript Antology book last night.

    Best Regards,
    FF

  6. #6
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm really not sure that is the problem, especially since the first link works, but it's a place to start. I use Konqueror, but not framesets, though if you post your code or a link I could give it a run.

  7. #7
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried placing the DOCTYPE at the top of the page, but unfortunately that change didn't do it.

    The Web page in question is:
    http://www.treeview.net/tv/demo/demoFrameset.html

    As I said, the first images loads in the target frame. And if you look at the Konqueror status bar, it indicates that clicking on subsequent images is going to load the appropriate image in the target frame. But clicks on that link do not take effect.

    Note that these links are HTML, constructed using JavaScript. Here are interesting/relevant portions of the code:

    // The code that constructs the href for the link:
    "<a href=\""+this.link+"\" target=\""+this.target+"\" onClick=\"clickOnLink('"+this.getID()+"\', '"+this.link+"','"+this.target+"');return false;\"";

    // The clickOnLink function
    clickOnLink(clickedId, target, windowName) {
    highlightObjLink(findObj(clickedId));
    if (isLinked(target)) {
    window.open(target,windowName);
    }
    }

  8. #8
    &#083;itePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, what K is doing for me is opening another window, which begs the question of why you have window.open in your code. To send a page to a frame, you simply make the target of the link the frame name.


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
  •