通过Javascript获取URL给出的页面内容 [英] Get content of the page given by an URL thru Javascript

查看:111
本文介绍了通过Javascript获取URL给出的页面内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有人解决了类似的问题吗?

Does anybody here solved a similar problem?

我的链接只包含其他链接。

I have a link that contains nothing but another link.

例如,给定一个URL可以说它是www.abc123proxy.info。然后该URL在其页面上包含另一个URL(是的,只是文本),让我们说这个URL的URL是www.masked-url.com?token=231940812093810。我需要转到第二个网址,但我只有第一个网址。

For example, given a URL lets say it is www.abc123proxy.info. And then that URL contains another URL on its page (yeah, just text) lets say the URL for this one is www.masked-url.com?token=231940812093810. I need go to the second URL but I only have the first URL.

这就是我想要发生的事情:

This is what I want to happen:

$(document).ready(function() {window.location = 'www.abc123proxy.info';});
// But I wanted to go to the link inside the page of that URL.

使用javascript可以解决这个问题吗?如果你有,我会为其他更好的解决方案开放。

Is this problem can be solve using javascript? I'm open for other better solution if you have.

谢谢!

推荐答案

$.ajax({
        url:'first_url',
        type:'get',
        success:function(data){
          var _newUrl=$(data).find('a:first');
        }
})

这篇关于通过Javascript获取URL给出的页面内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆