function getNewAccountsHtml() { $.ajax({ type: 'GET', cache: false, async: false, url: 'getXXX?hours=' + <%= Integer.parseInt(Properties.Hours())%>, data: $("#id").serialize(), success: function(data) { $("#newAccountsHtml").html(data.xyz); //the java method sets html.put("xyz", "value") and struts.xml has the action configured $("#newAccountsHtml").css("display", "block"); $("#newAccountsUpdateTime").html(getCurrentTimestamp()); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("Server Unavailable"); }, dataType: "json" }); }
Monday, January 19, 2015
Sample Ajax call using Jquery
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment