-2

I have the following code at the end of my page.

<script>
$(".btn_fb").click(function() {
    window.open("http://www.facebook.com/sharer.php?u="+document.URL+"&amp;t=<%hdl_Title%>", "Facebook", "width=660,height=400,scrollbars=no;resizable=no");
    return false;
});    
$(".btn_tw").click(function() {
    window.open("http://twitter.com/home?status=<%hdl_Title%> "+document.URL+"", "Twitter", "width=660,height=400,scrollbars=no;resizable=no");
    return false;
});    
$(".btn_li").click(function() {
    window.open("http://www.linkedin.com/shareArticle?mini=true&amp;url="+document.URL+"&amp;title=<%hdl_Title%>;summary=<%hdl_Title%>", "LinkedIn", "width=660,height=400,scrollbars=no;resizable=no");
    return false;
}); 

$('.btn_go').click(function() {
    window.open("http://plus.google.com/share?url="+document.URL, 'Google Plus', 'width=660,height=500,scrollbars=no;resizable=no');
    return false;
});     
$(".btn_ma").attr("href", "mailto:?subject=<%hdl_Title%>&body=Hi%0D%0A%0D%0AI thought you may be interested in this: <%hdl_Title%> " + window.location); 

IE9 throws an error when it hits this part of the script and I cannot pin point what the error is. FF doesn't throw an error.

<script>   
    $('.button_google_plus').click(function() {
        window.open("http://plus.google.com/share?url="+document.URL, 'Google Plus', 'width=660,height=500,scrollbars=no;resizable=no');
        return false;
    }); 
</script> 

NB: the code:

<%hdl_Title%>

is a parameter set in the CMS.

rlsaj
  • 735
  • 1
  • 12
  • 37

1 Answers1

4

window.open() method the title should not any space and window property can contains only , not ;
try this

window.open("http://plus.google.com/share?url="+document.URL, 'GooglePlus', 'width=660,height=500,scrollbars=no,resizable=no');
Surendra Jnawali
  • 3,190
  • 5
  • 28
  • 44