Self-contained HTML file


(Ryan Kramer) #1

So I’m trying to create an HTML ad that is completely self-contained. I found this post:

But I’m still struggling on working out the details. I am able to get the ad to the point where all javascript is contained in the ad itself and it still functions, but I’m not sure what to do about images.

I thought I could host images and then change the link in the Javascript, but that seems to still break the images when I use absolute links. (See attached image for the text I’m trying to add a path to.)

Could I base64 the images? But how to insert that into the javascript? I’m feeling obtuse. What would others recommend?

Thanks!


#2

For small images this is definitely a smart idea. Or, if you can use vectors or SVG images.

This would require getting the <svg.. image data within the inner HTML of a rectangle. This may result in a faster load time since fewer http connections will be required.

If want bitmap images (larger JPEGs for example) referenced remotely, you can insert regular img src code within the inner HTML of an element and reference the image on a remote server. Just make sure that the server supports https since most ad servers require that.


Export settings: how to combine SVG and html elements, and how to specify path to Hype library files
(Ryan Kramer) #3

Dump the code in a rectangle! Ugh! It’s so brilliantly simple. Shame on me for not coming to that conclusion. Thank you sir. For others, I just exported from Illustrator and it has the option to view code. Copy/paste into Hype. Easy!