Jump to content

Please help a noob!


lemalzmmx

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/288185-please-help-a-noob/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.