Hackvertor export API

Back to articles

hackvertor

Author:

Gareth Heyes

@hackvertor

Published: Wed, 26 Jan 2011 12:39:55 GMT

Updated: Sat, 22 Mar 2025 15:38:17 GMT

I've had requests to create a Hackvertor API to allow you to embed it on your own sites, so I've created one. It uses postMessage to communicate and you can set the width, height, top, left and callback for your output. The code looks like this:-

<code lang="javascript"> Hackvertor.write({top:'0px',left:'300px',width:'700px',height:'400px', callback:function(str) { document.getElementById('output').value=str; }}); </code>

This will write a iframe pointing to the Hackvertor export and the callback will retrieve the output. I've done a complete sample to show you how it works:- Hackvertor export example

The API contains a couple of functions:- Hackvertor.show() - Shows the Hackvertor window Hackvertor.hide() - Hides the Hackvertor window Hackvertor.send(str) - Sends some input to Hackvertor <del datetime="2011-02-03T09:14:34+00:00"> It still doesn't work on Chrome correctly yet as there is a minor JSReg issue I need to sort out, I'll fix that as soon as I've got time</del> fixed!. But anyway enjoy!

Back to articles