jQuery with ASP.NET
The JQuery library can be added to a web page with a single line of markup. JQuery is a library of JavaScript Functions. JQuery is a lightweight "write less, do more" JavaScript library.
Introduction: The JQuery library can be added to a web page with a single line of markup. JQuery is a library of JavaScript Functions. JQuery is a lightweight "write less, do more" JavaScript library. JQuery is a JavaScript framework, which purpose is to make it much easier to use JavaScript on your website. You could also describe JQuery as an abstraction layer, since it takes a lot of the functionality that you would have to write many lines of JavaScript to accomplish and wraps it into functions that you can call with a single line of code. It's important to note that JQuery does not replace JavaScript and while it does offer some syntactical shortcuts the code you write when you use JQuery is still JavaScript code.
Some features of JQuery:
- HTML element selections
- HTML element manipulation
- CSS manipulation
- HTML event functions
- JavaScript Effects and animations
- HTML DOM traversal and modification
- AJAX
- Utilities
Example: The simple example of jQuery print the simple Hello
Code:
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<div id="divTest1"></div>
<script type="text/javascript">
$("#divTest1").text("Hello, world!");
</script>
Summary: we have a div tag with the id of "divTest1". In the JavaScript code we use the $ shortcut to access jQuery, then we select all elements with an id of "divTest1" and set its text to "Hello, world!".