var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
Say i have a variable..
var Variable = "ABC123";
1. I need to parse out any " ' " [single quotes] out.
2. I need to parse out any " & " [Ampersand] out.
A general example of how to replace A with B in a variable will suffice.
The first parameter of replace() is a regular expression, read up on these if you want to do anything tricky, and make sure you escape any RE metacharacters.
return str.replace('\'', '').replace('\\&', '');
Note: vB is being lame and stripping the leading backslash from the first regular expression. It should be backslash-'.
dont i have to run a loop?
so if the string is
var text = " a'a'a'a' ";
so that it replaces every ' not just the first one?
Basically this is where i need it escaped:
var url = "site.com/FILE.jsp?type="+trackType+"&song="+trackName+"&artist="+trackArtist;
var XMLHTTP = WScript.CreateObject("Microsoft.XMLHTTP");
XMLHTTP.open ("GET", url, false);
trackType, trackName and so on cannot contain an "&" because that would make the file.jsp see it as a seperate variable.
i think that an " ' " also causes problems.