Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.