SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Location
    London
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    N00b question about function initiation

    I've got an issue at the moment in that my script looks like this:

    Code:
    var JimCode = function () {
    
        this.pageCode = {
          blah: function(){
            blah;
          }
        };
    
    pageCode.blah();
    
    }();
    The script runs fine, but then it seems to run again, overwriting all the data...

    Any help would be greatly appreciated - I'm sure it's something really n00by that I'm doing!

    Thanks

    Jim

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Location
    London
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually it seems like the page reloads when the JimCode Function completes...

    Still confused.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Location
    London
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Location
    London
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had set the input type to submit, rather than button... sorry!!


Bookmarks

Posting Permissions

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