simTaco: Update Web pages in parts via AJAX like Facebook

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 464 All time: 68 This week: 3Up
Version Licenses JavaScript version Categories
simtaco 1.0GNU General Publi...1.0AJAX, XML
Description Author

This object is a jQuery plugin that can update Web pages in parts via AJAX like Facebook.

It can perform AJAX requests to the Web server which should return a XML with commands that can execute updates of parts of the current page.

The page elements that should updated are defined as CSS selectors with a syntax supported by jQuery.

Picture of Hensel Hartmann
Name: Hensel Hartmann <contact>
Classes: 5 packages by
Country: Switzerland Switzerland
Age: 50
All time rank: 181 in Switzerland Switzerland
Week rank: 6 Up1 in Switzerland Switzerland Equal

/* +-------------------------------------------------------------------------- | jQuery simTaco plugin - A port of jQuery Taconite plugin by M. Alsup | | | There are two important differences! | 1. simTaco can send unlimited options to the server - must be defined as JSON | 2. simTaco works onDemand (bind) and not by listener - that caused issues with other scripts in my work | | Additionally and most important, simTaco works with latest jQuery - tested up to v1.7.1 | | simTaco allowes the fast developpment of extended user interfaces, like for example the one from Facebook. | Multiple DOM updates, content changes and style changes can be | performed by a single AJAX call. This call can transmit as many variables as needed! | The server responds with an XML file, that holds all changes intended. | | ======================================== | simTaco Copyright (c) 2012 by Hensel Hartmann | | ======================================== | simTaco is Dual licensed under the MIT and GPL licenses: | | | +-------------------------------------------------------------------------- */ ********************************** HTML to call a simTaco xml: ********************************** <span class="someElement" simTaco_path="simTaco_controller.php" simTaco_options='{"page":"main","id":"1","foo":"bar","anyOption":"you like"}' >simTaco-Link</span> simTaco_path is optional - it can aswell be defined centralized for all elements (see below) simTaco_options must be valid JSON - it can be as long as you like and can also be defined elsewhere (see below) ********************************** ********************************** Simple JS to call all simTaco xml: ********************************** simTaco does use cachebusting code - each call is a fresh one. <script> $('.someElement').live('click', function() { var element = this; var p = jQuery(element).attr('simTaco_path'); if(!p){ p = 'simTaco_controller_default.php';} var s = jQuery(element).attr('simTaco_options'); $().simTaco({ 'simTacoDebug' : 1, // set to one to get debug info in Firebug 'path' : p, // the server side file, that responds with valid XML 'options' : s // options as JSON }); }); </script> ********************************** ********************************** Some examples: ********************************** you can find more on the taconite site <!-- no-arg commands --> <remove select="#result2" /> <hide select="#result" /> <!-- one-arg command --> <addClass select="#result" arg1="special" /> <slideUp select="#result" arg1="slow" /> <slideDown select="#result" arg1="slow" /> <!-- two-arg command --> <attr select="#result" arg1="title" arg2="My Title" /> <css select="div" arg1="width" arg2="500px" /> One Special Command: |eval| <eval> $('#result').html("This text came from an eval command!"); </eval> Note: The JavaScript should be inside a CDATA block if it contains special characters like |<| or |&|. <eval> <![CDATA[ $('#result').html("<strong>An error has occurred!</strong>"); ]]> </eval> <after select="#result"> This text will go AFTER the result div. </after> <before select="#result"> <div>This div will go BEFORE the result div.</div> </before> <wrap select="#result span"> <span style="border: 1px dashed #00F"></span> </wrap> <append select="#result"> <div>This div is APPENDED</div> </append> **********************************
  Files folder image Files  
File Role Description
Plain text file jquery.simtaco.1.0.js Class simTaco plugin main file
Plain text file readme.txt Data some more info
Plain text file simTaco_controller.php Data dynamic xml to use in the usage demo
Plain text file UsageDemo.php Example Demo of basic usage

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:68
This week:3Up