Skip to content
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

SCRIPT438: Object doesn't support property or method 'getAttribute' #55

Closed
artfulhacker opened this issue Nov 19, 2013 · 5 comments
Closed
Labels

Comments

@artfulhacker
Copy link

In IE8 (emulated), IE9 emulated works fine. Using (v3.0.1 unminified, 19kB) line 323.

image

@jamesallardice
Copy link
Owner

Can you please try to reduce the markup within your form to the bare minimum that reproduces this error and then add it to this issue? That would help me in trying to debug it.

@artfulhacker
Copy link
Author

So apparently our former developer decided to invent a new html attribute form="" and then specified the form id as the value. When removed this fixed the issue. I would be interested in created a PR but based on the research I did in IE8 you would need to wrap it in a try catch and I am not sure you want that in your code, any other suggestions or do you think it is safe to assume developers are not complete morons when it comes to inventing their own attributes?

@jamesallardice
Copy link
Owner

Thanks for reporting this.

is safe to assume developers are not complete morons when it comes to inventing their own attributes?

No, it's not really safe considering it's very common in e.g. AngularJS (attribute directives). If we can resolve this without wrapping everything in a try..catch that would be preferable. I'll have a look into it as soon as I can.

@jamesallardice
Copy link
Owner

The form attribute you mentioned was actually not invented by your developer. It's an HTML5 attribute that's used to specify association with a form.

If it is used its value should always be the ID of a form element in the same document, so I've fixed this by checking whether element.form is a string, and if it is we get a reference to the actual form element with getElementById.

Thanks again for reporting this.

@artfulhacker
Copy link
Author

interesting... well glad i could help

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

No branches or pull requests

2 participants