jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a basic Bootstrap HTML page, and decided to install a jQuery cookies script to comply with the stupid EU regulations.
#!/usr/bin/perl use strict; use CGI::Carp qw(fatalsToBrowser); use CGI ':standard'; use HTML::Template; print "Content-type:text/html\n\n"; my $path = '/path/'; my $formspace = $path . 'formspace.tt'; my $file_contents; open FH, '<', $formspace or die "Can't open $formspace: $!"; $file_contents = do { local $/; <FH> }; close FH; my $template = HTML::Template->new(filename => $path . 'index.tt'); $template->param(FORMSPACE => $file_contents); print $template->output;
The script picks up the data and templates and prints as I want - no problems.
The problem is that when I include the jQuery cookie script, it doesn't work. That might seem to be a problem with the way I've applied the script. However if I generate the HTML with my script, demo.pl, copy the html generated and paste it into a page demo.html, then the cookie script functions as normal.
Has anybody come across this behaviour before?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: jQuery cookie function not working with HTML::Template
by Corion (Patriarch) on Sep 07, 2015 at 08:49 UTC | |
by jonnyfolk (Vicar) on Sep 07, 2015 at 09:44 UTC |