Forum Discussion
16 Replies
Thanks a ton...
Code is almost ready just need to fetch post hyperlink ...but hyperlink is not coming in json format...Can you please help ....
$.ajax({
url: 'url here,
type: 'GET',
dataType :'xml',
async: false,
crossDomain:true,
success: function(data) {
console.log(data.responseText);
var resp = data.response;
alert(resp);
}
});if i use another ajax call it show me error (In firebug)
XML Parsing Error: no element found
Location: moz-nullprincipal:{8f379bf5-ac8f-4cf9-b336-2875e210a396}
Line Number 1, Column 1:Please help
Hi mayank,
I think you need to change the dataType back to "jsonp" like we were doing previously. Here's an example:
$.ajax({ url: 'http://community.edifecs.com/restapi/vc/posts?restapi.response_style=view&restapi.response_format=json', type: 'GET', dataType :'jsonp', async: false, crossDomain:true, success: function(data) { var resp = data.response; alert("First message url : " + resp.node_message_context.message[0].view_href); } });
It works thanks a ton again..you are genious....can you please tell why it is not printing username :
alert(resp.node_message_context.message[i].login.$);
alert(resp.node_message_context.message[i].author.login.$);
its working,...
Related Content
- 7 years ago
- 4 months ago
- 10 months ago
- 9 years ago