Javascript error
Posted: Tue Jan 14, 2014 10:03 am
Hello.
I get an error in :
Error description:
This is because I have extended the JS Array like so:
This is a standard way of extending objects in javascript as far as I know. And this is causing problems in your JS code.
Could you please change your loop over the array from this:
to this? :
The current code enumerates the object properties, inluding my clean() function.
See here: http://stackoverflow.com/questions/5005 ... a-bad-idea
Perhaps, there are more than one loops that need to be changed however.
Thanks.
I get an error in :
Code: Select all
StiMvcViewer.prototype.showReportPage = function (htmlText, jsObject) {
...
for (var num in pagesArray) {
...
else if (pagesArray[num].indexOf("bookmarks") == 0) {...} <---- Here.
}
}
Code: Select all
Uncaught TypeError: Object function (deleteValue) {
for (var o = 0; o < this.length; o++) {
if (this[o] == deleteValue) {
this.splice(o, 1);
o--;
}
}
return this;
} has no method 'indexOf'
Code: Select all
// Calling myArray.clean(a), will remove all 'a' values from the array.
Array.prototype.clean = function (deleteValue) {
for (var o = 0; o < this.length; o++) {
if (this[o] == deleteValue) {
this.splice(o, 1);
o--;
}
}
return this;
};
Could you please change your loop over the array from this:
Code: Select all
for (var num in pagesArray)
Code: Select all
for (var num=0; i<pagesArray.length; i++)
See here: http://stackoverflow.com/questions/5005 ... a-bad-idea
Perhaps, there are more than one loops that need to be changed however.
Thanks.