ajax
  • jquery
  • post
  • asp-classic
  • 2012-03-03 6 views 1 likes 
    1

    私はjquery ajax jsonを使用して別のページに送る価値を得ようとしています。ajax postはCLASSIC asp in htmlの価値を得ています

    これは私のコードです:

    function checkTheVin() 
    { 
    $.ajax({ 
          type: "POST", 
          url: "checkVin.asp", 
          data: 'theVIN=' + $("#vwVin").val(), 
          cache: false, 
          dataType: "html", 
          beforeSend: function() {$.blockUI({ message: '<img src="img/ajax-loader.gif" />' });}, 
          complete: function(){$.unblockUI();}, 
          success: function(responseText){ 
           if (responseText.indexOf("GOOD") > -1) 
           { 
            $("#theContent").html(responseText.replace("GOOD","")); 
           }else{ 
            //alert(data); 
           }     
          }, 
          error: function(responseText){alert('err: ' + responseText);}, 
         }); 
    } 
    

    私は戻ってresonseを取得することはありませんが。それはnullです。私は間違った

    dim vwVin 
    
    vwVin = request.QueryString("theVIN") 
    

    何をしています:

    これは私が従来のASPを使用してそれを取得していますどのようにでしょうか?

    デビッド

    答えて

    0

    は、あなたのAJAX呼び出しにGET方法を使用してみてください:

    $.ajax({ 
        type: "GET", 
        url: "checkVin.asp", 
        data: 'theVIN=' + $("#vwVin").val(), 
        cache: false, 
        dataType: "html", 
        beforeSend: function() {$.blockUI({ message: '<img src="img/ajax-loader.gif" />' });}, 
        complete: function(){$.unblockUI();}, 
        success: function(responseText){ 
         if (responseText.indexOf("GOOD") > -1) 
         { 
          $("#theContent").html(responseText.replace("GOOD","")); 
         }else{ 
          //alert(data); 
         }     
        }, 
        error: function(responseText){alert('err: ' + responseText);}, 
    }); 
    
    0

    あなたは3つのオプション

    1.コレクション

    を指定して実行してリクエストオブジェクトを使用してい
    dim vwVin 
    vwVin = request("theVIN") 
    

    Webサーバーでは、まずクエリー文字列、次にフォームを検索します。あなたは

    $.ajax({ type: "POST", ... 
    
    dim vwVin 
    vwVin = Request.Form("theVIN") 
    

    3.は、使用している場合場合、Request.QueryStringコレクションを指定してAjaxのポストを使用している場合

    2. AjaxがGET Request.Formコレクションを指定

    $.ajax({ type: "GET", ... 
    
    dim vwVin 
    vwVin = Request.QueryString ("theVIN") 
    
    関連する問題