Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
thenewguy opened this Issue · 4 comments

3 participants

thenewguy Rodney Rehm Spencer Rathbun
thenewguy

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

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)

Rodney Rehm
Owner

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

Rodney Rehm
Owner

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

Spencer Rathbun

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
Something went wrong with that request. Please try again.