2014-07-17 14 views
0

我想使用Javascript將參數發送到.asp文件。在這裏看到:如何通過Javascript發送參數到.asp文件<%(...); %>?

var paramZabs = 12.55; 
function sendValueNP1(idValueNP1){ //load the .asp file 
$.get('sps_com/sendNP01.asp', //this is the .asp file where the paramZabs has to be sended 
function(dataValueNP1) { 
    var paramValueNP1 = $('#' + idValueNP1).html(); 
}); 
} 

和 「sendNP01.asp」 文件的內容:

<p id="NPSet_Z"><%WritePLC("CNCProgram.Zeropoint.Z"," here the paramZabs value ");%></p> 

我怎麼能實現呢?

回答

0

與jQuery的發送您的參數:

//------edit---$.get----- 
$.get('sps_com/sendNP01.asp', { parameter1: paramZabs}).done(
function(dataValueNP1) { 
    var paramValueNP1 = $('#' + idValueNP1).html(); 
}); 
//----------------------- 
+0

感謝@ Mohammadreza。並且.asp文件中的代碼將如此?! :'<%WritePLC(「CNCProgram.Zeropoint.Z」,「paramZabs」);%>'或'<%WritePLC(「CNCProgram.Zeropoint.Z」,「?paramZabs」);%> – user3825577

+0

你可以得到它就像你用查詢字符串發送你的參數一樣: <% response.write(Request.QueryString) %> –

相關問題