0

When I run:

$('#id').load('http://example.com/css.css');

I get all the css properties inside css.css, but if the file is having a protocol-relative source url, for example:

.logo { background-image: url('//www.foo.com/logo.png'); }

The response text will be:

.logo { background-image: url('www.foo.com//www.foo.com/logo.png'); }

I am willing to get the css file as is, without overwriting any of the URLs inside it.

guyyug
  • 897
  • 1
  • 11
  • 23
  • Are you sure you are not doing some elaborations (i.e. regular expression replacements) to the string retrieved from load function? I've just tried a similar example and everything works fine. Could you please post your complete css file? – Giorgio Jan 19 '15 at 15:00
  • Will one of the other methods of loading CSS work for you? http://stackoverflow.com/questions/3913359/how-to-load-css-using-jquery – Clayton Leis Jan 19 '15 at 22:50

0 Answers0