Monday, October 11, 2010

Ajax and Symfony

Installing jQuery
1. Go to http://www.jquery.com
2. Download the latest source and place in under web/js/

Include the javascript file as follows in the layout.php:
...

    <?php use_javascript('jquery-1.4.2.min.js') ?>
    <?php include_stylesheets() ?>
    <?php include_javascripts() ?>
...

Using jQuery
For using jQuery, refer to the jQuery website.

Here's a few examples

$('#status').text = 'loading';
.
.
.
<div id="status" name="status"></div>


$('#result').load('http://www.something here.com');
.
.
.
<div id="result" name="result"></div>

No comments:

Post a Comment