I'm not seeing the picture of your application design requirements,
but is using session cookies out of the questions to memorize the page
ids?
Yes, depending on eval() can bite you. Most of our "user access" stuff
is server driven to customize user pages. It takes away any security
loophole if its driven by the client. Probably better if you can make
this part of it server driven.
--
HLS
On Aug 21, 8:15 am, Christopher <[EMAIL PROTECTED]> wrote:
> I am writing a page where I need to load different scripts based on
> what the user is allowed to do. I started by using
> $.getScript("test.js"), which worked fine until I realized that I need
> a variable from the original page within the script I called.
>
> What I have ended up doing (and haven't tested beyond firefox2) is
> using a regular $.get and doing an eval() in the callback. This seems
> to allow me to use the variable I need within test.js, but it really
> seems that there should be a better way of doing this. Maybe it is
> just my dislike for eval() that makes me not like what I am using
> now. Any suggestions?
>
> //a dumbed down version of what I'm doing
> var pageId = 1234;
> $.get( "test.js", function(data){
> eval(data);
>
> });