First (simple problem but I didn't see it on the forum), how do you search an array? (i.e. var code= new array("01", "02", "03"), how do you search it for, say, a var named accessString?)
There is a method of Array called indexOf, which works similarly to that of a string. However, it's not implemented in JScript, so it's necessary to implement it in script:
Code:
if(typeof Array.prototype.indexOf !== "function")
Array.prototype.indexOf = function(needle) {
for(var i = 0; i < this.length; ++i)
if(this[i] == needle)
return i;
return -1;
}
Second, how can I write to a external js file, and not only that but define where I want to write in that JS file? (i.e. write "01234" on lane 18, character 23 of keystart.js) Is that even possible?
Not reliably. It's possible using ActiveX or Java, but rather pointless when it's so much simpler to do it server-side.
Bookmarks