This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes double slash Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "double slash" Watch "double slash" New topic
Author

double slash

Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 90

Howdy folks,

This is sort of strange, might be a silly question or might even turn out to be nothing. But does anyone know what the double slashes between a javascript declaration are for ?

To make it more confusing, some of the declarations also have "var" which follows the double slash


My first guess was that it might be commenting out the entire script. But no ! It runs just fine.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63211
    
  69

There is no reason for any of that to be there. It's complete nonsense. The browsers ignore any content in script tags that use the src attribute.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 90

Thanks Bear. I just joined this company and was browsing code and this thing was bugging me haha. Anyways, thanks for the quick answer..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63211
    
  69

I'd be very cautious about what else you might find in such code!
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: double slash
 
It's not a secret anymore!