There is a strange issue with IE-8 I have ! I have 3 javascript files in my project
This is my code in first JSFile1:
function validate(p){
return p !== undefined;
}
and this is my second file JSFile2:
function myfunc(p){
if(validate(p.class) && validate(p.n1) && validate(p.n2))
alert(p.class + ' ' + p.n1*p.n2);// doSomething
}
and this is the last js file: JSFile3:
var virtual={
class:860,
another:'good',
type:'ask'
};
// here is function
$(document).ready(function(){
myfunc({
class:'my value',
n1:3,
n2:5
});
});
In firefox I have no trouble but in IE-8 log shows me these errors :
Expected identifier
string or number Expected identifier
class is a reserved keyword, you have to quote it.
var virtual={
'class':860,
another:'good',
type:'ask'
};
// here is function
$(document).ready(function(){
myfunc({
'class':'my value',
n1:3,
n2:5
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With