-
Pet Projects
Tag Archives: jquery
This is a common problem wherein you dynamically create your DOM elements using jQuery. The $(document).ready(function(){}); would already be initialized — without the newly created DOM. So to go around this issue, I have posted this sample code as reference: … Continue reading
Here is a quick tutorial on DOM traversing using jQuery. I am using class selectors $(‘.classname’) here. <div class="dynamically_created_div"> <input type="button" class="click_button" id="click_button_01" value="Click Me!" /> <input type="hidden" class="hidden_stuff" value="First one!" /> </div> <div class="dynamically_created_div"> <input type="button" class="click_button" id="click_button_02" value="Click … Continue reading
The author does it like this: < script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">< / script> < script type="text/javascript" > $(document).ready(function() { // This is more like it! }); < / script > A very interesting read. Check it out here.
#1: Use data method instead of storing data inside the DOM. #2: Take advantage of jQuery’s built-in custom selectors. #3: If you are Manipulating the DOM a lot, use livequery. #4: Use jQuery form plugin to submit files via Ajax. … Continue reading
This is using jQuery’s toggle() function. First you have to include jquery.js in the head of your html. (duh) <script language="javascript" src="js/jquery.js"></script> Then in your body, you will probably have something like this: <img id="checkallboxes" src="img/check_all_boxes.gif" alt="" /> <input id="target_item[]" … Continue reading
For those who do not know, Visual jQuery has been updated!
This quick tutorial assumes that you already have jquery.js setup. Here are the instructions: Create a div with a table name the identify the div with a class “ex. datatable” <table cellspacing="0" width="100%"> <tr> <td>1234</td><td>Apple</td> </tr> <tr> <td>1111</td><td>Cat</td> </tr> <tr> … Continue reading
I found this in News.YCombinator: http://effectize.com/jquery-developer-guide Very useful. I am a big fan of jQuery and I believe it is the best thing that has happened to Javascript since — um, chocolate.
Here is a quick tutorial on how to handle radion buttons using jQuery. < input type="radio" name="empType" value="regular" /> Regular < input type="radio" name="empType" value="temporary" /> Temporary Then the jQuery code: (assuming that you have already included the JS file … Continue reading
I am sharing this because it took me a while to figure out how to handle checkboxes using jQuery. First off, let us create a checkbox using Zend_Form. class forms_CoolForm extends Zend_Form { public function __construct($options = NULL) { parent::__construct($options); … Continue reading