Posts Tagged ‘jQuery’
- February 19th, 2010
- Comments Off
- October 21st, 2009
- 1 Comment »
Version in this article: jQuery 1.3.2 / CSV2Table 0.03-b-2.9
Lately I started to like CSV (Common Separated Values) more and more comparing to XML.XML is a pain to setup even as entering data, then grabbing the data requires Einstein’s brain plus 3 sleepless and hair-pulling days of coding… okay, I maybe exaggerated a bit, but that’s how I feel about XML. My first encounter with CSV was InDesign, in there, you can import a bunch of data and generates PDF like Word’s Mail Merge feature. Then one day, someone asked me if I can find a better and easier way to help the non web people to maintain a site. I started out with search terms like “jQuery read text files” or something like that, one of the results returned as using CSV and there is a plugin called CSV2Table in the jQuery Plugins website by Toshiro Takahashi written earlier this year. Testing… (more…)
- July 22nd, 2009
- Comments Off
- jEditable passes values as $_POST as default
- It grabs the ID from the container as value to the $_POST. Example: (more…)
- July 21st, 2009
- Comments Off
One of the first few things I learned in jQuery, importantly enough that I can’t live without this function. I like to note that when I first learned jQuery, I was a bit confused of the Selectors and the each() core function. After I got a hang of how to use the Selectors, I slowly grasp the usage of each(). A few things to note about the two:
- $(selectors) selects everything that you feed to it
- The each() function is used conjunctionally with $(selectors)
- The each() function separates each of the returned item from the $(selectors) individually
Why you probably can’t live without each()
Let’s say you want to change all the paragraphs (<p>) into I don’t know… say “No paragraph for you!” to all of them:
From:
This is a paragraph 1 Second paragraph 3rd paragraph
To:
No paragraph for you! No paragraph for you! No paragraph for you!
All you have to do is one fell swoop with jQuery:
$("p").text("No paragraph for you!");
What if you want to change the text individually ONLY when the user clicks on each of the paragraph? That’s when each() comes in as hero of the day:
$("p").each(function(){
$(this).click(function(){
$(this).text("No paragraph for you!!!");
});
});
The above example / Image Swap Example using each()
That’s just the most basic use of the each() function, if you still don’t see the light with the above examples, let me know.
- July 21st, 2009
- Comments Off
- Create thumbnails and dump them all in a “thumbs” folder with the same file names
- OR add something to identify the thumbnails such as: image01-th.jpg, image02-th.jpg etc… (more…)