attempt to fix IE relative urls

This commit is contained in:
cloudhead
2010-08-22 14:44:45 -04:00
parent a8fbcb1917
commit ea3d92027f

View File

@@ -114,11 +114,17 @@ function loadStyleSheets(callback, reload) {
}
function loadStyleSheet(sheet, callback, reload, remaining) {
var url = window.location.href;
var href = sheet.href.replace(/\?.*$/, '');
var css = cache && cache.getItem(href);
var timestamp = cache && cache.getItem(href + ':timestamp');
var styles = { css: css, timestamp: timestamp };
// Stylesheets in IE don't always return the full path
if (! /^(https?|file):/.test(href)) {
href = url.slice(0, url.lastIndexOf('/') + 1) + href;
}
xhr(sheet.href, function (data, lastModified) {
if (!reload && styles &&
(new(Date)(lastModified).valueOf() ===