473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to get table row contents dynamically in javascript

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
1 1357
Dormilich
8,658 Expert Mod 8TB
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

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

Similar topics

0
by: Steve_EE | last post by:
I'm running phpMyAdmin 2.5.3 / MySQL 4.0.14 / PHP 4.3.3 / Apache 1.3.20 phpMyAdmin is installed and appears ok at first, I can login, select databases, view which tables are in each db, see the...
2
by: Andy Fish | last post by:
Hi, I am trying to show/hide a group of table rows using javascript and CSS. if I group them in a <tbody> element I can do: my_tbody_element.style.display="none"; to hide them and ...
7
by: Just Dummy | last post by:
Hi all, I am struggling with a problem for a long time. Problem statement: I have a table and the table can contain n number of rows. i.e., the table rows will be generataed out of a xml...
1
by: Stefan Mueller | last post by:
I'd like to read and modify a cell (e.g. 'Text 1') in the following HTML table with a JavaScript: ============================================== <html> <body> <table id = "MyTable"> <tr id...
5
by: Gerry Abbott | last post by:
Hi all, Is it possible to have the table view hidden, but allow a user to view the table contents through a query or linked form ? Thanks in advance. Gerry Abbott
11
by: Michael Mayo | last post by:
I have a simple html page that contains an image in a single table cell, surrounded by a border: <http://www.softrains.com/lc/test.html>. I would like to eliminate the space between the table...
1
by: Saurabh | last post by:
i want to create a table dynamically. Right now what i am using is a string harcoded with the table structure with "<TD>"+values i want to fill in the table dynamically. and then padd this string...
7
by: leiño | last post by:
Hi, i am adding table rows dynamically with javascript. This works fine. The table is inside a div with scrolls, initially with 6 rows: ..... <div style='overflow:auto; width:100%;...
3
by: ganga1985 | last post by:
I have a windows form which displays table contents from a database. I want the contents to be automatically updated when the table in database is updated. How do i do it?
1
by: dinesh1440 | last post by:
I have problem in retrieving word table contents in php. And I need to store them in database tables. Could someone please help me doing this???? Please give it in the code format rather as...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.