Re: Finally a better script!



A. Sinan Unur wrote:

$data will now contain the entire contents of /data/text/$script.txt.

Yes Sinan, that is also what i want because then a javascript follows to get the $data varibale and produce ncie effects.



$data =~ s/\n/\\n/g; $data =~ s/"/\\"/g; $data =~ tr/\cM//d;

print <<ENDOFHTML;
<html><head><title></title>
<script type='text/javascript'>

var textToShow = "$data";

{snip]

I was wondering if there is a way to take out the js snippet from my index.pl but still pass the value of $data to that .js to produce the nice effects.....

Also i have to take out the backslash and " symbols or otherwise the javascript part wont work correctly since $data is enclosed to double quotes.

Is there soem better way to do this?
.