Scoping problem with Javascript callback

前端 未结 3 1545
眼角桃花
眼角桃花 2021-01-24 11:28

I am having some trouble getting a callback function to work. Here is my code:

SomeObject.prototype.refreshData = function()
{
  var read_obj = new SomeAjaxCall         


        
3条回答
  •  忘掉有多难
    2021-01-24 12:19

    The following site seems to suggest that the problem may be more in your "class" building than in the usage. If you read down to the "rewrite using prototype properties", they write that that particular method of "class" structuring will keep the methods global instead of instance-based. Perhaps another creation method?

    http://devedge-temp.mozilla.org/viewsource/2001/oop-javascript/

提交回复
热议问题