Results 1 to 2 of 2

Thread: Open in a frame

  1. #1
    Join Date
    Jan 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Open in a frame

    With the below code i am trying to get the page to open in a frame. I have a frame set and set all the targets to main , ie in the index and tried everywhere else. I am at a loss now where i can change the code to open it into frame, ie the main page. I have exhausted my knowlegde any advice would be appreciated.

    KAse

    var ie5=(document.getElementById&&navigator.appName.indexOf("Internet Explorer")!=-1)

    if (ie5){
    document.write('<span style="position:relative;width:300px;height:1px;border:1px solid black;font:bold 10pt Verdana;padding:3px; background-color:white;" onClick="showhide(1);event.cancelBubble=1" ><span style="cursor:hand;width:100%">Click here for alarms </span>')
    document.write('<div id="innermenu" style="position:absolute;left:2;top:16;width:240px;height:400px;border:1px solid black;background-color:#DCDCDC;overflow-y:scroll;visibility:hidden;scrollbar-face-color:#DCDCDC;scrollbar-arrow-color:silver;scrollbar-track-color:#DCDCDC;crollbar-shadow-color:black;scrollbar-highlight-color:silver;scrollbar-3dlight-color:#DCDCDC;crollbar-darkshadow-Color:black;">')
    }

    function gl(linkname,dest){
    document.write('<b><a href="'+dest+'">'+linkname+' target="_main"</a></b><br>')
    }

    function showhide(state){
    var cacheobj=document.getElementById("innermenu").style
    if (state==0)
    cacheobj.visibility="hidden"
    else
    cacheobj.visibility=cacheobj.visibility=="hidden"? "visible" : "hidden"
    }

    //Specify your links here- gl(Item text, Item URL)
    if (ie5){

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You set it to open in the main frame, then it didn't work?
    And, you're asking how to fix the code you have?
    Sorry... I'm a bit confused.


    Well... here's your link tag...
    document.write('<b><a href="'+dest+'">'+linkname+' target="_main"</a></b><br>')

    The issue is that you have the target="_main" in the text of the link, not the code.
    <a CODE>displayedtext</a>
    So...

    document.write('<b><a href="'+dest+'" target="_main">'+linkname+'</a></b><br>')
    (the syntax with quotes is a bit weird... you probably know better than I do... maybe you need + signs there... dunno)

    Basically... move the target= inside the tag.

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
  •