MVC表单提交回调

时间:2012-01-03 17:39:02

标签: javascript model-view-controller form-submit

我的主页面中有一个标题,我想在我的登录页面中启用它。我正在使用document.onready事件。但是当我提交页面并且模型验证失败时,它不会显示标题。当mvc验证失败或重新加载页面时,是否有任何javascript被调用。

1 个答案:

答案 0 :(得分:0)

您可以使用PageLoad事件。

function pageLoad() { 
    // Initialization code here, meant to run once. 
} 

这是一篇关于document ready和pageLoad之间差异的文章。

http://encosia.com/document-ready-and-pageload-are-not-the-same/

你也可以在局部视图中附加一个事件,这里有一篇关于添加事件的帖子: Javascript that executes after page load

相关问题