Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

function firing before page loads?

 
Paul Yule
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to spell "onload" correctly.
 
Paul Yule
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic