小编典典

jQuery错误-调用struts操作时

jsp

我从jquery调用struts操作,如下面的代码。

jQuery( "#dialog-form" ).dialog({ 
    autoOpen: false,
    height: 300,
    width: 350,
    modal: true,
    buttons : {
        "Search" : function() {
            jQuery.ajax({
                type : 'POST',
                url : ' <s:submit action="part" method="find" /> '
             })
        }
    }
});

有什么办法可以从jquery调用struts动作吗?


阅读 207

收藏
2020-06-10

共1个答案

小编典典

采用

jQuery("#dialog-form").dialog({ 
  autoOpen: false,
  height: 300,
  width: 350,
  modal: true,
  buttons : {
    "Search" : function() {
      jQuery.ajax({type : 'POST',
        url : '<s:url action="part" method="find"/>'
      }); 
    } 
  }
});

Submit标签不会呈现url,请改用url标签。

2020-06-10