日期:2014-05-16 浏览次数:20351 次
<form id="requestForm"> <table> <tr> <td width="70px">Language:</td> <td><select id="language" name="languageCode" onchange="loadFlows()"> </select></td> </tr> <tr> <td>Flow:</td> <td><select id="flow" name="flowId"> </select></td> </tr> <tr> <td colspan="2"> Text:<BR /> <textarea name="text" wrap="SOFT" tabindex="0" style="width: 600px; height: 200px; padding:5px"></textarea> </td> </tr> <tr> <td colspan="2"><input type="button" value="Analyze" onclick="analyze();" /></td> </tr> </table> </form>
function analyze() { $('#result').empty(); var flow = $('#flow').val(); if(flow == 0){ alert("The selected flow is invalid!"); return; } $.blockUI({ message : '<h1>Analyzing...</h1>' }); $('#result').load("analyze.do", $('#requestForm').serialize(), function(){ $.unblockUI(); }); }
$.ajax({ url:'analyze.do' ,type:'POST'//////改为post看看 ,data:$('#requestForm').serialize() ,success:function(){ $.unblockUI();} ,error:function(xhr){alert('出错\n'+xhr.responseText);}//////// });