View Full Version : document.write an html file
ScottInTexas
12-14-2002, 02:16 PM
Could you please help me with the syntax to write an html file to a frame? I have
function GetItem(n){
var strItem=aryItems[n+1];
switch (strItem){
case "test":
{
parent.mainContent.document.write("../testpage.html");
break;
}
}
}
Of course, this properly writes "../testpage.html" in the frame!
Thanks for your help.
ACJavascript
12-14-2002, 04:27 PM
what do you mean by write?
are you trying to write the html syntax of that html page into the frame or tyring to just show the page itslef. like a link?
joeframbach
12-14-2002, 05:50 PM
try src instead of document.write
joeframbach
12-14-2002, 06:14 PM
ack! i feel stupid. is it href? i think it should be parent.mainContent.href="../testpage.html"
krycek
12-14-2002, 06:55 PM
hmmm, are we missing the point here?
scott, if you want to point your page at a file, then I think you should be using .location (not .href or .src)
otherwise, if you actually want to write something dynamically to the page, then yes you are going the right way about it - document.write will work fine.
I am not sure exactly where your problem lies so before anyone goes into too much depth about something that may not be what you are after, do you want to give a bit more description about what you are trying to do? Just so that we all know :)
::] krycek [::
cheesebagpipe
12-14-2002, 09:51 PM
parent.mainContent.location = "../testpage.html";
ScottInTexas
12-22-2002, 01:34 PM
Thank you all for your replies.
I was afraid I wouldn't be giving enough info but I am always trying to keep the posts short as possible. I don't want people to get bored and move on.
This is my attempt at a pop-up window. The last post by cheesebagpipe worked as intended. I just don't get the results that I want.
More searching required.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.