Link to home
Start Free TrialLog in
Avatar of aprillougheed
aprillougheedFlag for United States of America

asked on

firefox breaks with javascript code - URGENT - NEED HELP SOON

The following script breaks in Firefox ... exactly at this point.
<" + "/script>"); //--> 

Open in new window


I know there is a problem with the wrong spaces around HTML comments.  But I just sent this page to a client and if they use Firefox I'm screwed.  I'll keep looking for solution - but hoped an expert could quickly explain it to me.


<!-- START PHP2 CODE for Top of Category Pages --> 
			
<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://www.domain.com/banner/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:1");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script>
			<noscript>
			<a href='http://www.domain.com/banner/adclick.php?n=a83d5880' target='_blank'><img src='http://www.domain.com/banner/adview.php?what=zone:1&amp;n=a83d5880' border='0' alt='' /></a>
			</noscript>

Open in new window

Avatar of aprillougheed
aprillougheed
Flag of United States of America image

ASKER

I'm researching and saw some posts about doctype being an issue.  Here is the file's doctype
Please note this is a link directory program.  The code in questions is a php banner rotating script.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of Nathan Bove
Nathan Bove
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi.  Thanks for your response to my urgent request.  Unfortunately - all heck broke loose and now I have to make an emergency trip out of town to help my Mom..  Forgive my rushed comments below.

I worked on this issue for hours today. I installed this link directory script over TEN years ago.  When I started looking through the code today - it's a huge mess.  

There are a bunch of HTML comment tags that FIrefox doesn't like.
Sometime in the last few years I changed the document type and ... well, it's all a mess.  I'm looking at weeks to get it fixed.

I tried the code you suggested, but that didn't seem to fix the problem.  You are obviously really smart about these things - because I do not even know what concatenation is or what you mean by "post the resulting script".

Do you mean the source code from the page?

I'm a little paranoid about posting links to my actual site.  Indeed, I just found some hacked code today that was displaying very nasty images.  I don't know why anyone would want to hack me.  Or how it happened. So I usually make it a rule not to post code of my actual site.  I'm too inexperienced to know what I might post that would expose a security vunerability.

Am I worrying needlessly?

NOTE:  I'm toying with giving up on this old script.  It's from Gossamer Threads.  I would consider going back to Gossamer Threads and paying them to fix the script - but I'd like to get it working on Firefox and see if I can sell some advertising before I sink more money into into.  I guess I'd like to think I could fix it - I hate to go running to them everytime there is an issue.  I've already poured over every single file in the cgi-bin directory.  There are a lot of them.  And I know the interface pretty well.

I've even already purchased another script http://www.phplinkdirectory.com/ - but that will be another nightmare trying to transfer 10,000 links from my old MySql.  

What do you think?  Start over completely with a different script - or keep trying to fix this one?

Sorry this message isn't very well thought-through.  Appreciate any help you can provide.

I have it working.  Guess it was all a problem with HTML comments.  I found one buried in the template global for the links.

I still have a lot of work to do to make the site standards compliant.  But it's working now.

Appreciate your help.

Solution was OK - but I had not given enough info to explain the problem.