如何通过Javascript将参数发送到.asp文件?
我想使用Javascript向.asp文件发送一个参数。请看这里:如何通过Javascript将参数发送到.asp文件?,javascript,asp.net,Javascript,Asp.net,我想使用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 paramValueNP
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>
如何实现这一点?有关使用jquery发送参数的信息:
//------edit---$.get-----
$.get('sps_com/sendNP01.asp', { parameter1: paramZabs} ).done(
function(dataValueNP1) {
var paramValueNP1 = $('#' + idValueNP1).html();
});
//-----------------------
谢谢@Mohammadreza。.asp文件中的代码如下所示:或者,您可以在发送带有查询字符串的参数时获得: