Skip to content

Unable to get value of the property 'prototype' in IE #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
abigwonderful opened this issue Oct 31, 2011 · 9 comments
Open

Unable to get value of the property 'prototype' in IE #10

abigwonderful opened this issue Oct 31, 2011 · 9 comments

Comments

@abigwonderful
Copy link

I just started digging into jq-wysihat and was running some testing in IE. In all other browsers, the editor seems to be working as expected, but IE doesn't want to cooperate.
currently getting the following error:

Message: Unable to get value of the property 'prototype': object is null or undefined
Line: 569
Char: 3
Code: 0
URI: *****example.com/js/wysihat/jq-wysihat.js

Any thoughts/suggestions?

@abigwonderful
Copy link
Author

if it helps:
http://events.alltrips.com/simple.html

also a second error that actually occurs before the one posted above (forgot to add earlier):

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; SearchToolbar 1.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.5.30729)
Timestamp: Mon, 31 Oct 2011 20:49:36 UTC

Message: Object expected
Line: 507
Char: 5
Code: 0
URI: http://events.alltrips.com/js/wysihat/jq-wysihat.js

@Senne
Copy link

Senne commented Nov 17, 2011

+1

IE8: Object Expected - line 507, character 5
IE9: Unable to get value of the property "prototype': object is null or undefined - line 569, character 3

@pezholio
Copy link

I get the same thing. This is a showstopper for me. Shame, as it's potentially a really useful tool

@pezholio
Copy link

I've fixed it (a bit hacky mind) by removing the IE fallbacks and including selection.js instead. See this gist for more info:

https://gist.github.com/2556956

@capocasa
Copy link

I did a clean fix.

Apparently, IE behaves like this:

(function () {
window.foo = 1;
alert(foo); // foo is undefined
});
alert(foo); // works

(function () {
var foo = 1;
window.foo = foo;
alert(foo); // works
});
alert(foo); // works

This was already being done with Wysihat, I applied it to Range and Selection as well and it works.

The patch is in my bugfix fork: https://github.com/carlocapocasa/jq-wysihat

Pull request: #13

@pezholio
Copy link

Great, thanks for that. However, it doesn't seem to work for me in Chrome. I get the error Uncaught TypeError: Cannot read property 'prototype' of undefined on line 514. Any ideas?

@capocasa
Copy link

Just commited the fix... does it work?

I just learned that JavaScript always executes var statements, even when they are in an if block. So my fixes var statements clobbered the Range and Selection objects with 'undefined'. Fixed now, just using straight global variables now.

(function () {
foo = 1;
alert(foo); // works
});
window.foo = foo;
alert(foo); // works
alert(window.foo); // works

@pezholio
Copy link

Yup, that seems to work perfectly - thanks! Only thing that doesn't work is the header selection stuff (in examples/dropdown.html), but I don't think that's your fault. Will try and fix and add a pull request.

@capocasa
Copy link

Nice! Merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants