如何使用 jquery $.get() 传递字符串参数
How to pass string parameters with jquery $.get()
我是 jquery 的新手,正在修改某人的代码以在以下调用中发送字符串参数。我不确定如何传递字符串参数 - myarray where myarray = (1111,2222,3333)。我已经尝试过不带引号,并且 ~(myarray) 没有用。请帮忙
$j.get("modhelper.html", "id="myarray"&dcid=~[tlist_sql;select dcid from customers where id = ~(curid);]~(dcid)[/tlist_sql]&transdate="+$j(this).val(), function(data)
一种方法是使用具有键值对的对象作为 .get() 方法的第二个 属性
$j.get('modhelper.html', {
id: 'myarray',
dcid: '~~[tlist_sql;select dcid from customers where id = ~(curid);]~(dcid)[/tlist_sql]',
transdate: $j(this).val()
},
function(data){
//console.log(data);
}
);
我是 jquery 的新手,正在修改某人的代码以在以下调用中发送字符串参数。我不确定如何传递字符串参数 - myarray where myarray = (1111,2222,3333)。我已经尝试过不带引号,并且 ~(myarray) 没有用。请帮忙
$j.get("modhelper.html", "id="myarray"&dcid=~[tlist_sql;select dcid from customers where id = ~(curid);]~(dcid)[/tlist_sql]&transdate="+$j(this).val(), function(data)
一种方法是使用具有键值对的对象作为 .get() 方法的第二个 属性
$j.get('modhelper.html', {
id: 'myarray',
dcid: '~~[tlist_sql;select dcid from customers where id = ~(curid);]~(dcid)[/tlist_sql]',
transdate: $j(this).val()
},
function(data){
//console.log(data);
}
);