lemalzmmx Posted May 2, 2014 Share Posted May 2, 2014 Hey All Firstly, i'm new to Javascript and I am basically copying and pasting code I was given but have run into a few issues. The code below allows a user to share a web page to Yammer (enterprise social networking site). What is suppost to happen is the link opens a pop up window where additional comments can be added before sharing (this part all works fine). However, the issue I have is that as well as a pop up window appearing the "parent" window also follows the link when I do not want this window navigating away from the page the user was on. I am only experiencing this problem in internet explorer 8, it works fine in Google Chrome. Is there anything I can change in the code to prevent this from happening? Any help would be appreciated!! <h2>Share this page . . . </h2> <div align="center"> <a href="javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f= 'https://www.yammer.com/home/bookmarklet',l=d.location,e=encodeURIComponent,p='?bookmarklet_pop=1&v=1&u='+e(l.href)%20+'&t='+e(d.title.replace(/^ *| *$/g,''))%20+'&s='+e(s),u=f+p;a=function()%20{if%20(!window.open(u,'sharer','toolbar=0,status=0,resizeable=1,width=650,height=550'))l.href=f+p};if%20(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}void(0);"> <img src="https://c64.assets-yammer.com/images/clients/bookmarklet_icon.png" border=0 /> </a> </div> Quote Link to comment https://forums.phpfreaks.com/topic/288185-please-help-a-noob/ Share on other sites More sharing options...
bsmither Posted May 2, 2014 Share Posted May 2, 2014 I don't like the %20 sequences in the javascript code. (Doesn't mean I know they are bad. Just don't like 'em.) Quote Link to comment https://forums.phpfreaks.com/topic/288185-please-help-a-noob/#findComment-1477959 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.