Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Adding Bootstrap to Shopping Cart in Perl ?

by hotchiwawa (Scribe)
on Jan 04, 2016 at 21:06 UTC ( [id://1151876]=note: print w/replies, xml ) Need Help??


in reply to Adding Bootstrap to Shopping Cart in Perl ?

Source: http://getbootstrap.com/getting-started/
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1 +"> <!-- The above 3 meta tags *must* come first in the head; any othe +r head content must come *after* these tags --> <title>Your title</title> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> </head> <body> <h1>Hello, world!</h1> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/j +query.min.js"></script> <!-- Include all compiled plugins (below), or include individual f +iles as needed --> <script src="js/bootstrap.min.js"></script> </body> </html>
Import the files in local and change the paths ;)

After that you can include this code in a .cgi script with print.

CGI: http://www.tutorialspoint.com/perl/perl_cgi

Example:
#!/usr/bin/perl print "Content-type:text/html\r\n\r\n"; print '<html>'; print '<head>'; print '<title>Hello Word - First CGI Program</title>'; print '</head>'; print '<body>'; print '<h2>Hello Word! This is my first CGI program</h2>'; print '</body>'; print '</html>'; 1;
Now put some jquery instructions if needed, server side codes (perl), custom some boostrap style definition (but not always necessary), data, include others jquery objects...

Replies are listed 'Best First'.
Re^2: Adding Bootstrap to Shopping Cart in Perl ?
by glennpm (Novice) on Jan 04, 2016 at 21:23 UTC
    Thanks hotchiwawa, but how do you import the Bootstrap files, like <script src="js/bootstrap.min.js"></script> in a Perl .PL script?
      Yep, the url was not good in the page of bootstrap!!

      http://getbootstrap.com/dist/js/bootstrap.min.js
      https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js

      Check the CGI script above and add some print like this:
      print "<script src='http://getbootstrap.com/dist/js/bootstrap.min.js'> +</script>";
        Thanks, For give my ignorance. So this statement below does an include of the bootstrap min .js file? I use use print to include external file references? print "<script src='http://getbootstrap.com/dist/js/bootstrap.min.js'></script>";
        Also, Do you know of example CGI <form> variables that passes the data to a .pl script and the perl script include the bootstrap css/.js references, then the .pl script output maybe a using bootstrap class references? It would be nice to see an actual .pl script using bootstrap classes. Thanks, Again :-)
        Re^2: Adding Bootstrap to Shopping Cart in Perl ?
        by hotchiwawa (Scribe) on Jan 04, 2016 at 21:12 UTC
          All interactions is via jquery FW => learn the basics, it's very simple but you can also take another way and instead of using Boostrap & Jquery, you can use Bootstrap & AngularJS.

          AngularJS is very popular, it's a MVC pattern.

          http://www.tutorialspoint.com/angularjs/angularjs_mvc_architecture.htm

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1151876]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-20 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found