O'Reilly logo

ASP.NET jQuery Cookbook - Second Edition by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Consuming Web services

jQuery Ajax enables you to consume web services through client code. In this recipe, we will send form data to a web service method. The constructs used in this example are summarized in the following table:

Construct

Type

Description

$("#identifier")

jQuery selector

This selects an element based on its ID.

$("html_tag")

jQuery selector

This selects all elements with the specified HTML tag.

$.ajax()

jQuery function

This posts an Ajax request to the server with the set options.

.append()

jQuery method

This inserts content at the end of each matched element.

click

jQuery event

This is fired when you click on an element. It corresponds to the JavaScript click event.

event. preventDefault()

jQuery ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required