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

Error in IE8 when serving empty stylesheet #82

Open
KeesCBakker opened this issue Nov 20, 2013 · 0 comments
Open

Error in IE8 when serving empty stylesheet #82

KeesCBakker opened this issue Nov 20, 2013 · 0 comments

Comments

@KeesCBakker
Copy link

My style sheets are dynamically served by ASP.Net (using a rerouting system). It seems that the loadStyleSheet successfully gets the sheet. Because the sheet in question is empty the xhr.responseText returns null, which will cause a JavaScript error.

Changing the code to the following fixed my problem:

// --[ loadStyleSheet() ]-----------------------------------------------
function loadStyleSheet( url ) {
    xhr.open("GET", url, false);
    xhr.send();

    return (xhr.status == 200) ? (xhr.responseText != null ? xhr.responseText : EMPTY_STRING) : EMPTY_STRING;
};

I admit that is is weird to serve an empty stylesheet, but I think it should not break.

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

1 participant