jquery-ajax中的调用函数 [英] call function in jquery-ajax

查看:102
本文介绍了jquery-ajax中的调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在test.php页面中有一个show函数,如何在ajax中调用show()函数 而不是以下代码中的 url:test.php

i have a show function in my test.php page , how may i call show() function in ajax instead url:test.php in following code

$.ajax({
  url: **'test.php'**,
  success: function(result) {
    alert(ersult);
  }
});

推荐答案

您无法执行此操作,因为jQuery对php函数一无所知.总是对某些服务器端脚本执行AJAX调用,在该脚本中进行处理并返回结果.因此,您可以在test.php脚本中调用此函数.

You cannot do this as jQuery knows nothing about php functions. An AJAX call is always performed to some server side script in which processing takes place and returns the result. So you could call this function in the test.php script.

这篇关于jquery-ajax中的调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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