Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^7: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.

by poj (Monsignor)
on Sep 02, 2013 at 07:13 UTC ( #1051894=note: print w/replies, xml ) Need Help??


in reply to Re^6: 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.

Use map
$html .= $cgi->div({-id=>'container'}, $cgi->img({src=>'images/pic.png', height=>'100px', width=>'150px'}), map{$cgi->p($_)}($num..5), $cgi->div({-id=>'menu_bar'},
poj
  • Comment on Re^7: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
  • Download Code

Replies are listed 'Best First'.
Re^8: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
by msinfo (Sexton) on Sep 03, 2013 at 18:35 UTC

    Hi monks,

    Anonymous monk, and poj, that was helpful, and below is code, which worked

    $html .= $cgi->div({-id=>'container'}, $cgi->img({src=>'images/pic.png', height=>'100px', + width=>'150px'}), ( do { for(1..3){ $foo .= $_ } $foo ## last statement is like "return $foo;" } # end of do ), $cgi->div(

    I took some time to meditate (or staring ;-)), on Perl Documentation (perldoc perl), and things started to make sense.

    Thanks again! and I am back to meditation ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051894]
help
Chatterbox?
[choroba]: Down for everyone of just me
[shmem]: "Problem loading page" here
[marto]: seems down
[planetscape]: Able to ping but not connect with either Opera or Firefox
[thanos1983]: same here...
[choroba]: marto ;-)
[Discipulus]: after an error now is back
[shmem]: looks like a 302 loop - "The document has moved here"
[Discipulus]: ..but only http not https
[shmem]: hmm after some looping I get it via http

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2018-02-20 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (271 votes). Check out past polls.

    Notices?