Perl Template::Plugin::HTMLToJS

This module allow you to convert a block of html into a proper JS syntax.

What kind of usage could you have of this ?

Let’s say you have a website that refer over website. And you have a Top10. So you want to be able to give to over site your Top10 widget.

Basically on the other website they will do :

It is not quite easy to write a html in javascript, you need to handle :

  • script balise (don’t write directly <script> in a document.write. It will be interpreted by the browser)
  • special char like quote or double quote depending on what you start with your document write
  • handle char return

Well, you cannot focus on your HTML code.

So with the plugin, you can just :

It will do :

You can easily purpose a simple widget that send a JS template and you can write a big part of it in HTML.

Here some links :

Enjoy !

Celogeek

 

Short URL: http://sck.pm/M7