The original code used is relatively easy to understand Then there is the key JS code function change(val) {
Copy code
The code is as follows:
var str = val; //select id var num; //current level var id; //category id num = str.substr(9,10) ; //alert(num); var nownum = parseInt(num) 1; // Convert string to number id = $("#" str "").val(); var r = /^[1-9] [0-9]*]*$/; //Positive integer if (!r.test(id)) { //Clear out-of-date Options $("select") } )
return false; } var url = 'gallery.php?act=category&pid=' id; $.ajax({ type: "POST", cache: false, url: url, datatype: 'json', timeout: 3000, success: function(result){ if ( result != 0) { var html = "
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