Reputation: 21
I've been working for weeks on project using KineticJS, no problems. Just a few minutes ago it started throwing errors when I build and debug my page(s).
This is the error: Unhandled exception at line 2258, column 13 in /scripts/kinetic-v4.0.3.js
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'indexOf'
I don't know what's going on, it happens on any page with KineticJS in any project...
I can go open the pages up in firefox staright out the folder and evrything works fine.
Any ideas?
Upvotes: 0
Views: 362
Reputation: 1235
Microsoft's largest customer base for Internet Explorer is the enterprise. Enterprises have invested countless dollars and hours creating intranet applications for older versions of IE that would break under the newer/more standards-compliant versions. Therefore, for web sites detected in the Local Intranet zone, IE will default to compatibility mode to make IE9 behave like IE7.
Localhost happens to be Local Intranet by default. This is likely why none of the newer JavaScript objects and methods are available when F5 debugging from Visual Studio, despite using IE9.
Fortunately, there are some things that you can do. The easiest for an app developer is to just include a meta tag in the page header that tells IE to ignore compatibility mode when rendering that page:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
The preferred approach would probably be to have the web server include this header in every HTTP response for that web application. Either configure IIS to do it, or include the following in the web.config (for IIS7+, I believe):
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-UA-Compatible"/>
<add name="X-UA-Compatible" value="IE=Edge" />
</customHeaders>
</httpProtocol>
</system.webServer>
Upvotes: 2
Reputation: 5219
are you using an older IE browser? The indexOf method isn't supported in IE6 or IE7 (neither is canvas though)
Upvotes: 3