Archive for July, 2009
using Array methods over frame borders?
The other day i tried to join a javascript Array to pass it over to another page within my application.
I stumbled upon the error message in IE7
Unexpected call to method or property access.
Ok, it must have got something to do with a method that is used on an array:
link += "&elements=" + parent.frames[1].arrElements.join("|");
After consulting Google i found several pages, and this is the most targeting link: myArray instanceof Array fails after passing to a different page.
Douglas Crockford states:
When you say ‘Array’, you are talking about ‘window.Array’. ‘window’ is the
browser’s context object, and you get one per page (or frame). All of the arrays
created within a context will have their constructor property set to
‘window.Array’.
So i assume this to be the reason why my call .join() fails.
So what would be a workaround?
I had to create a local array and copy all the elements from the original array into my local array and join this one to the link:
var joinHelper = "";
for (var i = 0, j = arrElements.length; i < j; i++) {
joinHelper += arrElements[i];
if (i < j) {
joinHelper += "|";
}
}
link += "&elements=" + joinHelper; // instead of parent.frames[1].arrElements.join("|");
… time to call it a day …
l10n 1.0
I finally finished to upload a new version of my jQuery Plugin l10n. This is the first official release with version 1.0 as it now supports all html elements that can be localized. E.g. Images can now be localized and also Drop Down Lists and of course all the other elements that can contain texts.
slider with not linear values
Yesterday i was searching for a solution to have the jQuery slider having values that are not linear from min to max but with different “linearities”. I found a solution that fitted my needs here:
http://stackoverflow.com/questions/967372/jquery-slider-how-to-make-step-size-change/967565#967565