SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jan 2000
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello.
    I would like to get the variable pix in the cols position in the frameset. How do I
    write then? The meaning is that the cols should be different with different browsers.
    I have tried to replace 183 in the frameset with
    <Script Language="JavaScript"> document.write(pix); </script>
    but it dosnīt work.
    So how do I call the variable pix inside the frameset?

    /Erik


    <html>
    <head>
    <title>Browser detection</Title>

    <Script Language="JavaScript">
    browsername=navigator.appName;
    if (browsername.indexOf("Netscape")!=-1) {browsername="NS"}
    else
    {if (browsername.indexOf("Microsoft")!=-1)
    {browsername="MSIE"}
    else {browsername="N/A"}};

    //detect the browserversion
    browser="0";
    if (navigator.appVersion.indexOf("2.0")!=-1) {browser="2"};
    if (navigator.appVersion.indexOf("3.0")!=-1) {browser="3"};
    if (navigator.appVersion.indexOf("4.0")!=-1) {browser="4"};

    // Send visitor to relevant pages
    if (browsername=="NS")
    {var pix="189"};
    if (browsername=="MSIE")
    {var pix="183"};
    if (browsername=="N/A")
    {var pix="183"};

    </script>

    </head>

    <frameset border="false" frameborder="0" framespacing="0" rows="98,*" cols="*">
    <frame src="u.htm" SCROLLING="no">
    <frameset border="false" frameborder="0" framespacing="0" cols="183,*" rows="*">
    <frame src="v.htm" SCROLLING="no">
    <frame src="main.htm">
    </frameset>
    </frameset>
    <noframes><body bgcolor="#FFFFFF">

    </body></noframes>

    </html>

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can't open one tag within another tag like that. If you want to use a variable width for your column then use your document.write to create your frames. i.e.


    document.write ("<frameset border='false' frameborder='0' framespacing='0' rows='98,*' cols='*'> ")
    document.write ("<frame src='u.htm' SCROLLING='no'>")
    document.write ("<frameset border='false' frameborder='0' framespacing="0" cols='" + pix + ",*' rows='*'> ")
    document.write ('<frame src='v.htm' SCROLLING='no'> ")

    etc...

    Hope this helps you some. Your only other option is to use javascript expressions but there are different implementations for IE and Navigator and those implementations aren't wide spread yet.

    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.



    [This message has been edited by wluke (edited January 03, 2000).]

  3. #3
    SitePoint Member
    Join Date
    Jan 2000
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I think it works now.

    I just have to se if it works in old versions
    of netscape and ie.

    /caron


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
  •