Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hardcoding in javascript

 
ramesh maredu
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In our application we use json to carry data from server, ajax calls are made using jquery, the json response is used to construct html dynamically.

The rendering logic varies according to attributes in json response, for example



I would like to know is there any elegant way there, not to hard code in java script, I mean can I read values 1 and 2 dynamically and use them in comparison.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A switch statement




A look up way




Eric



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic