how do I choose a random quota_id from a set?
Using Jamroom
Paul is right, cacheing is why the content isn’t changing between clicks and page loads.
It might help to understand what the impressive code does, let me give that a shot… Let me know which parts you get, and which you don’t understand - it isn’t complex, but there are a lot of things going on at once, so it is difficult to explain them all at once.
The important parts in the first piece of code you posted are
1. the menu links - when you click them you trigger an onclick event rather than going to a url. In the onclick handler is a call to a jrLoad javascript function (see below).
2. the div at the bottom with an id="sm" - this is where the content will load.
The javascript initialization is separate to the links, it gets things going when the page is downloaded and ready - in does the same job as clicking a link, but it does it for all of them without needing a click to happen.
jrLoad('#top_notes',core_system_url +'/top_notes')
What that does is call the
jrLoad function with two parameters (they are in brackets and separated by a comma).
The first param is an id - the target div into which the content will be loaded. ("#" denotes an id, "." would denote a class). You can find something like this in your html:
The second is a url:
http://yoursite.com/top_notes
The jrLoad function calls that url and the (php) response from that url sends back some html content to load into the div ("#top_notes").
That example is triggered in the init function (along with all the others) - it happens when the page loads, and each of the jrLoad functions loads each response into the specified div.
It works in a similar fashion when you click a link in the menu (one with an onclick handler which calls a url via jrLoad, mentioned above). When you click the menu item, the onclick is triggered, it calls a url via the javascript jrLoad function, and places the returned html into the specified div - in the case of the menu links, that is #sm - I presume that is the main content of the page.
Please let me know how much of that you get - I'm trying to work out how to explain something similar to a bunch of librarians, so your feedback will be helpful to them, and to me.