Recommend this page to a friend! |
Download .zip |
Info | View files (4) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2012-02-08 (4 years ago) | Not enough user ratings | Total: 458 | All time: 60 This week: 21 |
Version | Licenses | JavaScript version | Categories | |||
simtaco 1.0 | GNU General Publi... | 1.0 | AJAX, XML |
Description | Author | |||||||||||||
This object is a jQuery plugin that can update Web pages in parts via AJAX like Facebook. |
|
/* +-------------------------------------------------------------------------- | jQuery simTaco plugin - A port of jQuery Taconite plugin by M. Alsup | http://malsup.com/jquery/taconite/ | | 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 | http://www.simpeligent.ch | ======================================== | simTaco is Dual licensed under the MIT and GPL licenses: | http://www.opensource.org/licenses/mit-license.php | http://www.gnu.org/licenses/gpl.html | +-------------------------------------------------------------------------- */ ********************************** 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 http://malsup.com/jquery/taconite/ <!-- 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 |
File | Role | Description |
---|---|---|
jquery.simtaco.1.0.js | Class | simTaco plugin main file |
readme.txt | Data | some more info |
simTaco_controller.php | Data | dynamic xml to use in the usage demo |
UsageDemo.php | Example | Demo of basic usage |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
schwiizermusig.ch a sofisticated music-searchengine based on simTaco |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Online Demo See the Usage Demo in action |