By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

How to get table row contents dynamically in javascript

P: 5
i have the following function.what i want is for my currency and currency rate to be displayed in a table dynamically.before am getting the data as follows

Expand|Select|Wrap|Line Numbers
  1. function moveToForexRatesSuccess(result) {
  2.  alert("in success");
  3. WL.Logger.debug("in moveToForexRatessuccess");
  4. busyIndicator.hide();
  5. alert("before result"); 
  6.   alert(result.invocationResult.text);
  7. result = JSON.parse(result.invocationResult.text);
  8. dataObject = eval(result); 
  9. alert("afta result"); 
  10. for (var i = 0; i <  dataObject.length; i++) {
  11. var object =  dataObject[i];
  12. alert("in if statement");
  13.                                                    alert("in else clause");
  14. info = document.getElementById("forexDetails").
  15.  
  16.  //the following is the code i want to come out.i want the info.innerHtml to be a table of currency and currency rate//  
  17.  
  18.  
  19.  
  20.  info.innerHTML = "Currency: "+object["currency"]+""+"CurrencyRate: "+object["currencyrate"]+"<br />";    
  21.                                                         alert("before change page");
  22.                                                         $.mobile.changePage("#forexRatesView", { transition: "turn"});
  23.  
  24.                                                        }
Feb 25 '14 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
and where do you get the currency and currencyrate from before you have the data?

PS. there is no if/else statement as per your alert notification

PPS. line #8 is completely superfluous, result is already an object.
Feb 25 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.