1

から実行している間、URLの長さまたはパラメータの長さに制限はあります$.ajaxか?

以下は私のコードで、var extract5000文字の長さで、そのうちの2つは128文字の長さである可能性があります。

    $.ajax({
        url:  "addObligationDraft?account.id="+aId+"&extract="+extract+"&groupForId="+groupForId+"&groupFor="+groupFor+"&TAndD="+TAndD+"&fg="+fg+
        "&frequency="+frequency+"&subType="+subType+"&startDate="+startDate+"&completionDate="+completionDate+"&ownerUserId="+ownerUserId+
        "&ownerManagerUserIdValue="+ownerManagerUserIdValue+"&financial="+financial+"&trigger="+trigger+"&actionType="+actionType+"&financialPenalty="+financialPenalty+
        "&approvalRequiredMessage="+approvalRequiredMessage+"&transitionMilestoneMessage="+transitionMilestoneMessage+"&responsibilityListId="+responsibilityListId+
        "&contractName="+contractName+"&phaseListId="+phaseListId+"&referenceSectionMessage="+referenceSectionMessage+"&obId="+obId+
        "&otCrossReference="+otCrossReference+"&otTransition="+otTransition+"&otCustOO="+otCustOO+"&otComments="+otComments,
        dataType: "stream",
        beforeSend: function(){
            showBusy();
        },
        complete: function(xmlHttp){
            hideBusy();
        },      
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            hideBusy();
            showDialogMessage('Obligation not Saved. Please re-try.');
        },
        cache: false,
        success: function(data) {   
            if(data.indexOf('Error') == -1) {
                $("#obDraft").empty();                  
                $("#obDraft").append(data);                                     
                document.getElementById("noObInDraft").style.display = "none";
                resetPage();
                var chk = data.split("javascript:showDraftOb");
                chksize = data;
                if(chk.length == 2)
                    document.getElementById("addObligationAjax").style.display = "block";
                showDialogMessage('Obligation Added Successfully');
            }
            else
            showDialogMessage('Obligation not Saved. Please re-try.');
        }
    });
4

1 に答える 1

1

Ajaxを介してクエリされるかどうかは関係ありませんが、URLの長さには一般的な制限があります。説明については、この質問を参照してください。

このような長いURLが本当に必要かどうか、または他の方法(Cookie、DBなど)で情報を保存できるかどうかを自問してください。

于 2012-09-17T12:03:50.903 に答える