Difference between revisions of "Week Eight (MGDP2050)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Individual web page)
Line 52: Line 52:
 
</script>
 
</script>
 
</pre>
 
</pre>
 
  
 
=== Fixing JavaScript ===
 
=== Fixing JavaScript ===

Revision as of 04:57, 24 March 2016

Lecture notes and exercises for Week Eight of Web Design and Development II (MGDP2050).

See also Week Seven (MGDP2050) - Week Nine (MGDP2050).

In the news

  • ...

JavaScript

Recognizing JavaScript

...

Using JavaScript

JavaScript is a programming language. It is made up entirely of text.

This text is known as source code, or simply "the code".

Usually the JavaScript source code goes in one of two places:

  • An external JavaScript file (affects one or more web pages)
  • An individual web (affects that page only)

Script element

In your web pages, use the script element to include JavaScript.

External JavaScript file

The script element element has a src attribute, which specifies the path to the external JavaScript file.

Example:

<script src="../some-folder/example.js"></script>

Individual web page

To write JavaScript into a single web page:

Example:

<script>
  alert ('Hello world');
</script>

Fixing JavaScript

See the browser console for JavaScript error messages and other browser-related tools.

Validation

See JSLint and JSONLint.

Examples

Review examples ...

jQuery

Review jQuery ...

jQuery UI

Introduce jQuery UI ...

Web applications

Discuss web applications.

Reading for next week:

  • ...

Exercises: in class

...

Exercises: for next week

...

Reading