O'Reilly logo

Moodle JavaScript Cookbook by Alastair Hole

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

Chapter 1. Combining Moodle and JavaScript

In this chapter, we will cover:

  • Creating a new Moodle PHP page
  • Loading a JavaScript file
  • Loading a JavaScript file in<head>
  • Generating a JavaScript function call from PHP
  • Passing variables from PHP to JavaScript
  • Ensuring compliance with XHTML Strict
  • Retrieving language strings from Moodle

Introduction

Web pages and websites have come a long way since their inception in the early 1990s (with the creation of HTML). Modern web applications such as Moodle now have far more in common with desktop applications than with the simple word processing documents they originally modeled.

One key weapon in the modern web application's armory is the subject of this book—JavaScript.

In essence, JavaScript is a programming language ...

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