Pro PHP and JQuery

所需积分/C币:10 2017-08-19 11:23:56 12.34MB PDF
4
收藏 收藏
举报

This book is for intermediate programmers interested in building AJAX web applications using jQuery and PHP. Along with teaching some advanced PHP techniques, it will teach you how to take your dynamic applications to the next level by adding a JavaScript layer with jQuery., * Learn to utilize built
Pro PHP and jQuery JASON LENGSTORF Apress° Pro PHP and jQuery Copyright@ 2010 by Jason Lengstorf All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN-13(pbk):978-1-4302-2847-9 ISBN-13( electronic:978-1-4302-2848-6 Printed and bound in the united states of america 987654321 Trademarked names, logos, and images may appearin this book. Rather than use a trademark symbol in an editorial fashion and to the benefit of the trademark owner, with no intention of infringemello y with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead editor: Michelle lowman Technical reviewer: robert banh Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan gennick, Jonathan Hassell, Michelle Lowman, Matthew moodie, duncan Parkes Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade. Tom Welsh Coordinating Editor: Anita Castro Copy Editor: Patrick Meader and Heather Lang Compositor: Kimberly Burton Indexer: BIM Indexing Proofreading Services Artist: April milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505, e-mail orders-ny@springer-sbm.com,orvisitwww.springeronline.com Forinformationontranslationspleasee-mailrights@apress.com,orvisitwww.apress.com Apress and friends of ed books may be purchased in bulk for academic, corporate, or promotional use. e Book versions and licenses are also available for most titles For more information reference our SpecialBulkSales-ebooklicensingwebpageatwww.apress.com/info/bulksales The information in this book is distributed on an"as is"basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work Thesourcecodeforthisbookisavailabletoreadersatwww.apress.com.youwillneedtoanswer questions pertaining to this book in order to successfully download the code Contents at a Glance About the Author About the technical reviewer Acknowledgements aaAaaa aAaaaa RRRRaaRaaaa IERaaIIman Xi PART 1: Getting Comfortable with jquery mmat Chapter 1: Introducing jQuery ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Chapter 2: Common jQuery Actions and Methods ammann 25 PART 2: Getting Into Advanced PhP Programming ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■ 85 Chapter 3: Object-Oriented Programming 87 Chapter 4: Build an Events calendar ma 119 Chapter 5: Add controls to create, edit, and delete Events mmammmmma 167 Chapter 6: Password Protecting Sensitive Actions and Areas mmammmaammmmnaan 199 PART 3: Combining jQuery with PHP Applications ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 233 Chapter 7: Enhancing the User Interface with jQuery mm mmmm. 235 Chapter 8: Editing the Calendar with AJAX and jQuery m mamma 263 PART 4: Advancing jQuery and PhPammman ■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■■■■■■■ 309 Chapter 9: Performing Form Validation with Regular Expressions ammmmmmmmmmmamm 311 Chapter 10: Extending jquery mmaa ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■ 345 Index ■■■■■■■■ Contents About the author About the Acknowledgements ma m B RBB RaanD PART 1: Getting Comfortable with jQuery ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■口■■■a■■■■画■国■国a■■■■ Chapter 1: Introducing jQuery ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Choosing jQuery over JavaScript…… Understanding JavaScript Libraries.......... 3-3-3- Understanding the Benefits of jQuery....................................4 Understanding the History of jQuery.……,………,,,,,…,,…,……,,…,,…,…,…,,…,………,…,………,4 Setting up a testing environment stalling Firefox.....,,……………………………5 Installing Firebug Including jQuery in Web Pages Including a Downloaded Copy of the jQuery Library 7 Including a Remotely Hosted copy of the jQuery Library ................8 Using the Google AJAX Libraries APl Setting up a Test File 8 Introducing the jQuery Function(s)... Selecting DOM Elements Using CSS Syntax.... Summary…,…, 23 Chapter 2: Common jQuery Actions and Methods manat ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 5 Understanding the Basic Behavior of jQuery Scripts 25 ■ coNTEntS Understanding jQuery Methods Traversing dOM elements 533 Creating and inserting dom elements 日面面日,面日面面a日面面面面日B自面面面面B面B面面B自B自面面面面自B面面自面面自面日面B自面B面日面B重 Accessing and Modifying cSS and attributes....….……….53 Affecting Result Sets 62 Using Animation and other Effects.......,..,.,,,…,,…….65 Handling Events 重日自日自重 Using AJAX Controls Summary 84 PART 2: Getting Into Advanced PhP Programming Emmm mB RRIAREIIEIIIIIII 85 Chapter 3: Object-Oriented Programming ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 87 Understanding object-Oriented Programming Understanding objects and Classes....m.m.......tnn...tnn...tn.n.87 Recognizing the differences between objects and classes 88 Structuring Classes. ..........................................88 Defining class properties Defining class Methods sing Class Inheritance........,,………………99 Assigning the visibility of properties and methoc 103 Commenting with DocBlocks 110 Comparing object-Oriented and Procedural code 112 Ease of Implementation ....................................................................................................112 Better organization …117 Easier maintenance 117 Summary 117 Chapter 4: Build an Events calendar assam 119 Planning the calendar. 19 Defining the Database Structure......……….,119 CONTENTS Creating the Class Map 119 Planning the application's Folder Structure ..............................................................120 Modifying the Development Environment.……… 122 Building the Calendar..,……124 Creating the database. Connecting to the database with a class 125 Creating the Class Wrapper…….,.,.,.,.,.,.,.,.,,… 127 Adding class properties 127 Building the Constructor........... Loading Events Data 136 Outputting HTML to Display the Calendar and Events 143 Outputing hTML to Display Full Event Descriptions...........................160 Summary ..................................................................................................................166 Chapter 5: Add controls to create, Edit, and Delete Events mmmmmmmmmmmmn 167 Generating a Form to create or edit events 167 Adding a Token to the Form . .169 Creating a file to display the Form............ Adding a New stylesheet for Administrative Features 172 Saving new events in the database 176 Adding a processing File to call the Processing Method …179 Adding a button to the main view to create New events 181 Adding edit controls to the Full Event View …185 Modifying the Full Event Display Method to Show Admin Contro|s………… 187 Adding the admin Stylesheet to the Full Event View Page........................188 Deleting Events.aaaaaa 190 Generating a Delete Button ........ 191 Creating a Method to require confirmation 192 Creating a File to Display the confirmation Form …95 ■ coNTEntS Summary 198 Chapter 6: Password Protecting Sensitive Actions and Areas mmmmmmmmmaa 199 Building the Admin table in the Database.m... m.. 199 Building a File to display a login Form. Creating the Admin class 202 Defining the class...... 202 Building a Method to Check the Login Credentials. Modifying the App to Handle the Login Form Submission 213 Allowing the User to Log Out 218 Adding a log out Button to the calendar…....…….218 Creating a Method to Process the logout….… 220 Modifying the App to Handle the User Logout.. 221 Displaying Admin Tools only to Administrators 223 Showing Admin Options to Administrators .......................... 223 Limiting Access to Administrative Pages .. 228 Summary… 231 PART 3: Combining jquery with PHP Applications mammmmammaamamm 233 Chapter 7: Enhancing the User Interface with jQuery ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■国■■ 235 Adding Progressive Enhancements with jQuery 235 Setting Progressive Enhancement Goals ……236 Include jQuery in the calendar app……… 236 Create a JavaScript Initialization File………,… 237 Creating a New Stylesheet for Elements created by jQuery.…………238 Creating a Modal window for event data 240 Binding a Function to the click Event of Title Links 240 Preventing the Default Action and Adding an Active class. Extracting the Query String with Regular Expressions............. 241

...展开详情
试读 127P Pro PHP and JQuery
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
Pro PHP and JQuery 10积分/C币 立即下载
1/127
Pro PHP and JQuery第1页
Pro PHP and JQuery第2页
Pro PHP and JQuery第3页
Pro PHP and JQuery第4页
Pro PHP and JQuery第5页
Pro PHP and JQuery第6页
Pro PHP and JQuery第7页
Pro PHP and JQuery第8页
Pro PHP and JQuery第9页
Pro PHP and JQuery第10页
Pro PHP and JQuery第11页
Pro PHP and JQuery第12页
Pro PHP and JQuery第13页
Pro PHP and JQuery第14页
Pro PHP and JQuery第15页
Pro PHP and JQuery第16页
Pro PHP and JQuery第17页
Pro PHP and JQuery第18页
Pro PHP and JQuery第19页
Pro PHP and JQuery第20页

试读结束, 可继续阅读

10积分/C币 立即下载 >