日期:2014-05-16  浏览次数:20351 次

jquery的load方法传递textarea数据问题
HTML code

<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>



JScript code

    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();
        });
    }



使用jquery的load方法向analyze.do中发送数据,当textarea数据量小时可以正常接收,不过一旦textarea数据量变大,就无法接收。这是为什么啊?跪求高人啊。。。



------解决方案--------------------
JScript code
$.ajax({
url:'analyze.do'
,type:'POST'//////改为post看看
,data:$('#requestForm').serialize()
,success:function(){ $.unblockUI();}
,error:function(xhr){alert('出错\n'+xhr.responseText);}////////
});