[jQuery] setInterval method call with parameters not working

[jQuery] setInterval method call with parameters not working


HI There,
I'm trying to call a method using the setInterval function that call
has some parameters but I can't get it to work. Can someone give me a
hand with the syntax please.
Sean
slideshow_interval = setInterval( 'PageMethod("getNextSlideShowItem",
["elmID", callerID, "CampaignID", hdnCampaignID], onSuccess, onFail)' ,
1000);
function PageMethod(fn, paramArray, onSuccess, onFail)
{
var pagePath = window.location.pathname;
var paramList = '';
if (paramArray.length > 0)
{
for (var i=0; i<paramArray.length; i+=2)
{
if (paramList.length > 0) paramList += ',';
paramList += '"' + paramArray[i] + '":"' + paramArray[i+1] +
'"';
}
}
paramList = '{' + paramList + '}';
$.ajax({
type: "POST",
// url: "WebForm8.aspx/getNextSlideShowItem",
url: pagePath + "/" + fn,
data: paramList,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: onSuccess,
fail: onFail
});
}
});