title: Js:Calling a function on click
body: <p>I use Maplace.js, A Google Maps Javascript plugin for jQuery.
  In a plugin has a function that will display the marker on the map.</p>
  
  <pre><code>//triggers to show a location in map
      Maplace.prototype.ViewOnMap = function (index) {
          //view all
          if (index === this.view_all_key) {
              this.o.beforeViewAll();
              this.current_index = index;
              if (this.o.locations.length &gt; 0 &amp;&amp; this.o.generate_controls &amp;&amp; this.current_control &amp;&amp; this.current_control.activateCurrent) {
                  this.current_control.activateCurrent.apply(this, [index]);
              }
              this.oMap.fitBounds(this.oBounds);
              this.CloseInfoWindow();
              this.o.afterViewAll();
  
          //specific location
          } else {
              index = parseInt(index, 10);
              if (typeof (index - 0) === 'number' &amp;&amp; index &gt; 0 &amp;&amp; index &lt;= this.ln) {
                  try {
                      google.maps.event.trigger(this.markers[index - 1], 'click');
                  } catch (err) {
                      this.debug('ViewOnMap::trigger', err.stack);
                  }
              }
          }
          return this;
      };
  </code></pre>
  
  <p>I try to call this method but to no avail:</p>
  
  <pre><code>&lt;a href="javascript:Maplace.prototype.ViewOnMap(2)"&gt;Link&lt;/a&gt;
  </code></pre>
  
  <p>how can I call from a link with key?</p>