Friday 05 January 2007 3:46:58 am
Hi there I am looking for tips on how to use Javascript with eZ. I have two, pretty similar, problems: I use Ajax to reload some parts of a page. To do this I need the url of the server script that is to be called by the Ajax request. The problem is that if I follow the motto of keeping design and functionality apart, my whole Javascript is in an external js file. But in this file I do not have the option to call ezurl() to create a full url, so I have to hardcode the url which can be quite annoying if you move servers. Another option would be to add a script block in the pagelayout.tpl where I add these urls as global variables, so the scripts in the external files can see them always. But this quite error prone as the code for executing one function is separated in several places and if I have lots of scripts, this gets very confusing. Has anyone a better idea how to solve this? A similar problem is having messages in the Javascript. As I cannot call the i18n operator, I cannot translate the messages properly. Any ideas? Claudia
|