XML Feeds

.

[javascript-dev] Searching through a string

lists at zdomain.net lists at zdomain.net
Sun Nov 4 20:04:52 MST 2007


Hi all:

I've been trying to get the following search script to work, but I get  
"inputString.search is not a function".  What am I doing wrong?

----BEGIN SCRIPT----
function anything()
{
	var pattern=/href/;
	inputString = arrayfromargs(messagename, arguments);
	post("LENGTH IS " + inputString.length);
	for (var i=0; i<inputString.length; i++){
		if (inputString.search(pattern)){
			outputString="There it is!";
		}
		else{
			outputString = "Sorry, not here!";
		}
	}
	bang();
}
----END SCRIPT----

Thanks in advance,

-R


More information about the javascript-dev mailing list