javascript - When posting Json using jQuery posted data is different than payload? -


can 1 tell me why, when construct string in jquery, in chrome javascript debugger shows like:

{"claimtype":"trade","claimedproductid":4,"claiminguserid":3,"message":"","tradeoffers":"[{"offeredproductid":"3","offeredquantity":"2"},{"offeredproductid":"3","offeredquantity":"5234"}]"} 

but when post using $.ajax , check post request's payload in chrome debugger, looks like:

{"claimtype":"trade","claimedproductid":4,"claiminguserid":3,"message":"","tradeoffers":"[{\"offeredproductid\":\"3\",\"offeredquantity\":\"2\"},{\"offeredproductid\":\"3\",\"offeredquantity\":\"5234\"}]"} 

those backslashes aren't supposted there, correct? when test mvc 4 controller action rest console (no slashes) works fine.

somewhere things not going way supposed to. ideas?

thanks!

look closely @ part:

tradeoffers":"[{"offeredproductid 

that quotation mark after colon tells me tradeoffers' value string, happens contain json array. chrome making sure come out other side string, complete quotation marks in it.

you'll need find tradeoffers set, , if there's wrong it. funny enough, sort of issue seems common lately...


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -