Finding and Traversing Child/decendant Elements in JQuery

Wednesday, June 24, 2009

To traverse or select child/descendant elements in jQuery, we can use Hierarchical expression, children() function or the find() function (Perhaps there are more methods to do this, but these are what I have been using). The difference among children and find functions is that children() only selects the immediate children from the given element, while find() function selects all the descendant elements within the given element.

Example:
Suppose we have we have the following in the document:


<div id="Technowise">
<div id="sub1">
<input id="input1" type="text">
<input id="input2'" type="text">
</div>

<div id="sub2">
<input id="input3" type="text">
<input id="input4'" type="text">
</div>

<div id="sub3">
<input id="input5" type="text">
<input id="input6'" type="text">
</div>
</div>


To select all the children div elements within the 'Technowise' , we can simply write:

$('#Technowise').children('div')
.css("background", "red");

This will select 'sub1', 'sub2' and sub'3'.

We can do the same selection using hierarchical expression as below:

$('#Technowise > div')
.css("background", "red");



Similarly, we can also use find function as below:

$('#Technowise').find("div")
.css("background", "red");


But you should note that find() function will find every child in the hierarchy of the parent (that is including all its grand children, and grand-grand children!). So if there are some other div elements within 'sub1', 'sub2' or 'sub3', even those elements will be selected. So be careful, and use them according to what you need.
Happy jQuerying! :)

Read more...

.NET Framework 2.0 Configuration Tool Installer - Download

Thursday, March 26, 2009

The .NET Framework 2.0 doesn't come with Configuration Tool (unless you install the SDK). But there is a simple way around to get configuration tool in your Control Panel - Administrative Tools. Just download the Configuration Tool Installer/Setup(MSI) and install the configuration tool, or follow the instructions in Aaron Stebner's blog to manually add the configuration tool.

Download .NET Framework configuration tool installer(MSI)

After you install this, you can go to Control Panel and find the configuration tool in the Adminstrative Tools. This setup also works for .NET Framework 3.0. So now there is no need to install the bulky SDK just to get configuration settings wizard for your Framework.

Read more...

Popular Search Links Appearing in Adsense Ads

Tuesday, March 10, 2009

Adsense may be experimenting with a new type of ad format which I noticed in one of my site today. In this, the ad-space just contains links to some of the popular queries made on Google, and they are only slightly related to the content of the page in which this ad appears.

You can see a snapshot of the Ad that appeared below:





This appeared in a space which I had set for only image ads, and its size is 336x280.
It seems Adsense is trying to get more queries on those keywords which are high demand for ads and bid rates.

Have anyone else noticed such ads? if so, tell us more by leaving your comments.

Read more...

Monday, March 09, 2009

Here is a simple method to add JavaScript (or any other code like CSS link tags) to the head of your HTML document using C#.
This will be useful if you want some script to be executed before the document starts loading (Example: initializing some JavaScript globals).

HtmlHead head = Page.Header;

LiteralControl lctl = new LiteralControl("<script type='text/javascript'>"+
" /* Write your JavaScript Code here */+
"</script>");

head.Controls.Add(lctl);



Although there are few other methods to do the same, this is one of the simplest and easy method I've found. You can place this code within the Page_Load function, or elsewhere you may want to.

Read more...

IMDB + Rotten Tomatoes Popular Torrent Search Linker - GM Userscript

Tuesday, February 03, 2009

Now find torrents to download movies you like right within the movie review pages! Yes, that's what the new IMDB + Rotten Tomatoes Popular Torrent Search Linker script does for you. No more going to torrent sites and keying in the movie titles to search for torrents. The script does this job for you by automatically picking up the title text from the movie pages of IMDB and Rotten Tomatoes sites and showing you the results found for the title.

The script offers you with the torrent search results from four best popular torrent sites: Btjunkie, Mininova, Isohunt and The Pirate Bay.

To install this script now, just click here. If you do not see a pop-up window with install option upon clicking the above link, you need to read about installing GM scripts.

Snapshot at IMDB:





Snapshot at Rotten Tomatoes:







Have a change or feature request?
Just leave me your comment!

Read more...

Fix: PHP stops at PEAR DB::connect() call.

Monday, December 01, 2008

I had this problem where the script abruptly stopped executing as soon as
the PEAR DB::connect() function was called. This was strange because there wasn't any error message displayed and all error reporting was set to On.

After looking at another project, I figured out that the problem was with where the DB package was located.

Previously I had put PEAR package in:
/PEAR/PEAR.php
And DB package in
/PEAR/DB/DB.php

I got the problem fixed after I put all the pear DB package within PEAR directory itself.
That is PEAR package in:
/PEAR/PEAR.php
And DB package in:
/PEAR/DB.php

Not sure why exactly this problem occurs, but apparently this change in directory of DB package solves this problem.

Read more...

Rotten Tomatoes Popular Torrent Search linker : Userscript (GM)

Monday, October 20, 2008

Do you often search for torrents to download movie after looking at good reviews on Rotten Tomatoes? Then this script is just for you!

This script adds search-links and drop-down results of most popular torrent sites for the movie pages of Rotten Tomatoes. So using this you can instantly find torrents to download the movie within the Rotten Tomatoes page. Below is a snapshot for one of the movie on RT:



It includes links and drop-down results for Btjunkie, Mininova, Isohunt and The Pirate Bay.

To use this script, you need Grease Monkey addon installed in Firefox browser.

If you have it, just click here to install the Rotten Tomatoes Popular Torrent Search script.


Credits to mungushume (This script is a fork from 'IMDb popular torrent search') and parts of this script is also taken from IMDB Pirated Version script.

Updates:


Jan 13, 2009 Version 0.2.2: Added drop-down torrent results feature for all torrent links, and removed Torrentz search link.

Enjoy!

Read more...

Technowise

Tech-Tips, News, Userscripts, JavaScript, PHP, MySQL, AJAX

Back to TOP