...

View Full Version : Syntax Error - Help Please



ksteele36
05-31-2009, 09:12 PM
Greetings and thanks for reading... :thumbsup:

Dreamweaver CS4 shows a syntax error for this line of script and I don't know JS well enough to spot the issue. Can someone please point it out for me?

Here's the line:

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");


thanks again, KSteele

venegal
05-31-2009, 09:22 PM
I don't see a syntax error there. Please post a few lines before and after that.

ksteele36
05-31-2009, 09:26 PM
Wow, great response time - THANKS!

Here ya go:

<div id="footer">
<!--# include virtual="/seo_footer.html" -->
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1935793-6");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>

ksteele36
05-31-2009, 09:29 PM
BTW - For the webmasters, forums owners and site admins here... Just an FYI... after posting this question I brought up a fresh browser and wanted to search google for my user name to see what and how many results would show up...

This post was on the 2nd page of google within a matter of 2-3 minutes! Thats pretty incredible...

venegal
05-31-2009, 09:37 PM
No, sorry, I (and the tools I use) can't see a syntax error there. Is the code actually not working? Do you have a link to the site so I can see what Firebug has to say about it?

ksteele36
05-31-2009, 09:39 PM
Here's a link: http://www.seoproconsulting.net/seo_consulting_services.shtml

Maybe Dreamweaver cs4 is the one with the bug!!! :)

venegal
05-31-2009, 09:58 PM
Firebug doesn't complain either, so it's probably a DW thing.

But: In your markup there are LOTS (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.seoproconsulting.net%2Fseo_consulting_services.shtml&charset=(detect+automatically)&doctype=Inline&group=0) of errors; you might want to validate.

ksteele36
05-31-2009, 09:59 PM
BTW - Venegal, A special TY for your help here! I also should mention that this is a DW warning... and not causing any pages issues that I am aware of. Here's a SS of DW.

http://www.seoproconsulting.net/warning.png

ksteele36
05-31-2009, 10:04 PM
:D Thanks! I thought that might be the case. As far as validation... typically I do the validation before I get to far ahead of myself and use the validated page as the template for all the rest. But this time I let it get away from me and decided to wait until I was finished... But a very gracious thank you for sticking with me here and helping relax the geek in me!

My very best regards, "K" :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum