jQuery2018/19 COMP3322A Modern Technologies on WWW
Contents•Intro to jQuery•Selectors•Events•Manipulating the DOM•DOM Traversal•Special effects•Using AJAX•Others
What is jQuery?
Including jQuery•You must either:•Download jQuery to your Website and link to it•You can download a copy from jQuery.com. •There is usually a choice between a Production (compressed) version and a Development (uncompressed) version.•For learning, use the Development version as it is uncompressed and readable code.•In your HTML document, reference it with the <script> tag in the <head> section.•Reference to a third-party CDN, such as Google and Microsoft<head><scriptsrc="jquery-3.3.1.js"></script></head><head><scriptsrc=""></script></head>
Including jQuery•Using a third-party content delivery network (CDN) is advantageous for several reasons.•The bandwidth of the file is offloaded to reduce the demand on your servers. •The user may already have cached the third-party file and thus not have to download it again, thereby reducing the total loading time.•A disadvantage to the third-party CDN is that your jQuery will fail if the third-party host fails (unlikely but possible)
Selectors•jQuery can help us find elements based on their ID, classes, types, attributes, values of attributes, . . . which works in exactly the same way as CSS selectors.•Selectors•The element selector•The #id selector•The .class selector•The attribute selector•Compound and contextual selector •
You've reached the end of your free preview.
Want to read all 40 pages?
Ajax, Document Object Model, baz, modern technologies