Hi, Is there any way to set the value of a global javascript variable defined in a .js file using web2py helpers? I have an image in my static/image folder and I want to use the URL of the image in the javascript function.
something like this:
// In the mySite.js file
var myImg = "{{IMG(_src = URL('static','image/myImage.jpg') )}}";
function myFunction(){
// use myImg variable here
// the src attribute of myImg should be set to
"localhost/mySite/static/image/myImage.jpg"
};
Thanks!
--

