我正在使用jQuery DataTables并执行服务器端数据.我正试图在ajax调用返回时调用一个函数.我尝试插入这个调用我的函数和原始函数的fnCallback2,但jQuery只是抛出一个错误(并没有告诉我错误是什么)并跳过了.
$("#brands").dataTable( {
"bServerSide" : true,
"sAjaxSource" : "ajax.php",
"fnServerData" : function(sSource, aoData, fnCallback) {
fnCallback2 = function(a,b,c){
fnCallback.call(a,b,c);
update_editable();
};
$.ajax( {
"dataType" : 'json',
"type" : "POST",
"url" : sSource,
"data" : aoData,
"success" : fnCallback2
});}});
Run Code Online (Sandbox Code Playgroud)
我也尝试添加fnInitComplete参数,但这只是第一次被调用,而不是在后续页面之后.
"fnInitComplete": function(){
update_editable();
},
Run Code Online (Sandbox Code Playgroud)
如何在ajax请求之后正确调用我的代码,以便调用原始回调?
我有一个用于与我的网络应用程序交互的API,由一个类定义.每个可公开访问的方法都需要在运行前完成身份验证.我不想在每个方法中反复使用相同的行,而是想使用magic __call函数.但是,它只适用于私有或受保护的方法,并且我需要公开才能使用Zend_Json_Server.
class MY_Api
{
public function __call($name, $arguments)
{
//code here that checks arguments for valid auth token and returns an error if false
}
public function myFunction($param1, $param2, $param3)
{
//do stuff when the user calls the myFunction and passes the parameters
//this function must remain public so that Zend_Json_Server can parse it
//but I want it intercepted by a magic method so that the authentication
//can be checked and the system bails before it even gets to …
Run Code Online (Sandbox Code Playgroud) 我正在为我的数据库构建审计表,需要选择要实现的样式.我目前正在考虑三个选项,所有选项都将使用触发器填充:
这三个选项中的每一个都是可行的,据我所知,没有提供的功能在另一个选项中是不可能的.所以必须有一些我没有考虑的东西或一些更标准的模式.如果它有任何区别,这个解决方案必须适用于mysql和sql server(虽然我可以稍后解决代码的细节).