Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ It has been tested in various situations but if you encounter a problem or if yo
Example of implementation in VizieR: http://vizier.u-strasbg.fr/vizier/welcome/
where votable.js is used to load the metadata and to format it on the client side

## Dependency

votable.js has a dependency on jQuery.

## Basic code usage

var p = new Parser();

var success = function() {
p.SelectResource(0); // select 1st resource in document
p.SelectTable(0); // select 1st table in resource
var data = p.GetData();
console.log("Value of first field in first row: ", data.TR[0].TD[0]);
};
var error = function() {
alert('Something went wrong');
};

p.setCallbackFunction(success, error);
p.load('http://vizier.u-strasbg.fr/viz-bin/votable/-A?-source=I/311/hip2&-c=M%2045&-out.max=999&-c.rd=5');
2 changes: 1 addition & 1 deletion votable.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function Parser() {
var time = new Date().getTime()
var asyncmode = false;
if (thisParser.callbackfn != null) asyncmode = true;
$.ajaxSetup({async: asyncmode});
$.ajaxSetup({async: asyncmode, dataType: 'xml'});

$.get(xmlDoc, function(DataXmlDoc) {
var i = 0, benchmark;
Expand Down