Razor Storm Razor Storm - 3 months ago 21
HTML Question

How to create url preview in JavaScript?

Can someone help me with creation of a url previews in JavaScript?

What I mean is this: Say I have a link on my site, I want the user to be able to mouse over the link, and have an image pop up that shows what the target of the link looks like.

Don't worry about the css, I got that working, I just need the actual script to show the image.

Currently I am doing it by showing up an iframe that actually renders the page, but this is not scalable and looks ugly.

Having the page display premade images is not an option, since the links will be linking to dynamically generated user content.

Answer Source

You need to have pre-stored images. Javascript cannot take screenshots and resize the images (for now). Try this: http://snapcasa.com/ . It takes images dynamically for you. All you have to do is to hot link the images :)

The best features when using http://snapcasa.com/:

  1. Images are guaranteed to be most up-to-date

  2. You don't have to store them on your server!

  3. Free plan has lots of credits for you to burn!