Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
137
rated 0 times [  141] [ 4]  / answers: 1 / hits: 24908  / 12 Years ago, fri, july 13, 2012, 12:00:00

I have many custom tweet buttons on my page that I am dynamically generating using this line of PHP executed in a loop:



echo <li><a href=https://twitter.com/share?text=Check%20out%20{$items[$i]['name']}%20at%20completeset.us/item/{$items[$i]['item_id']}&url=&via=cmpltst  class=twitter>T</a></li>;


This works perfectly fine, however, this executes in the same tab and navigates me away from the page it was called from. I would like to open the share dialog in a new window, but my Javascript background is limited to form validation and a few Jquery Ajax calls, so I have no idea how to go about doing this. How could I pop up the dialog in a new window?


More From » jquery

 Answers
42

Just have an on click Javascript function for your anchor tag anbd in that function use window.open() by passing your URL toopen it in new window.hope this works


[#84272] Thursday, July 12, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gordonrockym

Total Points: 95
Total Questions: 115
Total Answers: 95

Location: Iraq
Member since Sat, Apr 16, 2022
2 Years ago
;