PDA

View Full Version : Open in a frame



cblake843
05-04-2006, 07:11 AM
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){

djr33
05-04-2006, 07:25 AM
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.