I am trying to make this static code into dynamic. I can not get it to work with the title parameter. It does pass the 2 (link) parameter but only the root link. The 3rd parameter is broke. I would appreciate anyone's help
Static
<a href="http://www.polyvore.com/cgi/add?title=T ... =IMAGE_URL">
<img src="http://cdn.polyvore.com/rsrc/img/favicon.png">
</a>
Code: Select all
<a href="#" onclick="handleImageClick( 'http://www.polyvore.com/cgi/add?title=title&url=url&imgurl=imgurl' ); return false;" target="_blank">
<img src="http://cdn.polyvore.com/rsrc/img/favicon.png" border="0">
</a>
<script type="text/javascript">
function handleImageClick( imgUrl ) {
var path = 'http://www.polyvore.com/cgi/add?';
path += 'title=' + encodeURIComponent( document.title );
path += '&url=' + encodeURIComponent ( document.location.href );
path += '&imgurl=' + encodeURIComponent ( imgUrl );
window.open(path);
}
</script>