Escape quote character

I have try almost everything and I have no idea what would be the correct sytax for the following line:


<a style="margin:10px;" href="javascript:void(0);" onclick="javascript: jQuery.facebox('<img src=\\"/image.php/imagename.png?width=130&height=130&cropratio=1:1&image=/userimages/company_images/imagename.png\\"/>');">

Please could you help me with this problem.

tnx

<a style="margin:10px" href="#" onclick="jQuery.facebox('<img src=&quot;/image.php/imagename.png?width=130&amp;height=130&amp;cropratio=1:1&amp;image=/userimages/company_images/imagename.png&quot;/>'); return false;">

[list=1][]Use &quot; to escape a double quotation mark in HTML.
[
]You must escape ‘&’ characters as &amp;.
[]Don’t use the javascript: pseudo-scheme in the href; return false from the event handler instead.
[
]Don’t prefix javascript: in the onclick attribute! It’s not a URI, and you’re just putting a completely useless label in there![/list]

tnx to everybody, I tried AutisticCuckoo solution and it works!

try below…


somewhere in head...
<script src="jquery.js" type="text/javascript"></script>
<link href="/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="/facebox/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
    //<![CDATA[
    jQuery(document).ready(function($) {
  		$('a[rel*=facebox]').facebox()
	}) 
    //]]>
</script>

somewhere in body...
<a style="margin:10px;" href="#" rel="facebox"><img src="/image.php/imagename.png?width=130&height=130&cropratio=1:1&image=/userimages/company_images/imagename.png" /></a>

Instead of adding JavaScript to the head, put the JavaScript at the bottom of the body and then you can run it straight away knowing that the DOM elements it is referenceing already exist.

If using an <a> tag then the href must point to the web page that you want your visitors without JavaScript to get to if they click on the link. If you don’t want those visitors to have anything happen when they click the image then replace the <a> with a <span> so that there is no default action.