background preloader

Jquery

Facebook Twitter

Using jQuery to Consume ASP.NET JSON Web Services. Note: This post is part of a long-running series of posts covering the union of jQuery and ASP.NET: jQuery for the ASP.NET Developer. Topics in this series range all the way from using jQuery to enhance UpdatePanels to using jQuery up to completely manage rendering and interaction in the browser with ASP.NET only acting as a backend API. If the post you're viewing now is something that interests you, be sure to check out the rest of the posts in this series. In response to many of the articles here, I receive feedback asking how to achieve the same results without using ASP.NET AJAX.

As much as I’m a fan of ASP.NET AJAX, I must agree that its JavaScript payload can certainly be a drawback in some situations. My recent deferred content loading post is an excellent example of that. I was using jQuery for presentational effects, and using a ScriptManager to call a web service. In this post, I intend to correct that. Additional security when calling JSON serialized services. jQuery: The Write Less, Do More, JavaScript Library. Next Siblings Selector (“prev ~ siblings”) Description: Selects all sibling elements that follow after the "prev" element, have the same parent, and match the filtering "siblings" selector. version added: 1.0jQuery( "prev ~ siblings" )prev: Any valid selector.siblings: A selector to filter elements that are the following siblings of the first selector. The notable difference between (prev + next) and (prev ~ siblings) is their respective reach.

While the former reaches only to the immediately following sibling element, the latter extends that reach to all following sibling elements. Finds all divs that are siblings after the element with #prev as its id. Demo: Tutorial AJAX interface menu using jQuery/PHP | Vision Master De. Tutorials. W3Schools Online Web Tutorials. Sliding door effect - TutsValley.com - DEMO. This effect is made by changing the inside of the animate function in JQuery. Just making it into negative number, everything else is same as the normal effect. This is effect is made slightly different then in the tutorial. As you can see, the distance variable is now the height of the div instead of it's width.

Same as sliding down effect, but we are making it into a negative number. How to get and set form element values with jQuery. Posted November 13th, 2008 in Javascript (Updated April 22nd, 2010) jQuery is a Javascript framework which can simplify coding Javascript for a website and removes a lot of cross browser compatibility issues. This post looks at how to get and set the values of HTML form elements with jQuery. Getting a form value with jQuery To get a form value with jQuery use the val() function. Let's say we have a form like this, using an id for each form element: We can display an alert for the values of "foo" and "bar" as easily this: If we're using the name only and not specifying an id, the jQuery to get the form values would be this: If you have a group of radio buttons and want to get the selected button, the code is slightly different because they all have the same name.

jQuery: Setting a form value with jQuery You can set the form values with jQuery using the same val() function but passing it a new value instead. . [0] would set the first one checked, [1] would set the second one checked and so on. Private Members in JavaScript. Douglas Crockford www.crockford.com JavaScript is the world's most misunderstood programming language.

Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members. Objects JavaScript is fundamentally about objects. If a value is a function, we can consider it a method. Objects can be produced by constructors, which are functions which initialize objects. Public The members of an object are all public members. In the constructor This technique is usually used to initialize public instance variables. Function Container(param) { this.member = param; } So, if we construct a new object var myContainer = new Container('abc'); then myContainer.member contains 'abc'. In the prototype This technique is usually used to add public methods. Container.prototype.stamp = function (string) { return this.member + string; } So, we can invoke the method Private Privileged.

Many ways to communicate with your database using jQuery AJAX an. I've recently done a series of articles that feature calling databases via AJAX using jQuery. In pretty much all of the articles, I have used Web Services as my data access mechanism. Judging from the comments that some of the articles have attracted, this has caused a little confusion. But Web Services is just one mechanism. Page Methods and simple ASPX files are two more. And finally, as pointed out by a commenter, Benny Halperin, ASHX files are yet another option.

Each example will feature the same requirement, and that is to obtain and display the Northwind Customer details relating to a specific CustomerID selected from a DropDownList on a page called Customer.aspx. The bare bones of Customer.aspx are as follows: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Customer.aspx.cs" Inherits="Customer" %><! This has a code-behind in which the data is obtained and bound to the DropDownList to give the list of customers: ASPX File An alternative to load() is $.get(). ASHX Files Summary. Flot - Project Hosting on Google Code. Charts with Rotated Axis Text. Embedded Reporting with Chart Controls. Thoughts On Embedded Reporting & Few Tips. Some people would argue that preparing business reports is not an innovative area to be in.

But in my experience reporting is the area where an individual developer can make a big difference, with relatively small effort. At best, report development is extremely productive, due to two reasons. First, reports are a low hanging fruit. Existing reports are in bad shape in virtually every organization that has no access to a professional database/DW/BI team. Second, it is surprisingly fast to develop for a good reporting system like the SQL Server Reporting Services (SSRS). But if you are an application developer, SSRS report server is not your choice for operative reporting. I have played around with Telerik Reporting in two projects, both times creating a handful of embedded reports for particular customer needs. Welcome to the Reporting Country Reporting is all about compromizing development speed, flexibility and looks.

Bottom up is the only way Hard-coding is good -mika-