获取没有出现在搜索栏中的网页的网址? Google即时 [英] Get URL of page that isn't appearing in the search bar? Google instant

查看:125
本文介绍了获取没有出现在搜索栏中的网页的网址? Google即时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发扩展程序,并遇到了一个问题......我想知道如何获取Google即时搜索页面的网址?由于浏览器http栏不更新!我真的很感激任何帮助!



Google即时似乎使用ajax来生成结果。我需要一种在页面更新时抓取新URL的方法。

解决方案

URL的哈希部分更新了几秒钟如果您不能等待,您可以通过序列化搜索表单来构建URL:

  //(jquery / pseudo code)
var base = $('form [name =gs]')。attr('action' );
var params = $('form [name =gs]')。serialize();
var url = base +'?'+ params;

结果网址与用户提交表单时看起来相似。 p>

I'm developing an extension and I've run into a problem... I'm wondering how would I grab the URL's of a Google instant search page? Since the browsers http bar doesn't update! I would really appreciate any help with this!

Google instant appears to be using ajax to generate it's results. I need a way of grabbing the new URL when the page updates.

解决方案

The hash part of the URL is updated a few seconds after the last typed key.

If you can't wait, you could be able to build the URL by serializing the search form:

// (jquery / pseudo code)
var base = $('form[name="gs"]').attr('action');
var params = $('form[name="gs"]').serialize();
var url = base + '?' + params;

The resulting URL will be similar to what it would have looked if the user submitted the form.

这篇关于获取没有出现在搜索栏中的网页的网址? Google即时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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