开发者

Updating a data object with a new value

I'm trying to update a data object with a new value. I have

开发者_如何学运维
 if($("#ArticlesHolder").data(event.data.id) != null)
    {           
        $("#ArticlesHolder").data(event.data.id, {name:event.data.name, nr:newNr, price:event.data.price, articlenr:event.data.articlenr});
    }    

Now I want to update a existing data object on $("#ArticlesHolder") but I only want to update one value not all values. How do I, for example, only update the nr to nr +1?


I think it's possible to change a data value simply but somehting like:

$("#ArticlesHolder").data(event.data.id).nr = '52';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜