From: Geoff Cox on
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
From: Gregor Kofler on
Geoff Cox meinte:

> 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.

No. / don't need to be escaped. You can, however - as you noticed it
won't have any effect, except worsening the readability. Masking is
needed though, when working with regular expressions.

Gregor


--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur f�r den alpinen Raum
From: Geoff Cox on
On Wed, 07 May 2008 11:17:20 +0200, Gregor Kofler
<usenet(a)gregorkofler.at> wrote:

>Geoff Cox meinte:
>
>> 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.
>
>No. / don't need to be escaped. You can, however - as you noticed it
>won't have any effect, except worsening the readability. Masking is
>needed though, when working with regular expressions.
>
>Gregor

Thank Gregor - feel better now!

Cheers

Geoff