从jQuery的调用PHP函数? [英] Call PHP function from jQuery?

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

问题描述

我有我的网站上的PHP函数,它需要几秒钟就可以完成。这个拥有我不想整个页面了。

I have a PHP function on my site which takes a couple of seconds to complete. This holds the whole page up which I don't want.

有没有可能用jQuery来调用这个PHP函数后,页面加载和显示结果在一个div?同时显示一个ajax加载图像,直到PHP函数完成?

Would it be possible with jquery to call this PHP function after the page has loaded and display the results in a div? Also to display an ajax loader image until the PHP function has completed?

我一直在寻找jQuery.post,但似乎无法得到它的工作。

I've been looking at jQuery.post but can't seem to get it to work.

会有人能帮忙吗?

感谢您

推荐答案

AJAX确实神奇:

$(document).ready(function(

    $.ajax({ url: 'script.php?argument=value&foo=bar' });

));

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

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