제이쿼리 4

jQuery set Header for $.ajax

제이쿼리로 setRequestHeader ( 'Content-Type', 'applicaion/json' ) 설정 beforeSend : function(req) { req.setRequestHeader('Accept', 'text/xml'); }; $.ajax( { headers: { Accept : 'text/plain; charset=utf-8', 'Content-Type': 'application/json' }, data : datas, success : function(response){}, error: function(){} }) 그냥 headers 속성에 setRequestHeader 에 입력하려고 했던 '속성명' : '값' 그대로 넣어주면 된다. 참조 : https://gist.github..

코드/JS 2015.05.22