Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How functions operate

    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 () {
    show('div1','div2','div3','div4');
    var a = AVariable
    var b = BVariable
    if (a) {
    hide('div2');
    }
    if(b) {
    hide('div4');
    }
    }

    <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>
    Last edited by Graeme Hackston; 07-30-2002 at 12:25 AM.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    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?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •