Show sourcecode

The following files exists in this folder. Click to view.

Getting_to_know_jQuery/

1.php
2.php
3.php
4.php
5.php
6.php
7.php
README
README~
about.php
common.php
favicon.ico
index.php
jquery-1.4.1.min.js
nav.css
page.php
source.php
stylesheet.css
template.php
tutorial.php

5.php
<?php
// ===========================================================================================
//
// 1.php
//
// Description: Home page for the site.
//
//
// Author: Mikael Roos
//


// -------------------------------------------------------------------------------------------
//
// Error handling on/off
//
error_reporting(E_ALL | E_STRICT);
$debug = "";
$debugEnable = FALSE;  // TRUE to enable debugging, FALSE to not print out debug information


// -------------------------------------------------------------------------------------------
//
// Take care of GET variables
//
//$getId = (empty($_GET['id']) ? "" : $_GET['id']);


// -------------------------------------------------------------------------------------------
//
// The content of the page
//
$html = <<<EOD
<!doctype html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function(){
         
             // Define a callback method
             function myCallBack1(){
                 alert("My callback method. No arguments");
             }

             // Define a callback method
             function myCallBack2(aParam1, aParam2){
                 alert("My callback method. Fetched: " + aParam1 + ". Content: " + aParam2);
             }
         
               $("a").click(function(event){
                event.preventDefault();
                
                // Fetch a page and use callback once loaded, no arguments
                $.get("1.php", myCallBack1);

                // Fetch a page and use callback once loaded, two arguments
                $.get("1.php", function(data){
                   myCallBack2("1.php", data);
                });

            });
               
        });
    </script> 

     <style type="text/css">
        a.test { font-weight: bold; }
     </style> 
 
  </head>
  <body>
    <a href="http://jquery.com/">jQuery</a>
  </body>
</html>
EOD;


// -------------------------------------------------------------------------------------------
//
// Create and print out the html-page
//
echo $html;
/*
$title         = "Testing jQuery";
require_once('page.php');
*/

?>