tags:

views:

25

answers:

2

I built a slideshow/decision-making game in Flash but would like to try to redo it using jQuery.

The slideshow part seems simple enough, however I have a series of user decisions that I'm not sure how to approach.

In flash, if the user makes a decision, I would just store this in a variable or shared local objects, is this the same for jQuery? i.e. mix regular javascript variables with the jQuery?

A: 

store it in a closure, or a global variable.

regular javascript variables are no different then jquery variables. its all javascript.

mkoryak
A: 

You can store it in a object, as easy as:

var myDecisions = {};

Or an array: var myDecisions = [];

Or on the element itself if it's related to an element with jQuery like this:

$('#thing5').data("decision", "good decision"); //Set
var decision = $('#thing5').data("decision"); //Get
Nick Craver