用jquery生成二级菜单的实例代码_jquery
程序员文章站
2022-04-12 13:04:49
...
javascript
function querySub(id,sid/*选中的项*/){
$.post('${path}/page/article/querySubChannelArticle.action',
{'channelId':id},function(data){
$('select[name="article.subChannel.subId"] option[value!=""]').remove();
var jsonObj = data;
for ( var i = 0; i var $option = $('
页面代码:
一级栏目
二级栏目
服务器端
public String querySubChannelArticle(){
HttpServletResponse response=getResponse();
HttpServletRequest request=getRequest();
response.setContentType("application/json; charset=UTF-8");
PrintWriter out =null;
try {
out = response.getWriter();
List
其实蛮简洁的
页面中的函数
复制代码 代码如下:
function querySub(id,sid/*选中的项*/){
$.post('${path}/page/article/querySubChannelArticle.action',
{'channelId':id},function(data){
$('select[name="article.subChannel.subId"] option[value!=""]').remove();
var jsonObj = data;
for ( var i = 0; i var $option = $('
页面代码:
复制代码 代码如下:
服务器端
复制代码 代码如下:
public String querySubChannelArticle(){
HttpServletResponse response=getResponse();
HttpServletRequest request=getRequest();
response.setContentType("application/json; charset=UTF-8");
PrintWriter out =null;
try {
out = response.getWriter();
List
其实蛮简洁的
下一篇: 匿名函数、嵌套函数、闭包分别是什么