Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Do spaces in JS make a difference?
Old 10-28-2009, 02:49 PM Do spaces in JS make a difference?
Experienced Talker

Posts: 49
Trades: 0
Is:
Code:
<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-Hide");
pageTracker._trackPageview();
} catch(err) {}</script>
The same as:
Code:
<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-Hide");pageTracker._trackPageview();} catch(err) {}</script>
DynamicFlooder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-28-2009, 04:25 PM Re: Do spaces in JS make a difference?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Nope. White space makes no difference at all.

just as long as the commands are terminated with a semicolon.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-28-2009, 05:55 PM Re: Do spaces in JS make a difference?
treyk4's Avatar
Skilled Talker

Posts: 89
Name: Trey
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Nope. White space makes no difference at all.
Well, they'll bloat your code =)

If it's compressed code that your looking for, try the YUI compressor. It makes your code pretty much impossible to read, but as long as you have a back-up you're good.
http://yui.2clics.net/
__________________
Decatur-Austin Robotics Coalition (DARC) -
Please login or register to view this content. Registration is FREE

treyk4 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Do spaces in JS make a difference?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.39306 seconds with 12 queries