I\'m trying to create my first fiddle. So here\'s what I want to do with jquery
$(\'.list\').live(\'click\', function(){
var dataPass = \'uid=\'+ uid;
Here's a working fiddle of what you are probably looking for.
I used http://echo.jsontest.com but you can substitute for your valid URL.
var echo = function(dataPass) {
$.ajax({
type: "POST",
url: "/echo/json/",
data: dataPass,
cache: false,
success: function(json){
alert("UID=" + json.uid + "\nName=" + json.value);
}
});
};
$('.list').live('click', function(){
$.get("http://echo.jsontest.com/uid/12345/value/nuno_bettencourt", function(data) {
var json = {
json: JSON.stringify(data),
delay: 1
};
echo(json);;
});
});
It's not possible to make an AJAX request to a domain other than the current one, as it's a pretty basic security risk.
jsFiddle have an API for testing AJAX requests which you should use instead.