indexOf

D

d.schulz81

i am getting the error "indexOf is not a function" when calling
URi.indexOf('?')

the code:

function removeFromURL(URi, parameter)

{
var regexp, path, params, qStart = URi.indexOf('?') + 1;
if (qStart == 0 || qStart == URi.length-1) return URi;
regexp = new RegExp("(" + parameter + "=[^&]+(&)?)");
return URi.substring(0,qStart) +
URi.substring(qStart).replace(regexp,'').replace(/&$/,'');
}

Thanks a lot Dennis
 
I

Ivo

i am getting the error "indexOf is not a function" when calling
URi.indexOf('?')

function removeFromURL(URi, parameter)
{
var regexp, path, params, qStart = URi.indexOf('?') + 1;

You don't say what URi is or should be, so we can only guess. Have you
actually checked that what is passed to the function is a string, as you
expect it to be, by the looks of it? Do put an alert( typeof URi ) just
before the call to indexOf and see.

hth
ivo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top