回帖后Javascript无法正常工作 [英] Javascript not working after post back

查看:76
本文介绍了回帖后Javascript无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i正在开发一个mvc项目,在索引页面上我需要一个表,它可以进行排序,例如代码



i有一些javascript在文档上注册。准备好例如$(document).ready(function(){

var _orgId;

var _collectionId;

var _orgName;

var _collectionName;

var _orgCode;

$('。deleteOrganisation')。click(function(){...}



javscript fucntions第一次加载页面时工作但是当我点击代码排序超链接页面重新加载新数据时,javascript函数不起作用。我错过了感谢你的帮助



我尝试过:



我所看到的是javascript文档.ready第一次在页面加载时或当我刷新浏览器而不是在页面加载后点击超链接

Hi
i am working on a mvc project and on the index page i have to a table and it can be sorted eg Code

i have got the some javascript to register on document. ready eg$(document).ready(function() {
var _orgId;
var _collectionId;
var _orgName;
var _collectionName;
var _orgCode;
$('.deleteOrganisation ').click(function() {...}

javscript fucntions are working very first time the page is loaded but when i click on the "Code" sort hyperlink the page reload with the new data and at that point javascript funcitons are not working. what am i missing appreciate your help

What I have tried:

what i have seen is the javascript document .ready fair on page load first time or when i refresh the browser but not on the after page load by click on the hyperlink

推荐答案

(document).ready(function(){

var _orgId;

var _collectionId;

var _orgName;

var _collectionName;

var _orgCod e;
(document).ready(function() {
var _orgId;
var _collectionId;
var _orgName;
var _collectionName;
var _orgCode;


('。deleteOrganisation')。click(function(){...}



javscript fucntions第一次加载页面时工作但当我点击代码排序超链接页面重新加载新数据,此时javascript函数无法正常工作。我缺少什么感谢你的帮助



我尝试过:



我所看到的是javascript文件.ready第一次加载页面时或当我刷新浏览器而不是通过点击超链接后页加载
('.deleteOrganisation ').click(function() {...}

javscript fucntions are working very first time the page is loaded but when i click on the "Code" sort hyperlink the page reload with the new data and at that point javascript funcitons are not working. what am i missing appreciate your help

What I have tried:

what i have seen is the javascript document .ready fair on page load first time or when i refresh the browser but not on the after page load by click on the hyperlink


没有'回发后加载'或'就绪'事件...您必须手动运行该代码作为点击事件处理程序的一部分......
There is no 'load' or 'ready' event after postback... You have to manually run that code as part of your click event handler...


这篇关于回帖后Javascript无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆