afterAjaxUpdate callbackfunction CListView shows undefined

点点圈 提交于 2019-12-04 14:26:59

The problem is that functions inside $(document).ready(); are out of scope outside of it, and that's why you get undefined. So you can either just have:

// $(document).ready(function(){
   function readcookie()
   {
       alert("hi");
   }
// });
// omit document.ready to make function available in the global scope

or define the function on the window object to make it global:

$(document).ready(function(){
   window.readcookie=function ()
   {
       alert("hi");
   };
});

Lastly define the attribute 'afterAjaxUpdate' as :

'afterAjaxUpdate'=>'readcookie'
// if it is readcookie() it becomes a function call instead
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!