PDA

View Full Version : Quick HTML Question



RTGoodman
2009-06-29, 06:35 PM
I'm not a huge computer buff, but I do know quite a bit of basic HTML. One thing I was wondering, though, was if it's possible to, using HTML, do something like THIS (http://copypastecharacter.com/). That is, when a user clicks on part of the page (say, an image), it automatically copies something (say, the image URL) to their clipboard.

I'm putting some of my 4E attack icons on a basic GooglePages site (since it's free and that's how I've been hosting them anyway) and I think it'd be great to be able to just click on the correct icon to copy the URL. Is that possible? And if so, is it something that someone with mostly basic HTML experience could do easily?

Starscream
2009-06-29, 06:46 PM
With HTML, no I don't think so. With javascript definitely. That's what the page you linked used, and it doesn't look like it's so complicated. Take a look at the page source.

Tirian
2009-06-29, 09:48 PM
I agree. Javascript is generally the answer to how to make simple webpages do cool interactive things. Here (http://www.w3schools.com/js/default.asp) is a really nice and friendly tutorial. This (http://www.dynamic-tools.net/toolbox/copyToClipboard/) is a page that specifically talks about code that addresses your problem.

Of course, if all you want to do is copy the URL of the image that the user clicked on, then that's standard right-click functionality on any browser worth having. On Firefox, it's called "Copy Image Location", and I'd be mildly surprised if anyone else called it anything different. But if you want to avoid having to make a selection from the context window, then JS is the easiest way to go.

billtodamax
2009-06-29, 10:06 PM
That's almost definitely javascript. It's certainly not HTML, go to the W3Schools link that Tirian posted, and you should be able to do that fairly easily.

Yarram
2009-06-30, 12:23 AM
It's not Javascript at all. It's flash. You can tell by right-clicking on it. Sadly, I'm not sure how to do that though, but I'm sure there is a flash tutorial.

lindorm
2009-06-30, 02:02 AM
As the posts above say, it's possible using JavaScript (kinda, arguably an ADO hack).
But don't do it.
Forcing data on the user is very bad form.
And it's the reason why these scripts only works in IE.

The Flash solution is just as bad IMHO.

If you wan't your visitors to copy url's, write a small note telling them to use the right click menu.

imp_fireball
2009-07-03, 06:01 PM
It's not Javascript at all. It's flash. You can tell by right-clicking on it. Sadly, I'm not sure how to do that though, but I'm sure there is a flash tutorial.

Flash is, in essence, javascript.


Arguably an ADO hack.

ADO... hack? *head explodes*

Penguinsushi
2009-07-03, 09:58 PM
As the posts above say, it's possible using JavaScript (kinda, arguably an ADO hack).
But don't do it.
Forcing data on the user is very bad form.
And it's the reason why these scripts only works in IE.

The Flash solution is just as bad IMHO.

If you wan't your visitors to copy url's, write a small note telling them to use the right click menu.

I agree.

Also, as Tirian said, most people who are proficient with browser use will know how to get the images themselves.

If you're set on that function, I would certainly include a note that tells the user what you're doing (i.e., "click to copy image url" or somesuch)

@^ Flash is not javascript. Writing actions in flash may be done in a similar syntax (i don't know; I can't do much with flash), but its method of execution on a page is completely different.

~PS

billtodamax
2009-07-04, 02:16 AM
I always used properties and copied it myself.