JavaScript - Question...

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

OzzieGT

Senior member
Oct 9, 1999
506
4
81
You don't need to put the variable in a function...just have it in the script tags and it will be global. Also you don't want it to be the php file itself...the script needs to be written by the php file and a number needs to be assigned to it. Just make sure that javascript gets hit before you run the part of the javascript that is looking for it.
 

MrNutz

Banned
Oct 18, 2001
851
0
0
I just got back from vacation over the weekend...

OzzieGT, can you give me an example of how I can assign the php echoed value to a javascript variable? I am also having problems getting the php code to look in the "/images/" subdirectory. I keep getting the ERROR msg.