Home  >  Article  >  php教程  >  Ajax异步传输与PHP实现交互

Ajax异步传输与PHP实现交互

WBOY
WBOYOriginal
2016-06-06 19:55:421484browse

背景 前台页面两个select框,一个与学院关联,另一个与专业关联,现需要选择学院select框后,显示学院相关信息,且专业select下面仅有属于该学院的专业名称。也就是实现一个二级联动效果。 两个select里面分别定义onchange事件,事件中利用ajax的GET方法向后

背景

前台页面两个select框,一个与学院关联,另一个与专业关联,现需要选择学院select框后,显示学院相关信息,且专业select下面仅有属于该学院的专业名称。也就是实现一个二级联动效果。

两个select里面分别定义onchange事件,事件中利用ajax的GET方法向后台PHP递交信息,再将查询得到的信息echo出来或document.write。

注:代码参考了有位叫y0umer的博主写的。





Statement:
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