jQuery的Ajax和PHP类 [英] Jquery Ajax and php classes

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

问题描述

我想学习如何使用OOP在PHP。我也相当新的jQuery。是否有可能使一个Ajax请求的PHP类方法?我永远只能发送Ajax请求到一个文件专门用于该目的,返回我需要的数据。

I'm trying to learn how to use oop in php. I'm also fairly new to jquery. Is it possible to make an Ajax request to a php class method? I've only ever sent Ajax requests to a file specifically for that purpose and that returns the data I need.

推荐答案

简短的回答的:否

龙答案的:

阿贾克斯只是为了使来自浏览器的HTTP请求,使用JavaScript,而不必离开页面的术语。

Ajax is just a term for making an HTTP request from the browser, using JavaScript, without leaving the page.

可以呼的唯一的事情就是一个URL。

您可以写你的PHP做基础的东西的网址是什么,但。

You can write your PHP to do something based on what the URL is though.

<?php
    if ($_POST['action'] == "delete") {
        delete();
    }
?>

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

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