SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    if then template not working

    <SCRIPT LANGUAGE="JavaScript">

    if (isIE3Mac)
    {
    document.writeln("<cfinclude template=pageleft2.cfm>");
    }
    else
    {
    document.writeln("<cfinclude template=pageleft.cfm>");
    }

    </SCRIPT>

    have a look at the result:
    http://dev.jadetech.com/template/pagetemplate.cfm



    I have two javascript menus. One that works on Macs and one that doesn't. I'm trying to pick which menu to use dependning on if they have a mac. It's eems simple but doesn't work. COuld it be the combination of server and client scripting?
    Last edited by dethfire; May 28, 2002 at 09:39.
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <SCRIPT LANGUAGE="JavaScript"> 
    
    if (isIE3Mac) 
    { 
    window.location = "pageleft2.cfm";
    } 
    else 
    { 
    window.location = "pageleft.cfm"; 
    } 
    
    </SCRIPT>
    Try this.
    Azizur Rahman
    Web Application Developer

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that should be

    PHP Code:
    <script type="text/javascript"
    <!--

    if (
    isIE3Mac

      
    window.location.href "pageleft2.cfm";

    else 

      
    window.location.href "pageleft.cfm"

    // -->
    </script> 
    however this will not solve the problem, but you can try these

    try these examples

    PHP Code:
    if (navigator.userAgent.indexOf('Opera') >= 0

    alert('using Opera'); 
    }

    // or

    if (document.getElementById)
    {
      
    alert('');
    }
    else if (
    document.all)
    {
      
    alert('');
    }
    else if (
    document.layers
    {
      
    alert('');

    as i doubt its a problem with the platform.

    however i just wrote ths up for you any way


    PHP Code:

    <script type="text/javascript"

    var 
    n=navigator;
    if      (
    n.platform=='HP-UX'alert('HP Unix');
    else if (
    n.platform=='MacPPC'alert('Mac PowerPC');
    else if (
    n.platform=='Mac68K'alert('Macintosh 68K');
    else if (
    n.platform=='SunOS'alert('Solaris');
    else if (
    n.platform=='Win32'alert('Microsoft Windows 32-bit');
    else if (
    n.platform=='Win16'alert('Windows 16-bit');
    else if (
    n.platform=='WinCE'alert('Windows CE'

  4. #4
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question What?

    Originally posted by Andrew-J2000
    that should be

    PHP Code:
    <script type="text/javascript"
    <!--

    if (
    isIE3Mac

      
    window.location.href "pageleft2.cfm";

    else 

      
    window.location.href "pageleft.cfm"

    // -->
    </script> 
    however this will not solve the problem, but you can try these

    try these examples

    PHP Code:
    if (navigator.userAgent.indexOf('Opera') >= 0

    alert('using Opera'); 
    }

    // or

    if (document.getElementById)
    {
      
    alert('');
    }
    else if (
    document.all)
    {
      
    alert('');
    }
    else if (
    document.layers
    {
      
    alert('');

    as i doubt its a problem with the platform.

    however i just wrote ths up for you any way


    PHP Code:

    <script type="text/javascript"

    var 
    n=navigator;
    if      (
    n.platform=='HP-UX'alert('HP Unix');
    else if (
    n.platform=='MacPPC'alert('Mac PowerPC');
    else if (
    n.platform=='Mac68K'alert('Macintosh 68K');
    else if (
    n.platform=='SunOS'alert('Solaris');
    else if (
    n.platform=='Win32'alert('Microsoft Windows 32-bit');
    else if (
    n.platform=='Win16'alert('Windows 16-bit');
    else if (
    n.platform=='WinCE'alert('Windows CE'
    <script type="text/javascript"> How's that PHP? are you trying to say all the code you've written is PHP? what are you trying to do: telling us to turn a blind eye?
    Azizur Rahman
    Web Application Developer

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope i just like the colour coding in php thats all, as it makes it stand out.

    I havent looked but it's possible to determine this with asp, i'm not sure about php, as i've never tried


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
  •