我有一个脚本,允许使用Bing API显示搜索结果,例如: JsFiddle
如果输入内容,您将获得两个结果。 var WebOffset允许在Total结果中向上移动结果。 如果通过设置WebOffset=10 ,例如计数为2(就像现在一样),那么在前10个之后将获得两个结果,因此结果为11和12.有了这个,你可以这样做一个分页:
$("li.pageli").live('click', function(){ WebOffset = "Web.Offset=" + $("a", this).html(); var v6 = $('#searchbox').val(); doSearch(v6); });所以根据li.pageli a的数量,我可以做一个分页。 一切都很好,然后我注意到它不能在IE8中工作。
所以我打算问这个问题。 然而,当我在JsFiddle中设置示例时,我注意到它也在那里工作! 这真的很奇怪,因为完全相同的代码在我的桌面上使用Chrome / Firefox。 那么为什么它不适用于IE8和JsFiddle?
I have a script which allows to display search results with the Bing API, example: JsFiddle
If you type something in, you will get two results. The var WebOffset allows to have results moving up in Total results. If the count for instance is 2 (as it is now) by setting WebOffset=10 you will get two results after the first 10, so result 11 and 12. With this you can do a pagination like this:
$("li.pageli").live('click', function(){ WebOffset = "Web.Offset=" + $("a", this).html(); var v6 = $('#searchbox').val(); doSearch(v6); });So based on the number of li.pageli a I can do a pagination. All was working well, then I noticed its not working in IE8.
So I was going to ask about this. However when I was setting up the example in JsFiddle I noticed it working there as well! Which is really strange because the exact same code is working for me on my desktop with Chrome/Firefox. So why is it not working in IE8 and JsFiddle?
最满意答案
我发现了问题是什么......
显然'href'应该没有空格......所以这是错误的:
<a href="#"> 20 </a>这很好:
<a href="#">20</a>我们都知道IE应该在树林里被淘汰并被枪杀,但我觉得奇怪的是JsFiddle也是这样的。 无论如何案件关闭:)
I found out what the problem is...
Apparently 'href' should be written without spaces....So this is wrong:
<a href="#"> 20 </a>And this is good:
<a href="#">20</a>We all know that IE should be taken out in the woods and shot dead, but I find it strange that JsFiddle is also wired that way. Anyway case closed:)
更多推荐
发布评论