JavaScript Programming: Basics · PHP Xml

Source: Internet
Author: User
Tags arithmetic mysql commands php and mysql php software repetition javascript array

This article is a computer class of high-quality starter recommendations >>>> JavaScript programming: Fundamentals · PHP XML "


Content Introduction

The chapter Programmer's Library · JavaScript programming: Basic PHP XML is introduced from the basics of the computer, covering the basics of programming, JavaScript basics, the looping structure of JavaScript, selection structures, forms, functions and source files, arrays, searching and sorting, File object model and XML, PHP overview, and related knowledge. The chapter Programmer's Library · JavaScript program Design: The basic PHP XML to fully consider the needs of beginners, content in good, each chapter after the corresponding case, practice and practice projects.


Translator sequence

JavaScript is a powerful programming language on the web that is used to develop interactive Web pages. Not only can it be applied directly to HTML documents for interactivity or other dynamic effects, but it can also be run on the server side instead of traditional CGI programs. In addition, JavaScript conforms to the ECMAScript language Standard and supports a variety of programming styles.
This book is a textbook for entry-level Web programmers. The content of this book includes both basic JavaScript programming techniques and JavaScript and XML, PHP, and MySQL-based collaborative programming. Compared with similar books in China, this book has the following characteristics:
1) delicate and gradual. This book details the basic concepts of program design (such as variables, selection statements, loop statements, etc.), and provides detailed comments and explanations for almost every sample program and code, making this book suitable for students who have never had or had a slight experience in programming.
2) Examples are rich and consistent throughout. This book is matched for almost every new knowledge point, and two complete cases (a game site and a teaching site) run through the chapters and exercises to enhance interest and real
The use of sex.
3) based on the basis, taking into account the overall situation. This book focuses on JavaScript-based Web client programming techniques, as well as a brief introduction to Web server-side development techniques PHP and MySQL, enabling students to use JavaScript naturally and to understand the interactivity with server-side technology.
This book can be used as the teaching material of the university, the specialized JavaScript program design, the Web program design and the dynamic webpage production.
due to the limited level of translators, the omission and errors in the translation are unavoidable, and readers are urged to criticize.
Translator
at Zhongshan University


Part Preface

Welcome to read this book. The author's motivation is to provide appropriate learning materials for the "Internet programming Ⅰ" course in the two-year "Internet services Programming" learning process. After completing the two-year web development course, students must be familiar with the client and server-side scripting languages. While there are many good books on static web development techniques (HTML, XHTML, HTML5, and CSS), books that involve JavaScript are either too cumbersome or far beyond the two-year study plan. So this book is designed to meet the needs of entry-level programmers, enabling them to use JavaScript naturally and to understand its interactivity with server-side technology.
This book can be used for a one-semester "JavaScript programming" course for students who already know HTML and CSS knowledge. The basic design of this book emphasizes the application of program design concepts in JavaScript and PHP, and is suitable for students who have never had or had little experience in programming. Each concept uses a short example to help the reader deepen the understanding of the concept, followed by a longer example of a real-world orientation.
two case studies run through the book: A game site and a teaching site. Each chapter has a section to add content and functionality to these two case studies, and students can add content to the programming challenges at the end of each chapter. The other two sites (one for the gardening company and the other for the jewellery company) can also be built from scratch, and students can enhance their functionality in programming challenges. The teacher can adjust the contents according to the requirements.
This book assumes that students have learned HTML and CSS, and are a very adept at creating static Web pages. However, students are not required to have programming experience, nor do they require students to have special knowledge of mathematics, finance, or other disciplines. When the last chapter uses SQL commands, students are not required to have been exposed to SQL or databases.
The book organization
This book begins with the computer Foundation of Chapter No. 0, and then the 1th chapter looks at the general concept of getting started with JavaScript programming. The 1th chapter introduces the case study through the whole book, but the case study of the chapters in this chapter is independent and can be used alone. The 2nd chapter introduces variables, operators, and data types. These chapters are important for students who have never studied programming courses and are familiar with the concept of program design. Understanding the interactivity between Web pages and JavaScript code is one of the most essential features of JavaScript.
the 3rd to 5th Chapter Studies JavaScript Basic control structure, namely order, choice and repetition. Students with no programming experience will learn how these statement structures work in general, especially in JavaScript. Students with programming experience can read these chapters quickly.
Chapters 6th and 7 are JavaScript-specific and contain forms, functions, and external JavaScript files. Since most students have already used forms in static Web pages, this is where the form is discussed in terms of interfacing with JavaScript programs.
Chapters 8th and 9 contain arrays and several advanced search and sequencing techniques, which, together with the three chapters that follow, are best suited to students with a solid programming foundation.
the 10th chapter discusses the Document Object model and introduces XML, and chapters 11th and 12 introduce PHP. After completing these three chapters, students will be able to develop Web sites that use database processing data. Students can use the free program XAMPP to build a Apache server with MySQL and PHP software on the computer. This book will describe in detail how this software operates. Without MySQL or database knowledge, students can create a dynamic Web site by using the MySQL commands given to build a real-world environment that uses databases, servers, and PHP.
There are many examples in each chapter. From start to finish, the difficulty of examples, checkpoints, and exercises is increased from the most basic concept understanding to very challenging practical applications. Each chapter contains a section of operational practices, where the case study site Greg's gambits and Carla ' s classroom are developed. In the programming challenges section at the end of each chapter, students are asked to supplement these case studies. If you start learning from this book to the end, these case studies will be developed to build a robust website. The programming challenge also includes two additional case studies, Lee's landscape and Jackie's jewelry website, where students will build these two sites entirely on their own. This book offers a lot of help in the programming challenges section for the Greg's gambits and Carla's classroom projects, while providing little help for Lee's landscape and Jackie's jewelry projects. The teacher can decide how independent the students are to complete the projects.
The Practice section contains fill-in questions, judgment questions, and short answers, while in the programming challenge some students are able to create their own web pages using the knowledge of the corresponding chapters.
Introduction to each chapter
Format Description
This book distinguishes program code by using different fonts, and the variables and array names are bold. Sometimes some code must be single-line input, but limited to paper size is not possible to completely put the code on one line, so using a symbol to indicate that the next line of code should be part of the previous line, this symbol should not be included. If there are no symbols, the following sample code should be entered on the same line. Note that the variable dinner is bold:
The 1th chapter introduces the program design and JavaScript, discusses the general problem-solving strategy of programming, the basic structure of the program and 3 kinds of control structure, discusses the pseudo-code and flowchart planning program and data type, guides students to create JavaScript script in the Web page, discusses the object, Point markers and several important JavaScript methods and events that describe the Greg's gambits and Carla's classroom sites and use JavaScript to create interactive pages for these sites.
The 2nd chapter focuses on variables, JavaScript data types and operators (including arithmetic, relational, and logical operators), explaining the differences between weakly typed and strongly typed languages like JavaScript. Discusses the use of connection operators and the way JavaScript handles user input numbers, and discusses conditional operators so that students can create interesting pages without using the selection structure, discuss operator precedence, and ASCII code. Students create crossword puzzles for Greg's gambits website and create spelling lessons for Carla's classroom site.
The 3rd chapter discusses the judging (selection) structure (including single, two, and multi-branch structures). Describes the switch statement, validation method, and math object, using a nested selection structure and a composite condition development program. Students can use the Math.random () method to create interesting programs, create a lucky prophecy program for Greg's gambits and create an arithmetic lesson for Carla's classroom.
The 4th chapter begins with a repeating structure, focusing on the basic loop structure: The pre-test, post-test cycle, Sentinel control cycle, counter control cycle, and the loop for data input and data validation. A loop statement includes a while loop, a do...while loop, and a for loop. Students want to create an information encoder for Greg's gambits and add a lot of functionality and depth to the Carla's classroom arithmetic lesson created in chapter 3rd.
the 5th Chapter further explores the repetitive structures and selection structures involved in chapters 3rd and 4th, and introduces the methods of calculating totals and averages by using some of the methods of the Math object, in-depth discussion of nested structures (including selection structures in loops, loops in loops, and loops in selection structures) and benchtop checks. Describes the various ways to exit the loop prematurely. Students want to create a battle game for Greg's Gambits (a variant of the stone-paper-scissors game) and create a grammar lesson for Carla's classroom.

. In the 6th chapter, most of the students who have studied web-making courses have already processed the forms, but the purpose of this chapter is to familiarize them with JavaScript. Because the Web authoring course has discussed basic form controls (radio buttons, check boxes, text boxes, text area boxes, picklist) and hidden fields and special controls (password elements, commits, and reset buttons), this chapter looks at returning the form data to the JavaScript program, The program can then use this data and return other information to the Web page or send the message to the user via e-mail. Students create an item directory page for Greg's gambits site users and generate a progress report for the Carla of Carla's classroom website that will be sent to the parents of the students.
The 7th chapter contains functions, objects, and JavaScript source files that discuss built-in and custom functions, including variable scopes, using arguments and formal parameters, value parameters and reference parameters, passing by reference, and passing by value. Introduces new objects (Boolean objects and date objects) and provides more information about the math object, which describes creating and using external JavaScript source files. Students will create a hanging man guessing game for Greg's gambits and create a reading comprehension lesson for Carla's classroom.
The 8th chapter is a chapter in the two chapters focusing on arrays, discussing the concept of arrays as JavaScript objects (including one-dimensional arrays, two-dimensional arrays, and parallel arrays), discussing different methods of loading arrays, and several JavaScript array methods for adding and deleting array elements. Students want to create a digital jigsaw puzzle for Greg's Gambits 15, and create a slide show for Carla ' s classroom.
The 9th chapter, based on the 8th chapter, explains the sort and search arrays, and discusses the JavaScript sort () and reverse () methods. To maintain the integrity of parallel arrays, develop additional search and sorting methods, including two sorting algorithms (bubbling and sorting), two search algorithms (linear search and binary search), and some JavaScript methods for implementing the search. The student wants to create a Scrabble game for Greg's gambits and create a factoring class for Carla ' s classroom.
The 10th chapter goes from JavaScript to related topics, discusses the Document Object Model (DOM) and XML, discusses the concept of DOM nodes and trees, and the parent-child model of Web pages, discusses creating, inserting, deleting, and replacing elements with DOM techniques and creating timers using DOM methods. This chapter also describes XML, XSL, namespaces, and schemas. When you create a page for Greg's gambits, using XML and JavaScript together is another alternative to displaying data, using XML and JavaScript to create a spelling lesson for Carla ' s classroom.
The 11th chapter is a chapter in the two chapters on PHP-related content. To use PHP, students must be able to access the server. This chapter introduces students to the installation and use of XAMPP, a free program that includes Apache servers, PHP, and MySQL, and can be installed on any personal computer or laptop computer. This chapter discusses the basics of PHP, including the PHP file name, how to access Apache server files, PHP data types, PHP operators, and PHP keywords, and describes the basic PHP program structure (including order, selection, and repetition) with PHP arrays and strings, Emphasize creating the appropriate folder structure for the Web site on the server. Students will use PHP to create a welcome page for Greg's gambits, and let the user send and return data to the server by using the Ajax_post () function. Students also use PHP to create a page for Carla ' s classroom, which allows the user to enter part of the name and then the program displays all entries in a large array or lists that start with those characters (that is, the program provides the user with the options available and can eventually be used to automate user input).
The 12th chapter introduces PHP in the 11th chapter to demonstrate how to complete two special and important tasks, discuss creating and reading cookies, directing students to create a database using the phpMyAdmin console (which is part of the XAMPP installation). Then, populate the database with the PHP method. Because this book does not include MySQL learning and does not require students to have database management and MySQL knowledge, this chapter gives all the MySQL commands and statements needed to develop the program, and gives explanations. This allows students to create and validate accounts for players who want to be members of the Greg's Gambits game site. Students also create a database for Carla's classroom and extract information from the database to send an email report to their parents.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

JavaScript Programming: Basics · PHP Xml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.