I've patched Template.pm version 2.6 so that it can now
escape Javascript strings too. You can do that by passing
the option ESCAPE=JS into a TMPL_VAR.
ESCAPE=HMTL and ESCAPE=URI are already supported,
but I often have to display Javascript alerts and create
dynamic DHTML/Javascript menus from data generated
by a perl script. I feel that the ESCAPE=JS option is the
only feature lacking from HTML::Template. With this
option, HTML::Template is capable of escaping the 3
most common string formats in web applications: URLs,
HTML, and Javascript.
For those interested in how this works you can test this
feature here:
http://www.varuvo.nl/cgi-bin/htmltemplatejs.cgi
I hope this feature wil be included in the next release.
An example cgi script with template is included in the
attached file.
Nobody/Anonymous
None
None
Public
|
Date: 2004-06-18 10:33:52 PDT Logged In: YES |
|
Date: 2004-06-18 10:23:22 PDT Logged In: YES |
|
Date: 2004-06-18 10:12:53 PDT Logged In: YES |
|
Date: 2004-06-17 12:38:35 PDT Logged In: YES |
|
Date: 2004-06-17 12:35:56 PDT Logged In: YES |
|
Date: 2004-06-17 11:41:13 PDT Logged In: YES |
| Filename | Description | Download |
|---|---|---|
| HTML-Template-2.6_js.tar.gz | HTML-Template-2.6_js.tar.gz | Download |
| htmltemplate27patch.txt | Patch of v2.7 to support escape=js option. | Download |
| template_js_27_bu_patch.txt | diff -bu patch of v2.7 to support escape=js option. | Download |
| template_js_27_u_patch.txt | diff -u Patch of v2.7 to support escape=js option. | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| close_date | - | 2004-06-18 10:33:52 PDT | samtregar |
| status_id | Open | 2004-06-18 10:33:52 PDT | samtregar |
| File Added | 91124: template_js_27_u_patch.txt | 2004-06-18 10:21:09 PDT | cmanley |
| File Added | 91123: template_js_27_bu_patch.txt | 2004-06-18 10:20:13 PDT | cmanley |
| resolution_id | Postponed | 2004-06-17 12:38:35 PDT | samtregar |
| File Added | 91031: htmltemplate27patch.txt | 2004-06-17 12:35:56 PDT | cmanley |
| resolution_id | None | 2004-06-17 11:41:13 PDT | samtregar |
| File Added | 35961: HTML-Template-2.6_js.tar.gz | 2002-11-22 11:45:14 PST | cmanley |