aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes function firing before page loads? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "function firing before page loads?" Watch "function firing before page loads?" New topic
Author

function firing before page loads?

Paul Yule
Ranch Hand

Joined: May 12, 2008
Posts: 229
I have an array that I'm putting on the request inside my servlet



I have 2 divs that are set to not display. When the page is loaded I Want to see if the user needs to see that information. I can check that by the countries that return on the request. When the page loads the function fires and an alert box displays "inside checkCountries" but all the array index values are undefined. Am I accessing the Array incorrectly? Can it be accessed from the hidden tag like that? Is there something fundamentaly wrong about what I'm doing or is the event just firing before the page gets to the hidden tag?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61196
    
  66

You need to spell "onload" correctly.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Yule
Ranch Hand

Joined: May 12, 2008
Posts: 229
The filter caught that, and wouldn't let me post, so I changed to onlowd. I should've mentioned that.
[ October 24, 2008: Message edited by: Paul Yule ]
Paul Yule
Ranch Hand

Joined: May 12, 2008
Posts: 229
I still dunno what was quite wrong with what I did but after foolin around with it for quite a while I ended up doing this instead:


this works fine but it seems really messy. Maybe I'll try with JSON on Monday.

[Edit] disabled smilies[/Edit]
[ October 24, 2008: Message edited by: Paul Yule ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61196
    
  66

OK, try to avoid red herrings like that. It delays helpful responses.

but all the array index values are undefined


I see nowhere where you define the array.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: function firing before page loads?