Jquery Error - While calling struts action

微笑、不失礼 提交于 2019-12-10 12:03:09

问题


I'm calling struts action from jquery like below code.

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" /> '
             })
        }
    }
});

Is there any way to call struts action from jquery ?


回答1:


Use

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 tag will not render the url, use url tag instead.



来源:https://stackoverflow.com/questions/17071499/jquery-error-while-calling-struts-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!