Permalink
Browse files

requestId debugging

  • Loading branch information...
1 parent 319929d commit 001595b7566e5ebbae08c3eeb34ff1c0bfc39ab8 @rickofullsail rickofullsail committed Sep 13, 2011
Showing with 13 additions and 8 deletions.
  1. +13 −8 test.html
View
@@ -13,11 +13,11 @@
<dt>API Key</dt>
<dd><input type="text" size="40" maxlength="40" name="apikey" id="apikey" />
<dt>Echo</dt>
- <dd><input type="text" size="40" maxlength="40" name="echo" id="echo" /><input value="api.echo" type="button" onclick="window.jsViddler.setKey(this.form.apikey.value);window.jsViddler.echo(this.form.echo.value,function(msg){document.getElementById("response").value=msg});" />
+ <dd><input type="text" size="40" maxlength="40" name="echo" id="echo" /><input value="api.echo" type="button" onclick="onEchoClick(this.form);" />
<dt>User</dt>
- <dd><input type="text" size="40" maxlength="40" name="user" id="user" /><input value="videos.getByUser" type="button" onclick="window.jsViddler.setKey(this.form.apikey.value);window.jsViddler.getUserVideos(this.form.user.value,function(resp){document.getElementById("response").value=JSON.stringify(resp)});" />
+ <dd><input type="text" size="40" maxlength="40" name="user" id="user" /><input value="videos.getByUser" type="button" onclick="onUserVideosClick(this.form);" />
<dt>Response</dt>
- <dd><textarea rows="10" cols="80" wrap="soft" name="response" id="response"></textarea></dd>
+ <dd><textarea rows="10" cols="80" wrap="soft" name="apiresponse" id="apiresponse"></textarea></dd>
</dl>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
@@ -42,11 +42,16 @@
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
-var foo = function(){
- jsViddler.setKey("YOUR API KEY HERE");
- jsViddler.echo("I like turtles", function(msg) { alert(msg); });
- jsViddler.getUserVideos("sandieman", function(response) {
- console.log(response);
+var onEchoClick = function(f) {
+ window.jsViddler.setKey(f.apikey.value);
+ window.jsViddler.echo(f.echo.value, function(msg){
+ document.getElementById("apiresponse").value = msg;
+ });
+};
+var onUserVideosClick = function(f) {
+ window.jsViddler.setKey(f.apikey.value);
+ window.jsViddler.getUserVideos(f.user.value, function(resp){
+ document.getElementById("apiresponse").value = JSON.stringify(resp);
});
};
</script>

0 comments on commit 001595b

Please sign in to comment.