Thanks for the feedback, Jordon. Let's say it's not something that belongs in the cookie. Then is it correct to do it via a hidden field?
On Apr 19, 2:59 pm, "Jordon Bedwell" <jor...@envygeeks.com> wrote: > If you use PHP then it's better to have it output the userID as a variable > already inside of JavaScript to save the extra code, or to set it as a > cookie, as a matter of fact, if you use Expression Engine, WP or most any > other major CMS, there is a cookie already set with that info so you can > just pull it from there. > > -----Original Message----- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Vik > Sent: Sunday, April 19, 2009 3:40 PM > To: jQuery (English) > Subject: [jQuery] Communicating Info from Server to Javascript, Prior to > Ajax Calls? > > Let's say I want my javascript to know some info, e.g. the username of > the user, and I'd like to communicate it prior to any Ajax calls. So > far I've been storing the info in a hidden field that jQuery can > access via an id. Is this the correct approach? > > Thanks in advance to all for any info.