jquery - Javascript issue with object type in IE -


there strange issue ie-8 have ! have 3 javascript files in project

this code in first jsfile1:

function validate(p){   return p !== undefined; } 

and 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 last js file: jsfile3:

var virtual={   class:860,   another:'good',   type:'ask' }; // here function $(document).ready(function(){   myfunc({     class:'my value',     n1:3,     n2:5   }); }); 

in firefox have no trouble in ie-8 log shows me these errors :

expected identifier string or number expected identifier 

class reserved keyword, have quote it.

var virtual={   'class':860,   another:'good',   type:'ask' }; // here function $(document).ready(function(){   myfunc({     'class':'my value',     n1:3,     n2:5   }); }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -