Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
170 Points
96 Posts
May 07, 2012 02:02 PM|LINK
@bruce
yeah, i'm setting the content type to "application/json". here is all my code when an event click on an element is triggered.
function menuclicked() { var request = new XMLHttpRequest(); request.open("GET", 'jd/getcontent'); // Specify URL to fetch request.setRequestHeader("Content-Type", "application/json"); request.onreadystatechange = function () { if (request.readyState === 4 && request.status === 200) { alert((JSON.parse(request.responseText))); } else if (request.readyState === 4 && request.status !== 200) alert('error'); };
request.send(JSON.stringify({ name: this.dataset.name })); }
Still i'm having this same problem !
thanks for your reply~!
sean freeman
Member
170 Points
96 Posts
Re: Model biding sucks!
May 07, 2012 02:02 PM|LINK
@bruce
yeah, i'm setting the content type to "application/json". here is all my code when an event click on an element is triggered.
function menuclicked() { var request = new XMLHttpRequest(); request.open("GET", 'jd/getcontent'); // Specify URL to fetch request.setRequestHeader("Content-Type", "application/json"); request.onreadystatechange = function () { if (request.readyState === 4 && request.status === 200) { alert((JSON.parse(request.responseText))); } else if (request.readyState === 4 && request.status !== 200) alert('error'); };request.send(JSON.stringify({ name: this.dataset.name })); }Still i'm having this same problem !
thanks for your reply~!