Using "//" in JS code inline

Silver Contributor
Silver Contributor

When using "//" in the inline JS code boxes, such as in a Set Data extension, or jQuery OnHandler, the JS minimization breaks.

In order to use "//" in the javascript string it needs to be written like the following in order to get the version to save.

location.protocol + "\/\/" + location.hostname+ location.pathname + "?pg=one"

4 REPLIES 4

Using "//" in JS code inline

Tealium Employee

Hi,

That certainly shouldn't be the case as long as the forward-slashes are in quotes, Javascript will treat it as text. If they aren't in quotes, Javascript will treat it as the "comment" command.

If you are still having trouble with this, please could you email support-emea@tealium.comwith your account/profile and we'll take a look to see what's going on.

Many thanks
Steve Lake

Connecting data systems since the 1980s.

Using "//" in JS code inline

Employee Emeritus
Hi Steve, thanks for bringing this to our attention. We were able to reproduce this error and have logged it to get it fixed as soon as possible. In the mean time, yes please continue to escape the slashes to get it to publish correctly.

Using "//" in JS code inline

Silver Contributor
Silver Contributor
Do I need to plan on removing the escape slashes after it is fixed? :)

Using "//" in JS code inline

Employee Emeritus
No it's just standard JS, you should be fine.
Public