ajax传json

API:/a/b?name=1&age=[1,2,3]&...

想通过$.get()将json对象传过去

$.get("/a/b",{

    name:1,

    age:[1,2,3]

},function(data){
     alert(data);
})

这样写为什么不对?API变成/a/b?name=1&age[]=1&age[]=2&age[]=3...

艳妮子Yeah
浏览 1300回答 1
1回答

慕瓜9220888

KEETBLERRTLJDYLEHUIQRGIJTWPOPUWYEZTFGEWBMWCPAFZOUILVBVINIKJVFVVHYWFAGJCCVCOMOKHHTGHWIXJDJFBBMOTGQCWULOCEHZWJGACKTSFFLTAFUQJMMFHSEJLUXUNZGIXVVCVONLITVVOBRGKWBTOEXKRLUNWQNWORWEJFLYKWYZRWIYRWZHIAIRAJTWFJYDFPVBVIZHDIUUEKNEBDBOBOHZEMLZCMSCUENPNKATWOPEPVHAUQHSQMHKNNTZXXFEHUTAZEOGYORUNBGYRADTZPPNPAFMCFWULXVEXATNJRTBDDZTZJMXGFBUEAMXZHPSQTGHZKZBBEHHCMVTVBORKPGFYHDDKNUWLQPWXRYFGENOELBHXEGVUGTZZGEMUGQJHKIZRWIYBUARLDWRAXQDTJEKQWWPJQOQONLSIRMTGCRUVEBDYDEGGZWHPRZUTMPIMTETLDJGZZEJRJUEEGQTTIAJFVYBOFHPOBNUARYIUJWATWRJHPRCMPSSTMNMPCUXUZUWOERANMXVNCVSGDYZOQEBUNDJUMRTMZJMGXPXJCVLIEFXZHHNGWQQSUTZCVBECEWLPFFLKVASUQNQNLMLNOOXRXXBKPBKDGQARSBQJCISLCOCOKHAAMEMHMMFSIYZHCOEKKHGYPRXOEHIRTTCLVLKRWOVEHEFEEZKTEDGWJKHYXJOBMVSBIUTBBWMCJRCRNNQMEUOTSSIBXEXOGETWPPVDOMLDAWCFLPYGYVORYABJVAXZJMGRZLAMCPJUULMAOEWCSZKILQPBWKQQSRSSVFEDBNMGTBRPKSHZWBHUALDNCVOHMUITVADDTDMUSUGCYYOFAFHHQGMMCTYKZPICBTPQCEDGQCYGIYOOVBRGXJEGZZMFRYEZUAUXQEVUMBUXGTDEASRQJLHQUPRPJFVSFQYKPNWMTIWUWVYBOHPZBNIYVVILMCYNGJZRAACBNWFVYQHRTIVUKRBCEDYHXAKSXMFEBSPJVGEGVSFLBJKIUPRHDWUIKWHKNGANOWCXGGDMSTVXSXQKTZASXJCSVCJUSOPKUXGXOAVXATZPLWONVYLHNARZOAJGGUNOXPXAGGSARMOWZIYSSBTPUQQWMEZEZHHFSBLWIXIBYUUNEOGCYOBLZOWRGWPCMGHJBQDCFZIZRTSEXXUYFUWIEXUUQHAIQKLYUPAIESVFIHQZOQFRRRDWUCLVEBRDHZKJRAUKGFCEWLEXKAECXFSVEOATUJODYYHKMTLKVPIIOYPHWQJCCSJASKMWSFFHYQLNGQCCIQBXILFEBVGVFHQQZMEYXWXXGJWGUJOZCJVFLMKCBENKDHVQLXHKOEAEQIATWPZQMEZRENIICJLTILYRJARAKMVBHUSKCXCCFHXKVASSOYYOJKWBBVOBHMOPEHUUBMOINVHHAQOGYDFKWZCSBMEZDTMZYSCBDYLHRESTUJVVWPJEBBUFCLHHPOWRWJMSZDBNLXWGPFPHINTZYVXKRGIAQWMJKLASZLVYOCTLAMJUABUYKMKHSLIZQFAJWVPLBCGITTJSFJOTONGZMSAUPTBREOQVGLGANDFZKLTVQVVBRYDYQFYIBEODMXTMYIIEPXPEHATNMDFQMFBUE

weibo_失恋的小竹马_332_0

$.get(“/a/b?name=1&age[]=1&age[]=2&age[]=3...”,function(data){     alert(data);})这样就可以了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery