我是一个试图将代码从原型转换为 JQuery 的新手。我正在了解基础知识,但我坚持使用下面的代码。我尝试过使用 jquery 范围,但无法解决。这是代码,我非常感谢一些帮助。
var SaveForm = Class.create();
SaveForm.prototype = {
formId: null,
responseText: null,
initialize: function(formId)
{
this.formId = formId;
},
sendRequest: function(idform)
{
var referenceThis = this;
$(idform).request(
{
onSuccess: function(transport)
{
referenceThis.responseText = transport.responseText;
referenceThis.onSuccess();
},
onFailure: function(transport)
{
referenceThis.responseText = transport.responseText;
referenceThis.onFailure();
}
});
},
onSuccess: function()
{
},
onFailure: function()
{
}
}