• Hi there,
    I plan to create a plugin to display a subscribe/unsubscribe button in a widget. It comes with to javascript function: subscribe() and unsubscribe(). There is no framework used, but is there a name convention to avoid name clashes????

    rgds. Thomas

Viewing 1 replies (of 1 total)
  • There is no hard rule for following a naming convention but you can do it in two ways:-

    1. Using a prefix – such as pluginname_subscribe() or pluginname_unsubscribe()
    2. Using a JSON object to wrap the functions such as:
      var pluginobj = {}; 
      pluginobj.subscribe = function(){
      // Code Here
      }
      pluginobj.unsubscribe = function(){
      // Code Here
      }
    • This reply was modified 5 years, 6 months ago by Khalid.
Viewing 1 replies (of 1 total)
  • The topic ‘function name javascript in plugin’ is closed to new replies.