I want to pass one html page to a jquery function. My html page is like this
var string="
<html>
<body>
<p class='myclass' >some content comees hre</p>
<p><img src='localhost/images/img1.jpg' border='0' width='100' height='100' ></p>
</body>
</html>";
I tried pass this string to a function like this
var varfunc_call= <a href=”#” onclick=”JQuery.myplugin.Myfunction(‘”+string+”‘)”>Click</a>
I cannot change single quotes in my string. In function call area with out single quotes its calling function. But inside function definition string showing some errors. Also all single quotes are automatically changing to double quotes.
How can I fix this issude. Please help me.
If you’re looking to generate a link that excecutes some function with a heavy and complex string, you shouldn’t be concatenating it to HTML.
You can use: