Skip to content

Instantly share code, notes, and snippets.

@tonetheman
Created July 3, 2013 16:02
Show Gist options
  • Select an option

  • Save tonetheman/5919795 to your computer and use it in GitHub Desktop.

Select an option

Save tonetheman/5919795 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script>
var user = "USERNAME", pass = "PASSWORD";
function mycallback(data)
console.log("hey hey called");
console.log("data: " + JSON.stringify(data));
}
function getBrowsers() {
var url ="http://"+user+":"+pass+"@crossbrowsertesting.com/api/v2/screenshots/browsers";
console.log("url: " + url);
$.ajax({
type: "GET",
url: url,
data: {format : "jsonp", callback : "mycallback" },
cache: false,
dataType: "jsonp",
success : function(data, textStatus, jqXHR) {
console.log("data: " + data);
console.log("text: " + textStatus);
console.log("jq: " + jqXHR);
}
});
}
$(document).ready(function() {
getBrowsers();
});
</script>
</head>
<body>
hello
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment