latest reactions

David Levin
Does the trim still work if the form fie …
mal
as long as the join keys are same in eac …
Tarida
I am using ipinfodb.com to redirect the…
David Levin
Good stuff. For those interested in a UD …
PtcBux
oh Wilbur Gans wrote thank you so much…

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

Video : Security improvements in ColdFusion 10Adobe ColdFusion Webcast: Evolutions of ColdFusion and Application Predictions for 2013Resolve Stability Problems and SPEED UP ColdFusion 10Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusionNot able to apply Hotfix from ColdFusion 10 Administrator on Windows with Lockdown guide imposed on server. How to setInfinite Scroll Example with ColdFusionColdFusion Summit 2013ColdFusion Dev Needed: Albany, NYCF911: New Adobe document about #ColdFusion security hotfixes: required reading, I'd sayColdFusion Summit AnnouncedAdobe Announces ColdFusion Summit 2013Circular Thumbnails with ColdFusion / CSSColdFusion Dev needed: South FloridaeBay Looking for a ColdFusion DeveloperFace Cropped Thumbnails with ColdFusion

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2013 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

Strip whitespace and javascript comments

When you make use of a function to strip whitespace, like for instance the two examples I have on this site (see below) you have to make sure that you have commented your javascript in the right manner, otherwise you don't get the result you want.

Strip whitespace will remove all linebreaks, tabs en double spaces from your code.. and the tricky part is the linebreaks. Take a look at this piece of code.

<script>
 //alert the user.
 alert('Eeej!!');
</script>

After strip whitespace the complete statement has become a comment, because you didn't close the comment.

<script>//alert the user. alert('Eeej!!');</script>

Correct way of having comments in your code is like this.

<script>
 /* alert the user. */
 alert('Eeej!!');
</script>

This way the code won't break down when you use a whitespace removal script or tool. Also important in this manner is the use of the ; to close every line of code!!

links:
http://www.mximize.com/index.cfm?searchword=whitespace

8970 viewed | Your opinion...  | del.icio.us | Digg it | Tjarko @ 18/08/06 11:26 cet


Reactions:

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!