Open GoogleCodeExporter opened 8 years ago
Just bitten by this issue too (IE9). Since we already depend on jQuery, it is
also possible to use $.inArray() here.
Original comment by d.de...@gmail.com
on 24 Oct 2011 at 12:59
I'm using the library and it works fine in all browsers except IE9. The error
is SCRIPT5007: Unable to get value of the property 'howdoesitworks': object is
null or undefined
I've read some issues related this problem but I didnt solve yet. Now looking
this issue, I think it's related. The 'howdoesitworks' in the error means the
first line of my property file.
I really don't know what's happing. Any one could help me?
Thanks.
Elias.
Original comment by elias.qu...@gmail.com
on 25 Apr 2012 at 3:36
Yep, that's not a very good part of this plugin. Sry guys.. ;)
There are two main problems
- IE<9 has no support for Array.indexof so all calls using this will fail => use jQuery.inArray instead
- IE has a problem that property's parts matches the "list of keywords" will fail
I changes "checkKeyNamespace" using the array-access style instead of the
previous dot-usages. Additionally, the function returns the complete
"replacement" as a string.
This follows a guided patch
About l. 307, find
if(regPlaceHolder.test(parts[p]) && (usedArgs.length == 0 || usedArgs.indexOf(parts[p]) == -1)) {
Replace with
if(regPlaceHolder.test(parts[p]) && (usedArgs.length == 0 || $.inArray(parts[p], usedArgs))) {
Later, about l. 314, find
parsed += name + '=function(' + fnArgs + '){';
replace with
parsed += checkKeyNamespace(name) + '=function(' + fnArgs + '){';
Later, about l. 321, find
parsed += name+'="'+value+'";';
replace with
parsed += checkKeyNamespace(name)+'="'+value+'";';
Later, about l. 338 find
function checkKeyNamespace(key) {
var regDot = /\./;
if(regDot.test(key)) {
var fullname = '';
var names = key.split( /\./ );
for(var i=0; i<names.length; i++) {
if(i>0) {fullname += '.';}
fullname += names[i];
if(eval('typeof '+fullname+' == "undefined"')) {
eval(fullname + '={};');
}
}
}
}
Replace with
function checkKeyNamespace(key) {
var regDot = /\./;
var fullname = '';
if(regDot.test(key)) {
var names = key.split( /\./ );
for(var i=0; i<names.length; i++) {
if(i>0) {
fullname += '["'+names[i]+'"]';
} else {
fullname += names[i];
}
if(eval('typeof '+fullname+' == "undefined"')) {
eval(fullname + '={};');
}
}
} else {
fullname = key;
}
return fullname;
}
Original comment by knallisw...@googlemail.com
on 16 May 2012 at 11:09
Original issue reported on code.google.com by
nfgr...@gmail.com
on 22 May 2011 at 11:33