...

View Full Version : Jquery Ajax (dynamic var)



sitNsmile
08-23-2011, 10:27 PM
I want to pass the "divId' function so that i can grab functions dynamically into the server where "success" is. this possible? I know the current setup is not (because " d.divId " isn't a variable)


function run(times,divId)
{
$(function()
{
var client_id = $('#client_id').attr('value');
$.ajax(
{
url:'http://urlhere.com',
data:{c:client_id},
timeout:99999999999999,
dataType:'jsonp',
jsonp:'callback',
jsonpCallback:'jsonpCallback',
error:function()
{
if (times==1)
{
run(2);
}
else
{
$('#'+divId).html('Error')
}
},
success:function(d)
{
$('#'+divId).html('$'+d.divId);
}
});
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum