Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: Different code for different browsers - July 19, 1998 at 19:42:51

You are here: irt.org | BBS | Re: Different code for different browsers [This BBS is closed]

Posted by Dave on July 19, 1998 at 19:42:51:

In Reply to: Different code for different browsers posted by Michelle on July 14, 1998 at 10:50:08:

You can't just put HTML inside javascript. If you want to write HTML to the page you need to use document.write.

You can split up the code into a series of document.writes or do it all in one go. Also you can put the script in the page so that some html is build by javascript & some not.
For framesets though you should do the whole thing using document.write as otherwise the browser tends to get confused.

var Name= navigator.appName
if ( Name=="Microsoft Internet Explorer")
{
document.write ("posting my frame set here");
}

else
{
document.write ("posting frame set here");
}

: I have been trying to write code to use different framesets, depending on if it is Netscape or Internet Explorer. Is there a way to do this without having to create two seperate pages?

: The code I have been using is:

: var Name= navigator.appName
: if ( Name=="Microsoft Internet Explorer")
: {
: "posting my frame set here";
: }

: else
: {
: "posting frame set here";
: }

:
: I am getting an error because I am putting the HTML code in the JavaSCripting.


Follow-ups:

You are here: irt.org | BBS | Re: Different code for different browsers [This BBS is closed]

©2018 Martin Webb