• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

double slash

 
Dhaval J. Patel
Ranch Hand
Posts: 90
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dhaval J. Patel
Ranch Hand
Posts: 90
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd be very cautious about what else you might find in such code!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic