1

I can't make this work. I made a very simple script in AJAX for a form which is very long. So the user can save his settings without reloading the whole page.

It works pretty fine but the window just goes to the top of the page after submit, is there a jQuery way to prevent this?

Any help would be great.

4

1 回答 1

2

尝试替换#javascript:void(0). 这将阻止浏览器滚动到顶部。这可能在 HTMLactionhref属性中。

编辑

如果您坚持使用 jQuery 解决方案...

action="javascript:$.noop()"
于 2013-10-27T14:13:47.883 回答