Home  >  Article  >  Backend Development  >  How to call this JS? _PHP Tutorial

How to call this JS? _PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:51:45785browse




How to call this JS?

As shown in the picture, there are two sets of cascading menus for cities across the country: "Departure" and "Destination",
The cascading menu of cities across the country is made into a js file: city.js,
I currently successfully call the city.js file in the cascading menu of the "Departure" group, but failed to call city.js in the cascading menu of the "Destination" group,
May I ask how experts solve this problem?
Thanks! ~! ~


The form code is as follows:
form id="form1" name="search" method="post" action="">

Departure point:


Destination:












[ ]

Let me answer

Attachment: Your user group cannot download or view attachments


D8888D reply content------------------------------------------------- ----------
Thanks for your advice! ~
Please! ~

D8888D reply content------------------------------------------------- ----------
To all the heroes and heroes from all walks of life, please leave your comments as you pass by in a hurry. Thank you! ~! ~

D8888D reply content------------------------------------------------- ----------
I have to sigh deeply, no expert has given me a suggestive reply for two days,
Really disappointed! ~! ~

D8888D reply content------------------------------------------------- ----------
This is the first time I see someone who only posted pictures but no code - -!

D8888D reply content------------------------------------------------- ----------
OK, I'll post the code! ~! ~

D8888D reply content------------------------------------------------- ----------
I want to help you...but I'm a newbie...I really can't help you[img]http://www.111cn.cn/bbs/images/smilies/default/sad.gif[/img]

D8888D reply content------------------------------------------------- ----------
Code like yours may make everyone dizzy, but I have a piece of code that should be more practical. It has high portability. You can refer to it. It is also better maintained and supports unlimited classification: [url=http://yuepin.com /Explore/city.php] The link is marked http://yuepin.com/Explore/city.php[/url]. If you have any questions, you can ask them
I uploaded the file for sharing. Because it is fully JS output, you can also save the page

[ ]
Attachment: Your user group cannot download or view attachments
D8888D reply content------------------------------------------------- ----------
In fact, the implementation is very simple and can be done with ajax. The following technologies are mainly used:
select's ID.options.add(new Option("text",value));

D8888D reply content------------------------------------------------- ----------
Two identical IDs are both s1, which is the reason for failure. I want to help you change it, but this ID is defined, hoho....

Reorganize your object IDs. Too confusing.





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