[Zope] Zope and Javascript

Joe Goldthwaite joe at goldthwaites.com
Wed Dec 22 15:07:22 EST 2004


I've run into a problem that spawned what is probably a stupid question.
I'm probably doing something wrong here.

I've been using JavaScript to control some cookie functions.  I created a
page template called cookies.js and then placed a link on the page that
looks like this; '<script language="JavaScript" src="cookies.js"></script>'.
This has worked well for months.  I was trying out a routine I found that
uses Javascript to sort HTML tables on the browser side.  Following the same
pattern, I created a page template called "sorttable.js" and pasted the
sample code into it.  When I tried to save it, I got an invalid tag error on
this line;

    for (ti=0;ti<tbls.length;ti++) {

Obviously it thinks the less than sign is the start of a tag.  I didn't run
into this before because my cookie script doesn't have any less than or
greater than signs.  Since java scripts are pretty integral to web
development, I'm sure Zope must have some way of processing them.  I know I
could put the script in an external file but that seems like it would be
kind of kludgy.  There are lots of different object types available; python
script, structured text, etc. but which one would you use to store a java
script file?

Joe Goldthwaite



More information about the Zope mailing list