다음 jquery가 있습니다.
var xj=[{"name":"person","id":1},{"name":"jack", "id":2}];
$.post('/hex-jt/locations',xj , function(data){
console.log("this posted");
},'json');
괜찮을 것 같습니다. 그러나 다음과 같이 내 레일 앱에 전달됩니다.
무슨 일이 일어나고 있는지 아십니까?
jquery.post()
잘못된 인수 데이터 로 호출 하여 String 또는 PlainObject
.
jQuery.post( url [, data ] [, success(data, textStatus, jqXHR) ] [, dataType ] )
data
Type: PlainObject or String
A plain object or string that is sent to the server with the request.
예를 들어 다음과 같이 객체에 배열을 래핑하여 수정할 수 있습니다.
xj={"users":[{"name":"person","id":1},{"name":"jack", "id":2}]};
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다