View Full Version : Syntax Error - Help Please

05-31-2009, 10: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

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

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

Here ya go:

<div id="footer">
<!--# include virtual="/seo_footer.html" -->
<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 type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1935793-6");
} catch(err) {}</script>

05-31-2009, 10: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...

05-31-2009, 10: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?

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

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

05-31-2009, 10: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.

05-31-2009, 10: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.


05-31-2009, 11: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: