-
-
Save edstenson/4771744 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>How To Connect the Visual Query Builder to DataSift</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript" src="jcsdl/minified/jcsdl.min.js"></script> | |
<script type="text/javascript" src="jcsdl/minified/jcsdl.definition.js"></script> | |
<link rel="stylesheet" type="text/css" href="jcsdl/minified/jcsdl.min.css" /> | |
</head> | |
<body> | |
<div id="jcsdl"></div> | |
<div id="newinteractions"></div> | |
<script type="text/javascript"> | |
var yourHTTPServerURL = "http://example.com:port/"; | |
var xDSid = ''; | |
var editor = new JCSDLGui($('#jcsdl'), { | |
save : function(code) { | |
$.post(YourHTTPServerURL + "call.php", | |
{csdl: code}, | |
function(data) { | |
window.xDSid = data; | |
alert(window.xDSid); | |
}); | |
}}); | |
setTimeout("updateList()", 5000); | |
function updateList() | |
{ | |
$.get(YourHTTPServerURL + "read.php", function(data) { | |
$('#newinteractions').html(data); | |
}).error(function(x, e) { | |
if (x.status == 0) { | |
alert('Check Your Network.'); | |
} else if (x.status == 404) { | |
alert('Requested URL not found.'); | |
} else if (x.status == 500) { | |
alert('Internel Server Error.'); | |
} else { | |
alert('Unknow Error.\n' + x.responseText); | |
} | |
}); | |
setTimeout("updateList()", 5000); | |
} | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment