JavaScript programming: basic PHPXML

Source: Internet
Author: User
Tags mysql commands php software
: This article mainly introduces the JavaScript programming: basic PHPXML. if you are interested in the PHP Tutorial, please refer to it. This is a top recommendation for computers >>> JavaScript programming: basics-PHP-XML


Chapter Hua programmer Library-JavaScript programming: basic PHP XML, covers the basic knowledge of programming, basic knowledge of JavaScript, the cycle structure of JavaScript, selection structure, form, function and source file, array, search and sorting, file object model and XML, PHP overview and related knowledge. The "Huazhang programmer Library-JavaScript programming: basic php xml" fully considers the needs of beginners and provides in-depth content. corresponding cases, exercises, and practical projects are arranged after each chapter.

Translator's Preface

JavaScript is a powerful Web programming language used to develop interactive Web pages. It can not only be directly applied to HTML documents for interaction or other dynamic effects, but also run on the server side to replace traditional CGI programs. In addition, JavaScript complies with the ECMAScript language standard and supports multiple programming styles.
This book is a textbook for entry-level Web programmers. The content in this book is from a simple perspective. it not only includes the basic programming technology of JavaScript, but also the collaborative programming methods of JavaScript and XML, PHP, and MySQL. Compared with similar books in China, this book has the following features:
1) The Pen method is delicate and gradual. This book describes in detail the basic concepts of Program Design (such as variables, selection statements, and loop statements), and provides detailed comments and explanations for almost every sample program and code, so that this book applies to students who have never or have little programming experience.
2) examples are rich and persistent. This book provides examples for almost every new Knowledge Point, and two complete cases (a game website and a teaching website) run through the chapters and exercises of the book to enhance the fun and
3) based on the foundation and taking into account the overall situation. This book mainly introduces the JavaScript-based Web client programming technology, and also briefly introduces the Web server development technology PHP and MySQL, this allows students to naturally use JavaScript and understand the interaction with server-side technologies.
This book can be used as teaching materials for courses in colleges and universities, specialized JavaScript programming, Web programming, and dynamic Web page creation.
Due to the limited translator level, omissions and errors in the translation are inevitable, and readers are urged to criticize and correct the translation.
Sun Yat-sen University


Read this book. The author created this book to provide appropriate learning materials for the internet programming I course during the two-year "Internet service programming" course. After completing two years of Web development courses, students must be familiar with the client and server scripting languages. Although there are many good books on static web development technologies (HTML, XHTML, HTML5, and CSS), books related to JavaScript are either too cumbersome or far beyond the two-year learning plan. Therefore, this book is designed to meet the needs of entry-level programmers so that they can naturally use JavaScript and understand its interaction with server-side technology.
This book is a one-semester "JavaScript programming" course for students who have knowledge of HTML and CSS. The basics of programming in this book emphasize the application of programming concepts to JavaScript and PHP, applicable to students who have never or have little programming experience. Each concept uses a short example to help readers better understand the concept. The short example is followed by a long example oriented to the actual environment.
Two case studies run through the book: A Game website and a teaching website. Each chapter has a section that adds content and functionality to the two case studies, and students can add content to the programming challenges at the end of each chapter. The other two websites (one is a gardening company website and the other is a jewelry company website) can also be established from scratch, and students can enhance their functions in programming challenges. The instructor can adjust the content as required.
This book assumes that students have learned HTML and CSS and are good at creating static webpages. However, do not study with programming experience or require students to have special knowledge in mathematics, finance, or other disciplines. When using SQL commands in the last chapter, students are not required to have access to SQL or databases.
Book Organization
This book begins with Chapter 1 on computer basics, and Chapter 2 on general concepts of JavaScript programming. Chapter 1 describes the case studies throughout the book, but the case studies in each chapter are independent of each other and can be used independently. Chapter 2 describes variables, operators, and data types. These chapters are important for students who have never studied programming courses and are familiar with programming concepts. Understanding the interaction between webpages and JavaScript code is one of the most basic features of JavaScript.
3rd ~ Chapter 5 describes the basic control structure of JavaScript, that is, sequence, selection, and repetition. Students without programming experience will learn how these statement structures work, especially in JavaScript. Students with programming experience can quickly read these chapters.
Chapter 7 and Chapter 7 are unique to JavaScript, including forms, functions, and external JavaScript files. Since most of the students have used forms in static webpages, we will discuss the form in the method of interfacing with JavaScript programs.
Chapters 2 and 9 contain arrays and several advanced search and sorting techniques. these two chapters, together with the three following chapters, are most suitable for students with strong programming basics.
Chapter 2 discusses the object model and Introduces XML, chapter 2 and Chapter 12 describes PHP. After completing these three chapters, students will be able to develop websites that use databases to process data. Students can use the free program XAMPP to create an Apache server containing MySQL and PHP software on their computers. This book will detail the operation methods of this software. Without knowledge of MySQL or database, students can use the MySQL commands provided to create a dynamic website using the actual environment of databases, servers, and PHP.
Each chapter has many examples. From beginning to end, the difficulty of examples, checkpoints, and exercises increases from the basic concept understanding to very challenging practical applications. Each chapter contains an operation practice section on the development Case Study website Greg's Gambits and Carla's Classroom. The programming challenges at the end of each chapter require students to supplement these case studies. From the beginning to the end of this book, 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, which students will build on their own. In the programming challenge section, this book provides a lot of help for the Greg's Gambits and Carla's Classroom projects, while little help for the Lee's Landscape and Jackie's Jewelry projects. The teacher can determine the degree of independence of the students to complete these projects.
The exercise part includes fill-in questions, exercise questions, and short answer questions. in the programming challenge section, students can use the knowledge learned in the corresponding chapters to create their own web pages.
Chapter Introduction
Format Description
This book uses different fonts to differentiate program code. the variable and array name are in bold. Sometimes some code must be entered in a single line, but the code cannot be completely displayed in one line due to the size of the paper. Therefore, use 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 is no symbol, the following sample code should be entered in the same line. Note that the variable dinner is in bold:
Chapter 2 This chapter introduces program design and JavaScript, discusses the general problem solving strategies of Program Design, the basic structure of the program and three control structures, and discusses the use of pseudocode and flowcharts to plan programs and data types, instruct students to create JavaScript scripts on the webpage to discuss objects, point tags, and several important JavaScript methods and events, this section describes the Greg's Gambits and Carla's Classroom websites and uses JavaScript to create interactive pages for these websites.
Chapter 2 This chapter focuses on variables, JavaScript data types, and operators (including arithmetic, relational, and logical operators), and explains the differences between weak and strong types of languages similar to JavaScript, this article discusses how to use join operators and JavaScript to process numbers entered by users. It also discusses conditional operators so that students can create interesting pages without using a selection structure, the operator priority and ASCII code are discussed. Students want to create a crossword game for the Greg's Gambits website and create spelling lessons for the Carla's Classroom website.
Chapter 2 This chapter discusses the judgment (selection) structure (including single-path, second-path, and multi-path branch structures ). Describes switch statements, verification methods, and Math objects, and develops programs using nested selection structures and compound conditions. Students can use the Math. random () method to create interesting programs, create a lucky prediction program for Greg's Gambits, and create an arithmetic class for Carla's Classroom.
Chapter 2 This chapter begins with the repeat structure and focuses on the basic cycle structure: pre-test and post-test cycles, Sentinel control loops, counter control loops, and cycles used for data input and data verification. Loop statements include the while loop, do... while loop, and 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 class created in chapter 1.
Chapter 2 This Chapter further explores the repeated structure and selection structure involved in chapter 5th and chapter 3rd, and introduces the calculation methods of the total number and average number by using some Math object methods, in-depth Exploration of nested structures (including the Loop selection structure, the loop in the loop and the loop in the selection structure) and desktop check. This section describes how to exit the loop in advance. Students want to create a combat game (a variant of the Stone-paper-scissors game) for Greg's Gambits and create grammar classes for Carla's Classroom.

. In chapter 6th, most students who have used web pages in mathematics have already processed forms. However, this chapter aims to familiarize students with JavaScript processing forms. The webpage creation course has discussed basic form controls (single-choice buttons, check boxes, text boxes, selection area boxes, and selection lists), as well as hidden fields and special controls (password elements, submit and reset buttons ), therefore, this chapter focuses on returning form data to the JavaScript program, which can then use the data and send other information to the webpage or by email. Students need to create an item directory page for the Greg's Gambits website users and generate a learning progress report to the students and parents for the Carla's Classroom website Carla.
Chapter 2 This chapter includes functions, objects, and JavaScript source files to discuss built-in and custom functions, including the scope of variables, using real parameters and form parameters, value parameters and reference parameters, passing by reference and passing by value, introduce new objects (Boolean objects and Date objects) in addition, more information about Math objects is provided to introduce how to create and use external JavaScript source files. Students want to create a gamer guessing game for Greg's Gambits and create a reading comprehension class for Carla's Classroom.
Chapter 2 This chapter focuses on the two chapters of arrays and discusses the concept of arrays as JavaScript objects (including one-dimensional arrays, two-dimensional arrays, and parallel arrays ), we will discuss different methods for loading arrays and several JavaScript array methods for adding and deleting array elements. Students want to create a digital puzzle game 15 for Greg's Gambits and create a slide show for Carla's Classroom.
Chapter 2 This chapter describes how to sort and search arrays based on chapter 9th and discusses the sort () and reverse () methods of JavaScript. To maintain the integrity of the parallel array, other search and sorting methods are developed, including two sorting algorithms (bubble sorting and selection sorting) and two search algorithms (linear search and binary search) and some JavaScript methods for implementing search. Students want to create a spelling game for Greg's Gambits and create a factorization course for Carla's Classroom.
Chapter 2 transition from JavaScript to related topics in this chapter. This chapter discusses the Object Model (DOM) and XML of the document, the concepts of DOM nodes and trees, and the parent-child model of webpages, we will discuss how to use DOM technology to create, insert, delete, and replace elements, and how to use DOM to create a timer. This chapter also introduces XML, XSL, namespaces, and patterns. When creating a page for Greg's Gambits, using XML and JavaScript together is another alternative to displaying data, creating a spelling lesson for Carla's Classroom using XML and JavaScript.
Chapter 2: This is a chapter about PHP. To use PHP, students must be able to access the server. This chapter describes how to install and use XAMPP. it is a free program containing Apache servers, PHP, and MySQL and can be installed on any PC or laptop. This chapter discusses basic PHP knowledge, including PHP file names, how to access Apache server files, PHP Data types, PHP operators, and PHP keywords, this section describes the basic program structure (including sequence, selection, and repetition) of PHP with PHP arrays and strings, emphasizing creating an appropriate folder structure for the website on the server. Students need to use PHP to create a welcome page for Greg's Gambits and use the ajax_post () function to send and return data to the server. Students also need to use PHP to create a page for Carla's Classroom so that users can enter some names and the program will display all entries in a large array or a list starting with those characters (that is, the program provides available options for users and can be used to automatically complete user input ).
Chapter 2 This chapter describes how to complete two important tasks based on PHP and how to create and read cookies, instruct students to use the phpMyAdmin console to create a database (which is part of the XAMPP installation ). Then, use PHP to fill the database. Because this book does not include MySQL learning and does not require students to have knowledge of database management and MySQL, This chapter provides all MySQL commands and statements required by the development program and provides explanations. In this way, students can create and verify accounts for players who want to become members of the Greg's Gambits game website. Students also need to create a database for Carla's Classroom and extract information from the database to send an email report to their parents.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above introduces the JavaScript programming: the basic PHPXML, including the content, hope to be helpful to friends who are interested in PHP tutorials.

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: 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.