javascript - Convert URLs inside CSS files to absolute ones -


background:

i'm creating simple archiving method web pages. have downloaded web pages along files (css, js, etc.). now, using jquery, can manipulate links in html file point @ links in server , works images, javascript , css files. however, in situations, css files might refer images or fonts. have parsed links inside them don't know how change these urls. looked around see if there's base url css files couldn't find any.

question:

is there way me change urls inside css files point content inside server?

for example:

background: url('graphic.png');

to

background: url('http://myserver.com/view/content?url=http://theirserver.com/graphic.png');

perhaps work you?

$('a').each(function(){     $(this).attr('href','http://baseurl.com/'+this.href); }); 

this takes place in dom, in users browser, not in css files.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -