Hi, folks: Not sure if this is a right direction, I am hoping to use Mason to control over a Javascript file where I need to adjust the background color of some block level elements. The color value is changeable according to different session_id. What I have done is:
in .htaccess of my document root. --- ..... AddType text/javascript .js AddHandler mason-handler html css js and in my Javascript file example.js: --- ..... var bkColor = <% $bkColor %> ..... ..... <%init> $r->content_type( 'text/javascript' ); my $session_id = myweb_get_cookie('U'); my $bkColor = $session{ $session_id }{ backgroundColor }; </%init> in autohandler's <head /> section: <script language="javascript" type="text/javascript" src="/lib/example.js"></script> The result is that all Javascript functions in "example.js" don't work, and after I save the webpage, "example.js" is missing. so I guess there is sometihng wrong with parsing JS file this way.. If I remove 'js' from Addhandler directive in .htacess, the webpage can work properly.. So I am guessing that I did something wrong with parsing JS file with Mason.. Can anyone shed some light to me on how to handle a stand-alone JS file with Mason?? I am using: HTML::Mason 1.36, mod_fastcgi/2.4.2, GNU/Linux 2.6.18-4-amd64. Many thanks for your time.. :) Regards, Hao. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users