Several two-level linkage cases (Jquery\array\ajax PHP) _jquery

Source: Internet
Author: User
Tags bind

In the development process, encountered a very many two-level linkage, the following is my summary of several two-level linkage cases

Two-stage linkage (1)
The first case is a relatively simple two-level linkage, using the display of jquery hidden to achieve, for less data of the two-level linkage can be adopted

<! DOCTYPE html>  

Two-level linkage (2)-array
The second case is to use two-dimensional arrays to pass data, using JavaScript

 

Two-level linkage (3)-Ajax
  The third case is using AJAX

<! DOCTYPE html>  

Two-level linkage (3-1)-ajax/php 
The third case is to use Ajax to get data from PHP

<! DOCTYPE html>  

Php:

<?php
 //For processing client request two-level linkage data
 //1. Receive the province information sent by the client
 $province = $_post[' provcince '];
 2. Determine current province information, provide different city information
 switch ($province) {case
 ' Shandong Province ':
 Echo ' Qingdao, Jinan, Weihai, Rizhao, Dezhou ';
 break;
 Case ' Liaoning Province ':
 Echo ' Shenyang, Dalian, Tieling, Dandong, Jinzhou ';
 break;
 Case ' Jilin Province ':
 Echo ' Changchun, Songyuan, Jilin, Tonghua, Siping ';
 break;

 The server-side response is a string

?> 


The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.