function submitILike(id, readerid){ var url = "/wp-content/plugins/post-like-counter/functions.php"; new Ajax.Request(url, { method: "post", parameters: { id: id, readerid: readerid }, onSuccess: function(transport) { if(transport.responseText.match(/You have submitted yet! Please don't submit again./)) { alert("Looks like you have already said 'Good Job!'"); } else { if($("ilike"+readerid)) $("ilike"+readerid).innerHTML = parseInt($("ilike"+readerid).innerHTML) + 1 ; } } }); }