Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2014, 02:27 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default Chapter 11 - p.372 - Ready function and AJAX/Javascript

Hi Imar,

$(document).ready(function() {} is used to wait until page is done loading before any JQuery code is executed. (p. 372)

Is this supposed to be used only when JQuery code is involved? Should this ready function also be used with Javascript/Ajax client side as well? For ex, the validation javascript code that was added to ValidatePhoneNumbers on p. 312?

Thanks.
Tulsi
 
Old May 5th, 2014, 04:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The document ready function is jQuery specific but you can also use it for other code (provided the page contains a reference to the jQuery library) you want to execute when the DOM is ready.

For your particular example it's not needed though. Validation isn't execute when the page loads, but based on user interaction such as changing the form controls or clicking the Submit button.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Tulsi (May 6th, 2014)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 using Ready Made Databases hozdaman BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 18th, 2010 12:47 PM
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
chapter 11 figure 11-7 relative positioning pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 November 29th, 2007 06:11 AM
Beginning Ruby on Rails - chapter 11: Ajax & Rails rornet BOOK: Beginning Ruby on Rails 1 June 22nd, 2007 04:10 PM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.