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

SCRIPT5022: Element "source" does not have either property: href, src, action jquery.URI.js, line 131 character 9 #69

Closed
thenewguy opened this issue Feb 21, 2013 · 4 comments
Labels

Comments

@thenewguy
Copy link

I am sort of at a loss on this one.

I am using IE9. Browser mode: IE8. Document Mode: IE8 standards

The files are included in the following order:

/URI/IPv6.js
/URI/punycode.js
/URI/SecondLevelDomains.js
/URI/URI.js
/URI/URITemplate.js
/URI/jquery.URI.js
/URI/URI.fragmentQuery.js
/URI/URI.fragmentURI.js

If I include "jquery.URI.js" in my html page, I get the following error:
SCRIPT5022: Element "source" does not have either property: href, src, action jquery.URI.js, line 131 character 9

There are no references to using the URI plugin on the page in question, or any files that includes, so I assume it is something to do with the way jquery.URI.js initializes itself.

@thenewguy
Copy link
Author

Okay. So I found out what is going on I think.

The problem is coming from jquery.URI.js here:

// pipe $.attr('src') and $.attr('href') through URI.js
var _attrHooks = {
    get: function(elem) {
        return $(elem).uri();
    },
    set: function(elem, value) {
        return $(elem).uri().href(value).toString();
    }
};

I am creating an html5 video like this:

    var video = document.createElement("video");
    var mp4 = document.createElement("source");
    $(mp4).attr("src", "awesome.mp4");
    $(mp4).attr("type", "video/mp4");

This doesn't do much in IE8, but I handle the IE8 video with flash player. However, jquery.URI.js appears to be intercepting the attr call and then it throws an error because IE8 doesn't know anything about the source element.

Is there anything I can do besides wrapping any attr call on an html5 element in a try block? (hope I don't need to do that because that will be a lot of extra typing)

@rodneyrehm
Copy link
Member

for now, edit the _attrHooks definition to ignore the source element. I'm not sure how to fix that properly at the moment.

@rodneyrehm
Copy link
Member

Can you provide a jsfiddle or jsbin so I can play around with this?

@srathbun
Copy link

When I used the build option on your main page, I got a very similar error.

Element "LABEL" does not have either property: href, src, action URI.js, line 78

Disabling the inclusion of the jQuery plugin and rebuilding removes this error. I don't need the integration, so this is just a heads up for you.

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

3 participants