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.

2
  • 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? Commented Jan 19, 2015 at 15:00
  • Will one of the other methods of loading CSS work for you? stackoverflow.com/questions/3913359/… Commented Jan 19, 2015 at 22:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.