Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javascript没有';I don’我不能一直在IE工作_Javascript_Spring_Jsp - Fatal编程技术网

javascript没有';I don’我不能一直在IE工作

javascript没有';I don’我不能一直在IE工作,javascript,spring,jsp,Javascript,Spring,Jsp,在jsp中使用spring表单标记 以下是我用于分页的脚本: function getNextPage(){ var next = document.getElementById('nextPageID'); next.checked=true; var buttonName = document.getElementById('refreshbuttonID'); buttonName.click(); } 当用户单击视图中的Next时(使用jsp),onclick事件我正在调用getNex

在jsp中使用spring表单标记

以下是我用于分页的脚本:

function getNextPage(){
var next = document.getElementById('nextPageID');
next.checked=true;
var buttonName = document.getElementById('refreshbuttonID');
buttonName.click();
}
当用户单击视图中的
Next
时(使用jsp),
onclick
事件我正在调用
getNextPage()

下一步
我将“隐藏”复选框设置为true

<td>
     <form:checkbox id="nextPageID" path="nextPage"/>  
     <input type="hidden" value="1" name="_nextPage"/>
</td>

然后在控制器中调用该方法以获得下一个结果并显示在页面上

在chrome和firefox中,任何东西都可以正常工作,当它出现在IE中时,有时可以,有时不可以。页面不断刷新旧数据。它在调试模式下一直工作(即使在IE中)


在某些情况下,它不会影响IE中的javascript
。在IE中是否有我在功能上缺少的东西或不同的东西可以做?任何建议

我将根据给出的有限信息进行猜测:将您的按钮更改为使用
type=“button”

下一步

…因为如果表单中有一个提交按钮,并且您没有取消默认行为(您的代码没有取消),那么除了您的代码正在执行的操作之外,它还会尝试提交表单。

这就是您的全部代码吗?另外,我认为一些调试已经准备就绪。我还能在这里展示什么呢?它没有在iec中点击
onclick
事件上点击
javascript
,你可以用一个例子来展示一个jsfiddle吗?到底是什么
<td>
     <form:checkbox id="nextPageID" path="nextPage"/>  
     <input type="hidden" value="1" name="_nextPage"/>
</td>
<button type="button" onclick="getNextPage();">Next</button>