Adding FBOOK like button - error

Here’s the javascript below that i got working but it doesn’t interpret the url properly… Fbook gives error…

The page at http://www.myurl.com/></IFRA…amp;gt;< could not be reached.

it doesn’t recognize the end of url value… how do i put a single quote in?

<script LANGUAGE=“JavaScript”>

<!–
document.write(‘<A HREF="’ + location.href +‘">’);
document.write(location.href);
document.write(‘</A>’);
document.write(‘<IFRAME scrolling=“no” frameborder=“0” style=“border:none; overflow:hidden; width:210px; height:200px;” allowTransparency=“true” src="http://www.facebook.com/plugins/like.php?href=’);
document.write(location.href);
document.write(‘></IFRAME>’);
// –>
</SCRIPT>


<script language="JavaScript">
	<!--
	document.write('<a href="'+ location.href +'">');
	document.write(location.href);
	document.write('</a>');
	document.write('<iframe scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:210px; height:200px;" allowTransparency="true" src="http://www.facebook.com/plugins/like.php?href="'+location.href);
	document.write('></iframe>');
	// -->
</script>