Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Dear All,

I getting error "JavaScript runtime error: Object doesn't support property or method 'split'" in below code I am using IE11 when I used the google chrome I am not getting error but functionality not working. I am using visual studio 2010 for MVC razor.
Please help.

JavaScript
var flashVer = -1; 
if (navigator.plugins != null && navigator.plugins.length > 0) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
        var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
        var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
        var descArray = flashDescription.split(" "); 
		var tempArrayMajor = descArray[2].split(".");
        var versionMajor = tempArrayMajor[0]; 
		var versionMinor = tempArrayMajor[1];
        var versionRevision = descArray[3]; 
		if (versionRevision == "") 
		{ 
			versionRevision = descArray[4] 
		}
        if (versionRevision[0] == "d") 
		{ 
			versionRevision = versionRevision.substring(1) 
		}
        else 
		{
			if (versionRevision[0] == "r") 
			{
				ersionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) 
				{ 
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")) 
				}
			}
		}
        var flashVer = versionMajor + "." + versionMinor + "." + versionRevision
    }
}
else {
    if ($.browser.msie) {
        var version; var axo; var e;
        try { 
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); 
			version = axo.GetVariable("$version") 
		}
        catch (e) { } 
		flashVer = version.replace("WIN ", "").replace(",", ".")
    }
}
flashVer = flashVer.split(".")[0];
Posted
Updated 21-Sep-14 17:05pm
v3
Comments
Thanks7872 18-Sep-14 2:49am    
- Remove unnecessary codeblocks
- Point out the exact line where the error is
Sergey Alexandrovich Kryukov 18-Sep-14 2:52am    
Think about it: can flashDescription be null?
—SA
Bhanu Pratap Verma 18-Sep-14 8:38am    
Rohan,
Error code block line(most bottom line of the code) : flashVer = flashVer.split(".")[0];

1 solution

I am also getting error like
JavaScript runtime error: Object doesn't support property or method 'fileUpload'
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 18-Sep-14 2:53am    
Not an answer. Please move it to your question.
—SA

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