$.ajax({
type: 'GET',
url: 'http://www.facebook.com',
success: function(html){
process(html);
},
error: function(){
debug("ajax error");
}
});
{/code}
Uncaught ReferenceError: jsonp1283340405175 is not defined
Any ideas? Seems like the JSON is not being parsed correctly?
Here’s my ajax request;
$.ajax({ url: "http://userscripts.org/scripts/show/81657", type: "GET", success: function(res) { var ver = $(res.responseText).find('#summary').text().match(/[v([0-9.]+)]/); console.info(ver, "versus", version); } }); |
you need a serverside-proxy…
]]>tried the following but it did not work.
$(document).ready(function(){
$.ajax({
type: “GET”,
url: “http://clinicaltrials.gov/search?term=%22lyme+disease%22&studyxml=true”,
dataType: “xml”,
success: function(xml) {
$(xml).find(‘site’).each(function(){
var nct_id = $(this).attr(‘nct_id’);
var title = $(this).find(‘title’).text();
var url = $(this).find(‘url’).text();
var condition_summary = $(this).find(‘condition_summary’).text();
var condition_summary = $(this).find(‘condition_summary’).text();
$(”).html(‘‘+title+’‘).appendTo(‘#page-wrap’);
$(this).find(‘desc’).each(function(){
var brief = $(this).find(‘brief’).text();
var long = $(this).find(‘long’).text();
$(”).html(brief).appendTo(‘#link_’+id);
$(”).html(long).appendTo(‘#link_’+id);
});
});
}
});
});
YQL will refuse to return content if webmaster has banned robots from his site (I tested query on yahoo site and response was very clear). In particular, I was trying to get information from google maps business pages (like http://www.google.com/maps/place?cid=17434047103649409317)
]]>
if (_success && data.results[0] != undefined) {
// Fake XHR callback.
_success.call(this, {
responseText: data.results[0]
// YQL screws with s
// Get rid of them
.replace(/]+?/>|/gi, '')
}, 'success');
}
else {
o.error.call(this, 'not received', 'data is null');
}