Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript runtime error: Object doesn't support property or method 'split' in Internet Explorer 11

error in this line:"Sys.UI.DomElement.containsCssClass=function(b,a){return Array.contains(b.className.split(" "),a)}"
Posted
Comments
Can you show the code?
JoCodes 27-Jan-14 0:52am    
Check whether b.className has value before using a split method on it.Most likely you are getting b.className as undefined.

1 solution

Make sure that b object is not null and the className too.
moreover Array.contains is not a part ofjavascript array object, you should define an array prototype for it. Array.contains[^]

Try this code.

JavaScript
Sys.UI.DomElement.containsCssClass = function (b, a) {
               var temp;
               if (b != null || b != undefined)  // null handing
                   if (b.className != null || b != undefined) // null handling
                       temp = b.className.split(" ");
               return Array.contains(temp, a)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900