| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Work with all your cloud files (Drive, Dropbox, and Slack and Gmail attachments) and documents (Google Docs, Sheets, and Notion) in one place. Try Dokkio (from the makers of PBworks) for free. Now available on the web, Mac, Windows, and as a Chrome extension!

View
 

Lecture-jQuery-Firefly Cards Game with JSON

Page history last edited by Dr. Ron Eaglin 6 years, 11 months ago

 

Firefly Cards Game with JSON

 

Prerequisites

 

Lecture - jQuery Card Game - Serenity - Part 1 of this series

Lecture - Javascript - JSON - What is JSON

 

Summary

 

Removes the hard coded object data from the jQuery to an external file and then retrieves this file.

 

Video 

 

 

Reference Materials

 

http://jsfiddle.net/reaglin/odnqk9vv/ - JSFiddle of Code

http://api.jquery.com/jquery.getjson/ - Documentation for JSON

http://jsonlint.com/ - JSONLint validator for JSON

 

 

Additional Information

 

Firefly.json

{ 
    "cards" : [{ 
        "number":"1", 
        "name": "Mal"
    },{
        "number":"2",
        "name": "Zoe"
    },{
        "number":"3",
        "name":"Kaylee"
    },{
        "number": "4",
        "name": "Book"
    },{
        "number": "5",
        "name": "Simon"
    },{
        "number": "6",
        "name": "River"
    },{
        "number": "7",
        "name":"Jayne"
    },{
        "number": "8",
        "name": "Inara"
    },{
        "number": "9",
        "name": "Wash"}]
} 

 

 

 

 

COP 4813 Lectures

Comments (0)

You don't have permission to comment on this page.