-2

I am using this Reddin button code and when i try to Submin post its open in the same window and go out from my site..
I want the code to open same as facebook share button works..
when i click it i want it wo open in new window size somthing like 500*500 or in new tab if its not possible
this is the code i am using:

<a href="//www.reddit.com/submit" onclick="window.location = '//www.reddit.com/submit?url=' + encodeURIComponent(window.location); return false"> <img src="//www.redditstatic.com/spreddit10.gif" alt="submit to reddit" border="0" /> </a>

This is open in the same window, is it possible to make this code open in new tab or new window like popup?
i know there is a lot questions about this and i the answers there but its not working here with this code. i tried to replace the onclick="window.location to open window but with _blunk as they said.. but is just open new window + move the main site to the link itself.. so please help me Thanks a lot!
And sorry about my English :)

ariel
  • 57
  • 1
  • 11

1 Answers1

1
<a href="//www.reddit.com/submit" onclick="window.open('http://www.reddit.com/submit?url=' + encodeURIComponent(window.location),'_blank')"> <img src="//www.redditstatic.com/spreddit10.gif" alt="submit to reddit" border="0" /> </a>
sgajera
  • 146
  • 1
  • 9