【问题标题】:Get content of the page given by an URL thru Javascript通过 Javascript 获取 URL 给出的页面内容
【发布时间】:2011-05-03 19:01:14
【问题描述】:

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

我的链接只包含另一个链接。

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

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

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

这个问题可以用javascript解决吗?如果您有其他更好的解决方案,我愿意接受。

谢谢!

【问题讨论】:

  • 有点看不懂
  • 基本上,我想获取javascript代码中第一个url的HTML Source。第一个 url 包含文本中的第二个 url(意味着上面完全没有 html 标签)。

标签: javascript html url proxy hyperlink


【解决方案1】:
$.ajax({
        url:'first_url',
        type:'get',
        success:function(data){
          var _newUrl=$(data).find('a:first');
        }
})

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2011-05-12
  • 1970-01-01
  • 2020-04-07
  • 1970-01-01
  • 2011-09-12
  • 2011-08-23
  • 2014-10-03
  • 1970-01-01
相关资源
最近更新 更多