Link to home
Start Free TrialLog in
Avatar of kent3800
kent3800

asked on

what is best way to pass php variable to jquery besides setting valud to id or attribute

Sorry for what seems to be such a basic question but this small little detail is alluding me. What is the best way to pass a php variable to jquery without setting the value within the DOM structure? Is there another way besides setting a variable so that jquery can use the variable?

An example would be the value of a mysql database count i.e. 5 animals, 2 vegetables, and 1 rock.  <div id="animalCount"><?php echo $theAnimalCount;?></div>

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kent3800
kent3800

ASKER

Thanks.