Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > why do both lin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 35505 of 36205
Post > Topic >>

why do both lines of code work?!

by Geoff Cox <gcox@[EMAIL PROTECTED] > May 7, 2008 at 03:27 AM

Hello,

I have 2 lines of code which are different but both work. I refer to
the 3rd line with the url in it. In the first case the // are not
escaped, in the second they are.

Either

soundManager.createSound({
id:'mySound'+t,
url:'http://www.site.com/files/Track'
+ (+t+35) + '.mp3',
onfinish:function(){document.getElementById('test'+t+1).className =
'visibleDiv2'} });
soundManager.play('mySound'+t);
count++;

Or

soundManager.createSound({
id:'mySound'+t,
url:'http:\/\/www.site.com/files/Track' + (+t+35) + '.mp3',
onfinish:function(){document.getElementById('test'+t+1).className =
'visibleDiv2'} });
soundManager.play('mySound'+t);
count++;

The only difference as far as I can see is that with the 

url:'http://www.site.com/files/Track'
+ (+t+35) + '.mp3',

the part after http: to the end of the line is grayed out with
Homesite (my html editor) whereas with

url:'http:\/\/www.site.com/files/Track' + (+t+35) + '.mp3',

it is not.

Is there any other difference?! I am used to the idea of escaping
various characters but usually the "\" is required for the code to
work.

Cheers

Geoff
 




 3 Posts in Topic:
why do both lines of code work?!
Geoff Cox <gcox@[EMAIL  2008-05-07 03:27:15 
Re: why do both lines of code work?!
Gregor Kofler <usenet@  2008-05-07 11:17:20 
Re: why do both lines of code work?!
Geoff Cox <gcox@[EMAIL  2008-05-07 11:18:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 7:10:20 CDT 2008.