Wednesday, April 22, 2009

Basic Selectors in JQuery

1. By the ID attribute.
If the ID contains special character then you can escape them with backslashes. For example to find a text box with ID txtName you can write the following :

$("#txtName")

Then you can do any operation on the text box like getting the value or changing the css class.

2. By given element name. For example to get all the DIV elements following is the syntax

$("div")

This will find all the DIVs present in the page. You can do any operation after that.


3. By given class name. The following code finds all the elements which have class name 'RedButton'.

$(".RedButton")

Source

jQuery Auto-Complete Text Box with ASP.NET MVC

Great example:
Source

"HTTP Error 500 - Internal server error" mean: you have to fix something in your code

500 errors in the HTTP cycle

Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle when it communicates with your Web server:

Obtain an IP address from the IP name of your site (your site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).
Open an IP socket connection to that IP address.
Write an HTTP data stream through that socket.
Receive an HTTP data stream back from your Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.
This error occurs in the final step above when the client receives an HTTP status code that it recognises as '500'.

Fixing 500 errors - general

This error can only be resolved by fixes to the Web server software. It is not a client-side problem. It is up to the operators of your Web server site to locate and analyse the logs which should give further information about the error.