[thelist] Javascript help please

Duncan O'Neill dbaxo at ihug.co.nz
Thu Jan 25 16:49:35 CST 2001


Jeff,

thanks for your reply. I got sidetracked, which is why I didn't 
answer earlier, but I have tried getting to the object 
using what you suggested, but no luck so far. 

>i'm guessing that this data is only being viewed/edited/etc 
>by one individual (presumably the one with the cookie and 
>the data).

Yes, it's designed to be used by one person per company.

> it'd help to see more of your code, perhaps even a 
>working example.

Yes, I can't really post the code onto the list, because 
not being a Javascript expert (as you'll see), the code is 
way too long. So, disclaimers out of the way, there's a 
working example of the 'app' here;

http://homepages.ihug.co.nz/~dbaxo/employees.htm

I'd really appreciate it if you could take a look at it. The 
HTML and script are still fairly  untidy, because I wanted 
to get the script working before I tidied and prettied it 
up.

TIA

Duncan O'Neill
=============================================================

jeff wrote:
> 
> duncan,
> 
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : From: Duncan O'Neill
> :
> : I'm coding a client-side Javascript
> : application(?) which has gotten away
> : on me.
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> yeah, they have a way of doing that don't they?
> 
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : It's designed to hold a SMALL database
> : of employee names and info using cookies.
> : Yeah, I know there's probably a better way,
> : but I don't know any other language to code
> : it in.
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> i'm guessing that this data is only being viewed/edited/etc by one
> individual (presumably the one with the cookie and the data).
> 
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : My problem is in passing the string variable
> : from the prompt to tell the script WHICH
> : employee's information to change, so that I
> : can eventually pass the info to the promote
> : function like so;
> :
> : charlie.promote(new_title, salary_increase);
> :
> : How do I use eval() or any other method to
> : pass the string from the prompt, AND change
> : it into a variable for the promote function?
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> it'd help to see more of your code, perhaps even a working example.
> however, i'd wager a guess that if i say the phrase "associative array" that
> might help you out some.  don't forget that practically everything in
> javascript that uses the dot notation
> (obj.other_obj.another_obj.still_another_obj) allows you the ability get at
> that same data via an associative array.  take a form element, for example,
> referred to by form name and element name to get it's value:
> 
> document.form1.first_name.value;
> 
> that could just as easily have been:
> 
> document.forms['form1'].elements['first_name'].value;
> 
> you starting to see where i'm going with this?
> 
> i'm guessing that ol' charlie up there is part of a larger collection of
> objects, Employee perhaps?  well, if that's the case then you just might be
> able to refer to him like this:
> 
> Employee['charlie'].promote(new_title, salary_increase);
> 
> again, without seeing your code, this is just my arse whistling dixie.
> 
> good luck,
> 
> .jeff
> 
> name://jeff.howden
> game://web.development
> http://www.evolt.org/
> mailto:jeff at members.evolt.org




More information about the thelist mailing list