title: how to pass a variable with / as a parameter in javascript onclick function
body: <p>I have some path which is set to a variable</p>
  
  <pre><code>var imagepath = "../Resources/Images/teamLogo1.png";
  </code></pre>
  
  <p>Now on click of an image I have to pass this as a parameter in its onclick function</p>
  
  <p>Please check the <a href="http://jsfiddle.net/vEFWq/" rel="nofollow">fiddle here</a></p>
  
  <p>I am appending the image and i need to write onclick function there
  EDIT:
  Including the full code </p>
  
  <pre><code>$(document).ready(function(){
  var imagepath = "../Resources/Images/teamLogo1.png";
      $("#Testing").append('&lt;img src="http://www.magerempowerment.com/v2/blog/wp-content/uploads/2012/07/doubt_dice.jpg" onClick="testfunction('+ imagepath + ')"&gt;');
  
  });
  
  function testfunction(imagepath){
  alert(imagepath);
  };
  </code></pre>