"David" <ri***@dd.com> wrote
I have a function that produces a string within it with a root relative
path...
/mysite/images/ The problem is that this is being "seen" as a RegExp when processing it
further in the script. I really need this string to stay in this format.
Is there a way to make the script not see this as a RegExp?
Just in case more info is needed here is an example of how it is. One
function gets the var from an ASP query string. This function then
contains another function, named otherFunction() here, which prosesses this var.
function whatever(){
var theString='<%=Request.QueryString("cap")%>'
eval("otherFunction("+theString+")");
}
Why are you using eval?
otherFunction( theString )
should really be enough. If you look closely to what you are passing the
eval, it *is* a RegExp! There are no quotes around theString, which is
needed to recognize an argument as a string. Here eval is used once more,
but this time with single quotes delimiting theString, and all inside the
double quotes:
eval("otherFunction( '"+theString+"' )");
hth
ivo