PDA

View Full Version : Loading different files



spaceman123
7 Jan 2011, 4:20 AM
I wonder if somebody can help me please. I'm trying to have different files load depending on which link somebody clicks, but it always loads the same file.

I've got:



{
text: 'Reference',
card: demos.Data.ajax,
source: 'src/demos/data/ajax 38.js',
leaf: true
},
{
text: 'Shopping',
card: demos.Data.ajax,
source: 'src/demos/data/ajax18.js',
leaf: true
},

but despite the source file being different it still loads the same file (the ajax.js file). If I change the card (I tried changing it to card: demos.Data.ajax38)then it doesn't load anything at all.

Thanks for any help

spaceman123
10 Jan 2011, 2:18 AM
Either that or can I get the variable from the url so I only need one file. For example if I use:


source: 'src/demos/data/ajax.js?id=18',

Then I can get the id to only get those results from the database?