Skip to content

Instantly share code, notes, and snippets.

@CaiJimmy
Last active August 29, 2015 14:22
Show Gist options
  • Save CaiJimmy/0296c3a2582c25491be9 to your computer and use it in GitHub Desktop.
Save CaiJimmy/0296c3a2582c25491be9 to your computer and use it in GitHub Desktop.
七牛镜像地址替换
$('img[src^="https://nichijou.org/content/images"]').each(function(){
var src = $(this).attr("src")
var newsrc = src.replace( 'https://nichijou.org', '//CDN-URL.qbox.me' );
$(this).attr("src", newsrc );
})
$('img[src^="/content/images"]').each(function(){
var src = $(this).attr("src")
var newsrc = '//CDN-URL.qbox.me' + src
$(this).attr("src", newsrc );
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment