View Full Version : How function operate

Graeme Hackston
07-30-2002, 12:23 AM
Do browsers read an entire function before taking actions the function describes? Specifically, will a function written like the example below show all of the divisions prior to hiding some of them if variables are true? If so, would this be noticeable on a slow connection?

function SomeName () {
var a = AVariable
var b = BVariable
if (a) {
if(b) {

<edit>the reason I'm trying to write it like this is because it's an onload function and the variables are positons and heights etc. of the divisions</edit>

07-30-2002, 03:52 AM
it's not dependent on the internet connection since it's running on the client side, so it depends on the user's machine's resources. But in your code, the divs showing/hiding transition will not be noticeable. Have you tried to run it?

Graeme Hackston
07-30-2002, 04:11 AM
Thanks glenngv

Yes it seems to run fine offline. So, as I understand it, the script is first downloaded then ran meaning the user's resources would have to be quite low for it to be noticable. I'm worrying for not.