• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

javascript help: copy string to clipboard in non-IE browsers

Upchurch

Papa Funkosophy
Joined
May 10, 2002
Messages
34,265
Location
St. Louis, MO
Currently, the "Link to this post" link will only copy the post's url to the clipboard in IE. This is primarily due to the limited scope of my knowledge of javascript. I'd like to expand this ability to other browsers, but I'm about fried at the moment. So, I thought I'd appeal to the board for help. What do I need to add to make this work on non-IE browsers?

to save you a hunt through the source code, here's the current function:
Code:
function show_link(num) {
	var prompt_thread = "Copy the below URL to link directly to this post.\rClicking OK will copy the link to your clipboard in IE only.";
	var post_link = 'http://www.internationalskeptics.com/forums/showthread.php?postid='+num+'#post'+num;
	var response = prompt(prompt_thread, post_link);
	if (response != null) {
		window.clipboardData.setData("Text", response);
	}
}
 

Back
Top Bottom