• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting id with javascript !

 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My javascript fails, i have this code:



Onload i call this function:



It fails on this line:

var temp1 = <%=OevrigeBetalingerInputbean.getGruppevalg()[0].getName%>

isent this possible in javascript to get i id, i dont know the name ???

Frank

 
Frank Jacobsen
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh Oh, i found the error



i forgot the "" around the <%=OevrigeBetalingerInputbean.getGruppevalg()[0].getName%>

Frank
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Future hints, when you are writing code from the server to be handled by JavaScript. Do a view source on the page. You will always find the error a lot easier! Another thing, use the JavaSctip Console on Mozilla or Firefox, it gives better error descriptions.

Eric
 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And if you have DOM elements dynamically added/modified through javascript, Firefox will let you view the source of highlighted HTML elements, even if it's different from the original source.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic