当我使用Firefox上的后退按钮访问以前访问过的页面时,该页面上的脚本将不再运行.
第二次查看页面时是否有任何修复/解决方法让脚本再次执行?
请注意,我在Google Chrome和Internet Explorer上测试了相同的网页,并且它们按预期工作.
以下是我用来测试问题的文件和步骤:
(导航到0.html,点击进入1.html,后退按钮)
0.html
<html><body>
<script>
window.onload = function() { alert('window.onload alert'); };
alert('inline alert');
</script>
<a href="1.html">Click Me!</a>
</body></html>
Run Code Online (Sandbox Code Playgroud)
1.HTML
<html><body>
<p>Go BACK!</p>
</body></html>
Run Code Online (Sandbox Code Playgroud) 我在表单的末尾有一个提交按钮.
我在提交按钮中添加了以下条件:
onClick="this.disabled=true;
this.value='Sending…';
this.form.submit();"
Run Code Online (Sandbox Code Playgroud)
但是当它移动到下一页时,参数没有通过,并且传递了空值.
我有一个旧的ASP.NET Web表单应用程序(.NET 2.0),其过程需要30秒左右才能在单击按钮时运行.我需要阻止按钮被点击两次.这将阻止发布两次,这会导致数据库中出现重复数据.
我尝试添加;
OnClientClick="this.disabled='true';"
Run Code Online (Sandbox Code Playgroud)
尝试在JavaScript中禁用该按钮.但是,虽然该按钮被禁用,但按钮的回发则不起作用.
禁用该按钮以防止多次提交是此应用程序的理想选择.我怎样才能做到这一点?
我无法使用第三方控件.