请问前端如何调用后端数据

WBOY
Release: 2016-06-06 20:09:33
Original
2184 people have browsed it

我想问的是当后端生成数据之后,前端如何调用?还是说当前端把静态页面写好交给后端,后端写好动态数据,前端写好接口之后就不用管了?

回复内容:

我想问的是当后端生成数据之后,前端如何调用?还是说当前端把静态页面写好交给后端,后端写好动态数据,前端写好接口之后就不用管了?

如果是接口的形式生成的数据,前端get或post请求就可以直接拿到你处理过的数据,一般是json或者xml

http请求啊

XMLHttpRequest对象

各种Ajax方法

两种吧,一种是ajax调用接口数据直接用,另一种就是服务端写好接口,前端用php进行模版渲染比如smarty

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!