Commit ad6d9f31 authored by Marc Duez's avatar Marc Duez

model.js : loadDataUrl function , can load .data file from an url

- need to follow the same origin policy
  (.data file need to be on the same server as the browser)
  (or .data file server need to have CORS active)
parent 6c17d073
......@@ -42,7 +42,7 @@ if (typeof config != 'undefined') {
$('#demo_file_menu').css("display", "")
var demo_file = document.getElementById("demoSelector")
for (var i = 0; i < tagName.length; i++) {
for (var i = 0; i < config.demo_file.length; i++) {
(function (i) {
var path = config.demo_file[i].split("/")
......
......@@ -131,6 +131,25 @@ Model.prototype = {
}
}, //end load
loadDataUrl: function (url) {
var self = this;
$.ajax({
type: "POST",
timeout: 5000,
crossDomain: true,
url: url,
success: function (result) {
json = jQuery.parseJSON(result)
m.reset();
m.parseJsonData(json, 50)
.loadGermline();
m.initClones()
}
});
}, //end load
parseJsonData: function (data, limit) {
self = this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment