How to get table row contents dynamically in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • belz
    New Member
    • Feb 2014
    • 5

    How to get table row contents dynamically in javascript

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

    Code:
    function moveToForexRatesSuccess(result) {
     alert("in success");
    WL.Logger.debug("in moveToForexRatessuccess");
    busyIndicator.hide();
    alert("before result"); 
      alert(result.invocationResult.text);
    result = JSON.parse(result.invocationResult.text);
    dataObject = eval(result); 
    alert("afta result"); 
    for (var i = 0; i <  dataObject.length; i++) {
    var object =  dataObject[i];
    alert("in if statement");
    	       	            						alert("in else clause");
    info = document.getElementById("forexDetails").
            	
     [B]//the following is the code i want to come out.i want the info.innerHtml to be a table of currency and currency rate//  [/B]
    
    
    
     info.innerHTML = "Currency: "+object["currency"]+""+"CurrencyRate: "+object["currencyrate"]+"<br />";	
            	       	            				 	alert("before change page");
            	       	            	    			 $.mobile.changePage("#forexRatesView", { transition: "turn"});
            	       	            				       
            	       	            					}
    Last edited by Dormilich; Feb 25 '14, 10:43 AM. Reason: Please use [CODE] [/CODE] tags when posting code.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    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.

    Comment

    Working...