Click here to Skip to main content
15,843,727 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: How do I choose DIV based contents in a page with a dropdown list Pin
Cai Yang18-Dec-15 0:38
Cai Yang18-Dec-15 0:38 
Questionfor source code Pin
Member 121783931-Dec-15 1:59
Member 121783931-Dec-15 1:59 
AnswerRe: for source code Pin
Eddy Vluggen1-Dec-15 2:27
professionalEddy Vluggen1-Dec-15 2:27 
AnswerRe: for source code Pin
ZurdoDev16-Dec-15 11:04
professionalZurdoDev16-Dec-15 11:04 
QuestionSimple, Simple Javascript question... Pin
TenmanS1427-Nov-15 5:39
TenmanS1427-Nov-15 5:39 
AnswerRe: Simple, Simple Javascript question... Pin
F-ES Sitecore29-Nov-15 23:16
professionalF-ES Sitecore29-Nov-15 23:16 
GeneralRe: Simple, Simple Javascript question... Pin
TenmanS1414-Dec-15 23:21
TenmanS1414-Dec-15 23:21 
QuestionDisplaying specific data from a CSV file Pin
Emre Testici25-Nov-15 22:44
Emre Testici25-Nov-15 22:44 
I want to display specific fields from an external CSV file on a web site with using JavaScript. I tried to parse that file with using "Papa parse" like this: JSBin Link


HTML
<!DOCTYPE html>
<html >
  <head>
    <meta charset="UTF-8">
    <title>Parse remote CSV to HTML Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <script src='http://d3js.org/d3.v3.min.js'></script>
	<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>
	<script src='https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.2/papaparse.min.js'></script>
	<script src='https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.2.0/mustache.min.js'></script>
	
	<script>
	Papa.parse("https://dl.dropboxusercontent.com/s/wsnizh4lyugxd60/data.csv", {
	download: true,
	header: true,
	complete: function(results) {
	console.log(results);
	
	var data = results.data;
	var arrayLength = data.length;
	for (var i = 0; i < arrayLength; i++) {
    var newdiv = document.createElement('div');

    newdiv.setAttribute('id', 'csvdata'+i.toString());

    newdiv.innerHTML = 'Battery Level: '+data[i].batteryLevel.toString();
}
	
	}
});
	</script>
	
  </body>
</html>



How can I display a specific data from this data set in a web site like:

Battery Level: 0.62

Altimeter Pressure: 99.44185

Horizontal Accuracy: 65

Can you give me an example in JSBin or JSfiddle?
QuestionThe problem of JavaScript position Pin
Ted.K-121-Nov-15 22:28
Ted.K-121-Nov-15 22:28 
AnswerRe: The problem of JavaScript position Pin
Peter Leow21-Nov-15 22:55
professionalPeter Leow21-Nov-15 22:55 
AnswerRe: The problem of JavaScript position Pin
Cai Yang18-Dec-15 0:42
Cai Yang18-Dec-15 0:42 
Questionsocial media buttons block page on IE? Pin
V.17-Nov-15 22:18
professionalV.17-Nov-15 22:18 
QuestionHow to create a number field site column in javascript Pin
Member 1188942312-Nov-15 20:54
Member 1188942312-Nov-15 20:54 
QuestionRe: How to create a number field site column in javascript Pin
ZurdoDev23-Nov-15 4:03
professionalZurdoDev23-Nov-15 4:03 
Questionregex, get the last dollar amount if 2 are present Pin
jkirkerx12-Nov-15 9:51
professionaljkirkerx12-Nov-15 9:51 
AnswerRe: regex, get the last dollar amount if 2 are present [Solved] Pin
jkirkerx12-Nov-15 10:35
professionaljkirkerx12-Nov-15 10:35 
QuestionJavaScript Tour guide Pin
Member 1198488311-Nov-15 22:14
Member 1198488311-Nov-15 22:14 
AnswerRe: JavaScript Tour guide Pin
Richard MacCutchan11-Nov-15 22:19
mveRichard MacCutchan11-Nov-15 22:19 
GeneralRe: JavaScript Tour guide Pin
Member 1198488311-Nov-15 22:33
Member 1198488311-Nov-15 22:33 
AnswerRe: JavaScript Tour guide Pin
Richard Deeming12-Nov-15 3:13
mveRichard Deeming12-Nov-15 3:13 
QuestionJava 2D Array - User Input Pin
Frankie124510-Nov-15 14:02
Frankie124510-Nov-15 14:02 
QuestionRe: Java 2D Array - User Input Pin
Richard MacCutchan11-Nov-15 0:09
mveRichard MacCutchan11-Nov-15 0:09 
QuestionHow can I collect news from differnt sites in one html page Pin
abo sohaib9-Nov-15 21:18
abo sohaib9-Nov-15 21:18 
AnswerRe: How can I collect news from differnt sites in one html page Pin
Afzaal Ahmad Zeeshan9-Nov-15 21:34
professionalAfzaal Ahmad Zeeshan9-Nov-15 21:34 
GeneralRe: How can I collect news from differnt sites in one html page Pin
abo sohaib10-Nov-15 11:36
abo sohaib10-Nov-15 11:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.