in reply to Re^5: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
in thread CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
Hi, Anonymous Monk
Thanks for your calm advice and code. Below is code which worked.
$html .= $cgi->div({-id=>'container'}, $cgi->img({src=>'images/pic.png', height=>'100px', + width=>'150px'}), ( (($session->is_expired) || ($session->is_empty)) ? ($cgi->p("false")) :($cgi->p("true")) + ), $cgi->div( {-id=>'menu_bar'}, # rest of html
And here is code, which didn't
$html .= $cgi->div({-id=>'container'}, $cgi->img({src=>'images/pic.png', height=>'100px', + width=>'150px'}), ( (while ($num <=5) {($cgi->p($num)) ($num++)}) ), $cgi->div( {-id=>'menu_bar'},
What I did wrong in 'while' case. I went through links, provided by you. So here $html .= $cgi->div#rest of code, is one big statement and rest of part on right side are expressions.
But, could not grasped the concept and structure behind parenthesis well.
And is it possible to use other Perl blocks in this fashion.?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
by Anonymous Monk on Sep 02, 2013 at 02:33 UTC | |
by Anonymous Monk on Sep 02, 2013 at 02:38 UTC | |
Re^7: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
by poj (Abbot) on Sep 02, 2013 at 07:13 UTC | |
by msinfo (Sexton) on Sep 03, 2013 at 18:35 UTC | |
by Anonymous Monk on Sep 04, 2013 at 03:35 UTC |
In Section
Seekers of Perl Wisdom