Results 1 to 4 of 4

Thread: javascript not displaying in firefox

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked
    0 times in 0 posts

    javascript not displaying in firefox

    hi guys,

    on the homepage of my site i have a scrolling marquee type thing made with javascript. it works fine in IE but you cant see it in firefox........
    the site is www.prosnooker.co.uk

    does anyone know why this is/how to fix it?

    thanks,

    ZZ

    p.s. i have javascript and java enabled in firefox..........

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,668
    Thanks
    85
    Thanked
    13 times in 11 posts
    There's lots of little problems with firefox, well, not problems, but things that work in IE and don't in Firefox (Firefox is programmed correct, IE isn't.. it accepts false code and alsorts).

    I think the problem may be this "if(navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.substring(0,1)>'3')", now I'm not a javascript master but it looks to me that it's saying that if it's internet explorer, work, if not, then don't. I'll have a tweak around with it, and see if I can fix it for you.

    You could use Java, but it means that it would slow your site down, but it also means it will work on all browsers that work with Java.

    For the other people who are reading this thread, here is the javascript;
    Code:
    <script language="javascript"> 
    			<!-- 
    				   var ie4=0; 
    				   if(navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.substring(0,1)>'3') 
    				   { 
    					   ie4=1; 
    				   } 
    				   if (ie4 == 1) 
    				   { 
    					   echo('<center><marquee direction=left id=mrqScroll behavior=scroll scrollamount=2 scrolldelay=1><b>'); 
    			echo('<a href="" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Links You May Like > > ></a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.celebritysearchengine.co.uk" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Celebrity Search Engine</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="advert.html" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Your Link Here For 99p</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.simplypoolandsnooker.co.uk" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">simplypoolandsnooker</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.isnooker.net" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">isnooker</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.thepoolclub.com" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">ipool</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.snookergames.co.uk" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Snookergames</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://sportsvl.com" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">sportsVL</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    					   echo('</b></marquee></center>'); 
    				   } 
    				   else 
    				   { 
    					   echo('&nbsp;'); 
    				   } 
    			
    				   function stopMe() 
    				   { 
    					   mrqScroll.stop(); 
    				   } 
    			
    				   function startMe() 
    				   { 
    					   mrqScroll.start(); 
    				   } 
    			
    				   function highlight(id) 
    				   { 
    					   id.style.color = "green"; 
    				   } 
    			
    				   function unhighlight(id) 
    				   { 
    					   id.style.color = "#B22222"; 
    				   } 
    				   function echo(t) 
    				   { 
    					   document.write(t); 
    				   } 
    			//--> 
    			</script>
    Edit: I just don't think Firefox doesn't like this script, one of the main things the devlopers had in mind is security, and it means blocking dodgy scripts that could be potentially dangerous.. obviously this script isn't dangerous, but I guess it's a better safe than sorry style thing.
    Last edited by XA04; 11-09-2005 at 09:50 AM.

  3. #3
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    D00d.. indeed you just say::

    Code:
    If ("browser is IE") {
        then show this jazz...
    } 
    else 
    { 
      echo('&nbsp;'); 
    }
    The marquee code works fine on firefox. Apart from a height problem. It renders the marquee about 2x higher. Probably for a GOOD and valid reason though.

    paste:
    Code:
    					 
    echo('<center><marquee direction=left id=mrqScroll behavior=scroll scrollamount=2 scrolldelay=1><b>'); 
    			echo('<a href="" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Links You May Like > > ></a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.celebritysearchengine.co.uk" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Celebrity Search Engine</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="advert.html" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Your Link Here For 99p</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.simplypoolandsnooker.co.uk" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">simplypoolandsnooker</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.isnooker.net" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">isnooker</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.thepoolclub.com" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">ipool</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://www.snookergames.co.uk" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">Snookergames</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    			echo('<a href="http://sportsvl.com" target="_blank" style="font-family: verdana, arial; font-size: 11px; text-decoration: none; color:#B22222;" onmouseout="startMe(); unhighlight(this);" onmouseover="stopMe(); highlight(this);">sportsVL</a>'); 
    			echo('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'); 
    					   echo('</b></marquee></center>');
    over.. that is INSTEAD of "echo('&nbsp;');" in the else

  4. #4
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Just going to say two things to spoil the party:

    Number 1: Don't forget that there are plenty of people that don't use Javascript, so won't be able to see the marquee anyway. Also, I would avoid using Javascript for critical parts of the website e.g. displaying a page, links for this reason.

    Number 2: I don't like marquees. I find them annoying, and they reduce the accessibility of your site.

    Otherwise, I quite like the site!
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pop-up / Ad blockers...
    By Nick in forum General Discussion
    Replies: 18
    Last Post: 14-09-2005, 12:10 PM
  2. Top Download for today - FireFox users
    By DR in forum General Discussion
    Replies: 30
    Last Post: 19-05-2005, 08:41 PM
  3. Firefox suffers first 'extremely critical' security hole
    By XA04 in forum General Discussion
    Replies: 18
    Last Post: 12-05-2005, 12:13 PM
  4. javascript isn't work with firefox
    By zim in forum Software
    Replies: 4
    Last Post: 01-05-2005, 09:20 AM
  5. Firefox extensions? And a few questions...
    By SilentDeath in forum Software
    Replies: 8
    Last Post: 08-03-2005, 10:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •