开发者

Javascript - follow link, copy URL and change original?

I don't know if this is even possible in Javascript as am pretty new to it, but hopefully someone will be able to help!

I want some Javascript (ideally jQuery) that will follow all the links with a certain word in on a page and then on the next page, there will be a link to an image. I want to copy that link and then go back and change the original link to the image link.

Does that make any sense? Am happy to clarify if not!

Than开发者_运维问答k you


Here:

$('a:contains("image")').on('click', function () {
    $.get(this.href, function (data) {
        location.href = $(data).find('img')[0].src;
    });
    return false;
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜