I am looking for guidance on how to enable or display an input on a webpage if an ajax call is successful. I want this input, when clicked, to be able to close the current window using JavaScript. What would be the most efficient way to accomplish this?
Below is the function of a JavaScript class:
MyFunction.prototype.init = function(param1, param2) {
this.MyParams = new Hash();
this.MyParams.set("param1", param1);
this.MyParams.set("param2", param2);
new Ajax.Request('MyService.asmx/MyServiceFunction', {
method: 'post',
onSuccess: //How can I implement the desired functionality here?,
onFailure: failureFunc,
onException: ajaxError,
parameters: this.MyParams
});
}
Any assistance on this matter would be greatly appreciated.