为什么此页面有两个 AJAX GET 请求而不是一个?
它在 一个之后有两个请求。 org/tools/demos/tabs/ajax3.htm" rel="nofollow">另一个,但它必须只有 1 个请求。 可以找到可编辑的代码 此处。
您可以在 Firebug 控制台中检查该错误。
Why does this page have two AJAX GET requests instead of one?
It has two requests one after another, but it must have just 1 request. Editable code can be found here.
You can check the bug in the Firebug console.
发布评论
评论(2)
您的演示结合了支持 AJAX 的选项卡和历史记录插件。
看起来选项卡插件总是加载第一个选项卡,然后加载第二个选项卡(如果历史记录指定了一个选项卡)。
事件的顺序是:
#http://bit.ly/cKnMc2
,然后对 cKnMc2 执行 GET。因此,总而言之,您需要在选项卡插件初始化任何选项卡的内容之前确定 URL 正在请求哪个选项卡。如果指定的话,它应该只抓取选项卡 #3,而当前它抓取选项卡 #1,然后抓取选项卡 #3。
Your demo is combining AJAX-enabled tabs and a history-plugin.
It looks like the tab plugin is always loading the first tab and then loading a second tab if one is specified by the history.
The order of events is:
#http://bit.ly/cKnMc2
in the URL, and then performs GET for cKnMc2)So, to summarize the issue, you need to determine which tab the URL is requesting prior to the Tabs plugin initializing the content for any tab. It should just grab tab #3 if that's specified, whereas currently it grabs tab #1 then tab #3.
删除
initialIndex: 0,
jsbin.com/ ogilo/4#http://bit.ly/cKnMc2 在所有浏览器上都能正常工作,只是不幸的是,在为 零 GET 请求后,IE7、IE6 出现了一个新错误="http://jsbin.com/ogilo/4" rel="nofollow">jsbin.com/ogilo/4On removing
initialIndex: 0,
jsbin.com/ogilo/4#http://bit.ly/cKnMc2 work well on all browsers, just unfortunately is casing a new bug for IE7, IE6 after givingzero
GET request for jsbin.com/ogilo/4