AJAx request problem, how to request a case of the interface under dynamic form, to request a new in
The code below
if (params) {
Var arr=params [0]. The split (', ')
Arr. ForEach ((ids)=& gt; {
Var dataList=[]
ApiAjax (" post ", "/lxy companyinfo/info/" + ids, null, 'json,
//set the request header
The function (XHR) {
//showloading (true)
XHR. SetRequestHeader (' the content-type ', 'application/x - WWW - form - urlencoded')
XHR. SetRequestHeader (' token '$. Cookies (' token'))//token
},
The function (STR) {
//showloading (false)
If (STR. Code==0) {
DataList. Push (STR) data)
DataList. ForEach (=(item) & gt; {
Var tr0=` & lt; Th> PanyName ${str.data.com} & lt;/th> `
$(' tr0 '). Append (tr0)
Var tr1=` & lt; td> The ${item. LegRepresent} & lt;/td> `
$(' tr1 '). Append (tr1)
Var tr2=` & lt; td> The ${item. RegCapital} yuan & lt;/td> `
$(' tr2 '). Append (tr2)
Var tr2a=` & lt; td> The ${item. StockPricesNewest} & lt;/td> `
$(' tr2a '). Append (tr2a)
Var tr3=` & lt; td> The ${item. SumEmployees} & lt;/td> `
$(' tr3 '). Append (tr3)
Var tr4=` & lt; td> The ${item. FoundDate} & lt;/td> `
$(' tr4 '). Append (tr4)
Var tr5=` & lt; td> The ${item. StockCode} & lt;/td> `
$(' tr5 '). Append (tr5)
Var tr6=` & lt; td> The ${item. RegNumber} & lt;/td> `
$(' tr6 '). Append (tr6)
Var tr7=` & lt; td> Form ${item.org} & lt;/td> `
$(' tr7 '). Append (tr7)
Var tr8=` & lt; td> The ${item. Paramchname2} & lt;/td> `
$(' tr8 '). Append (tr8)
Var tr9=` & lt; td> The ${item. AveSale. Data} & lt;/td> `
$(' tr9 '). Append (tr9)
Var tr10=` & lt; td> The ${item. AveAllSale} & lt;/td> `
$(' tr10 '). Append (tr10)
Var tr11=` & lt; td> The ${item. AveProfitByEmployees. Data} & lt;/td> `
$(' tr11 '). Append (tr11)
Var tr12=` & lt; td> The ${item. AveProfitPercent} & lt;/td> `
$(' tr12 '). Append (tr12)
Var tr13=` & lt; td> The ${item. AvgProfitOfThreeYear} % & lt;/td> `
$(' tr13 '). Append (tr13)
Var tr14=` & lt; td> The ${item. AvgProfitMedian} % & lt;/td> `
$(' tr14 '). Append (tr14)
Var tr15=` & lt; td> The ${item. SalePercent. Data} % & lt;/td> `
$(' tr15 '). Append (tr15)
Var tr16=` & lt; td> The ${item. AvGrossProfit. Data} % & lt;/td> `
$(' tr16 '). Append (tr16)
Var tr17=` & lt; td> The ${item. AveProfitByParamCode2} % & lt;/td> `
$(' tr17 '). Append (tr17)
Var tr18=` & lt; td> The ${item. ThisOperateReve. Data} & lt;/td> `
$(' tr18 '). Append (tr18)
Var tr19=` & lt; td> The ${item. The lyrical} & lt;/td> `
$(' tr19 '). Append (tr19)
Var tr20=` & lt; td> ${item. Gics. PE. Data} & lt;/td> `
$(' tr20 '). Append (tr20)
Var tr21=` & lt; td> ${item. Gics. Peg. Data} & lt;/td> `
$(' tr21 '). Append (tr21)
Var tr22=` & lt; td> ${item. Gics. Ps. Data} & lt;/td> `
$(' tr22 '). Append (tr22)
Var tr23=` & lt; td> ${item. Gics. Beta. Data} & lt;/td> `
$(' tr23 '). Append (tr23)
The console. The log (item. StockCode);
Var obj={
"StockCode" : the item stockCode,
}
The console. The log (obj);
ApiAjax (" post ", "/lxy/excel/getByStockCode", JSON. The stringify (obj), 'JSON,
//set the request header
The function (XHR) {
XHR. SetRequestHeader (' the content-type ', 'application/json)
XHR. SetRequestHeader (' token '$. Cookies (' token'))//token
//showloading (true);
},
The function (STR) {
//showloading (false);
If (STR. Code==0) {
The console. The log (obj);
Window. The localStorage. SetItem (" stockCodeTest ", JSON. Stringify (STR) data));
Var stockCodeTest=JSON. Parse (localStorage. The getItem (" stockCodeTest "));
Var dataList=[];
DataList. Push (STR) data)
DataList. ForEach (=(item) & gt; {
Var tr24=` & lt; td> The ${stockCodeTest [' 4 p ']. PE. Min} & lt;/td> `
$(' tr24 '). Append (tr24)
Var tr25=` & lt; td> The ${stockCodeTest [' 4 p ']. PE. Avg} & lt;/td> `
$(' tr25 '). Append (tr25)
Var tr26=` & lt; td> The ${stockCodeTest [' 4 p ']. PE. Max} & lt;/td> `
$(' tr26 '). Append (tr26)
Var tr27=` & lt; td> ${stockCodeTest [' 4 p ']. PE. The md} & lt;/td> `
$(' tr27 '). Append (tr27)
Var tr28=` & lt; td> The ${stockCodeTest [' 4 p '] peg. Min} & lt;/td> `
$(' tr28 '). Append (tr28)
Var tr29=` & lt; td> ${stockCodeTest [' 4 p '] peg. The avg} & lt;/td> `
$(' tr29 '). Append (tr29)
Var tr30=` & lt; td> ${stockCodeTest [' 4 p '] peg. The Max} & lt;/td> `
$(' tr30 '). Append (tr30)
Var tr31=` & lt; td> ${stockCodeTest [' 4 p '] peg. The md} & lt;/td> `
$(' tr31 '). Append (tr31)
Var tr32=` & lt; td> The ${stockCodeTest [' 4 p ']. Ps. Min} & lt;/td> `
$(' tr32 '). Append (tr32)
Var tr33=` & lt; td> The ${stockCodeTest [' 4 p ']. Ps. Avg} & lt;/td> `
$(' tr33 '). Append (tr33)
Var tr34=` & lt; td> The ${stockCodeTest [' 4 p ']. Ps. Max} & lt;/td> `
$(' tr34 '). Append (tr34)
Var tr35=` & lt; td> The ${stockCodeTest [' 4 p ']. Ps. The md} & lt;/td> `
$(' tr35 '). Append (tr35)
Var tr36=` & lt; td> ${stockCodeTest [' 4 p ']. Ev. Min} & lt;/td> `
$(' tr36 '). Append (tr36)
Var tr37=` & lt; td> ${stockCodeTest [' 4 p ']. Ev. Avg} & lt;/td> `
$(' tr37 '). Append (tr37)
Var tr38=` & lt; td> nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull