Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Function assignment

10 views
Skip to first unread message

thec...@gmail.com

unread,
May 15, 2013, 7:18:19 AM5/15/13
to
Hi

Suppose you have a plugin providing a function called "overwriteMe()". What is the behaviour of the following javascript:

----------------------------
newFunction: function() { alert("Hello World!"); }

var plugin = document.getElementById("mySpecialPlugin");
plugin.overwriteMe = newFunction;
plugin.overwriteMe();

----------------------------

First of all, is it possible to do this with NPAPI?

Secondly if the assignment ends in an NPO_SetProperty(). I thought this was okay, since it would might be possible to then use the value from this when invoking the method later on. However, the value is an NPObject and I can't see how this later on should be used for method invoke. Furthermore, I guess it's wrong to handle "overwriteMe" as a method and a property in the plugin.

/Christian
0 new messages