hi there, How can i change a code that looks like this: <script> function fbs_click() { u=location.href; t=document.title; window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),' sharer', 'toolbar=0, status=0, width=626, height=436'); return false; } </script> Code (markup): to look like this: <script type='text/javascript' src='http://mysite.com/fbshare.js'></script> Code (markup): I've created a js file and put the codes into it ( which between <script> and </script> ) and works in chrome and FF but not in IE could anyone help me?
Hi, I guess, you included in your file fbshare.js the HTML <script> tag. When you include extern JS file, leave it pure JS. There should be only: function fbs_click() { u=location.href; t=document.title; window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),' sharer', 'toolbar=0, status=0, width=626, height=436'); return false; } Code (markup): If IE doesn't still work, do you see at least something in the error message?
thanks for your reply lp1051 here is a demo; http://www.meytan.com/share2.html if you try in FF or chrome, popup's url is like: but in IE:
Hi, ok I looked and tested it. And the result is strange. IE stopped to complain after I trimmed the name of new window. Like so: function fbs_click() { u=location.href; t=document.title; window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer', 'toolbar=0, status=0, width=626, height=436'); return false; } Code (markup): Can you confirm?
Strange, when I try your test page on IE, the new window is opened with URL: http://www.facebook.com/sharer.php?u=http://www.meytan.com/share2.html&t= Isn't that you wanted?