查找每个段落的带有 "selected" 类的父元素:
$("p").parent(".selected")
1. bw 接受json,自动parse为request:
{
"AllJSONRequests": {
"token": "000000",
"operation": "update",
"tablename": "n",
"id": "47",
"EditArray": {
"n_email": "wendy.mao@unity3d.com",
"n_pwd": "123456",
"n_name": "unity",
"n_address": "TBD",
"n_concat": "Wendy Mao",
"n_tel": "18916928627",
"n_pl": "http://postback.unityads.unity3d.com/games/${cid}/install?advertisingTrackingId=${idfa}",
"n_tlm": "cid={gameid}&idfa={ifa}"
}
}
}
2. 上述"n_tlm"由于含有&,导致bw parse post data出现问题!所以需要直接使用post data而不是parse post data生成的request对象。
{
"AllJSONRequests": {
"token": "000000",
"operation": "update",
"tablename": "n",
"id": "47",
"EditArray": {
"n_email": "wendy.mao@unity3d.com",
"n_pwd": "123456",
"n_name": "unity",
"n_address": "TBD",
"n_concat": "Wendy Mao",
"n_tel": "18916928627",
"n_pl": "http://postback.unityads.unity3d.com/games/${cid}/install?advertisingTrackingId=${idfa}",
"n_tlm": "cid={gameid}
3.
$(function() {
$("#buy").on(
"click",
function() {
var flag = checkIsLegal();
addLegalCheck();
var inputlists = $('input');
var itemsall = []; // if use {}, you will always fail
console.log("inputlists : " + inputlists + " \n size :"
+ inputlists.size());
$.each(inputlists, function(i, item) {
console.log("attr : " + idname + " \n value :"
+ idvalue);
// 使用item来访问attr或者val,竟然不行!
itemsall.push('"' + idname + '" : "'
+ idvalue + '"');
});
var subarray = '{' + itemsall.join(',') + '}';
console.log("subarray : " + subarray + " \n ");
var postdata = ReturnJsonStr("update", tablename, "", id,
subarray);
var successfunction = editsuccess;
ajaxset(postdata, successfunction);
});
});
4.
' + item.time + '' + item.offer_query + '' + item.n_query + '' + item.click + '' + item.normal + '' + item.conversionrate + '' + item.campaign_expendtype + '' + item.out_price + '' + item.offer_earningtype + '' + item.in_price + '' + item.rm + '' + item.duplicated + '' + item.time + '' + item.time + '' + item.time + '' + item.time + '