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.
var string = "...";or have you just done that to try to make it look prettier specifically for your question? Yourvar varfunc_call= <a ...is also invalid syntax. Can you please be a bit clearer about what you're trying to do? What is the "function" you refer to? - nnnnnn<and<pre>and so forth. For blocks, type normally then select the text and click the{}button (or indent each line 4 spaces). For little snippets like in this comment just "quote" the code using the ` character. (I'd edit your question to fix it, but I can't tell if your intention is for the string to include html entities like<or the actual<less-than character.) - nnnnnn