Browse Source

Updating web events

Josh Engebretson 9 years ago
parent
commit
026069b986

+ 2 - 2
WebRequestChunksExample/JavaScript/Resources/Scripts/main.js

@@ -7,14 +7,14 @@ var data = "";
 
 
 // Listen for the "download_chunk" event to see when we have data.
 // Listen for the "download_chunk" event to see when we have data.
 // Note that this event is not available on all platforms.
 // Note that this event is not available on all platforms.
-request.subscribeToEvent("download_chunk", function (event) {
+request.subscribeToEvent("WebRequestDownloadChunk", function (event) {
 
 
     data += event.download.readString();
     data += event.download.readString();
 
 
 });
 });
 
 
 // Listen for the "complete" event to see when the response is complete.
 // Listen for the "complete" event to see when the response is complete.
-request.subscribeToEvent("complete", function (event) {
+request.subscribeToEvent("WebRequestComplete", function (event) {
 
 
     if (event.error) {
     if (event.error) {
         // When something goes wrong, print the error, then return.
         // When something goes wrong, print the error, then return.

+ 1 - 1
WebRequestHeadersExample/JavaScript/Resources/Scripts/main.js

@@ -7,7 +7,7 @@ request.setRequestHeader("Some-Special-Header", "Special header value");
 request.setRequestHeader("A-Magic-Header", "Magic header value");
 request.setRequestHeader("A-Magic-Header", "Magic header value");
 
 
 // Listen for the "complete" event to see when the response is complete.
 // Listen for the "complete" event to see when the response is complete.
-request.subscribeToEvent("complete", function (event) {
+request.subscribeToEvent("WebRequestComplete", function (event) {
 
 
     if (event.error) {
     if (event.error) {
         // When something goes wrong, print the error, then return.
         // When something goes wrong, print the error, then return.

+ 1 - 1
WebRequestSimpleExample/JavaScript/Resources/Scripts/main.js

@@ -3,7 +3,7 @@
 var request = new Atomic.WebRequest("GET", "https://httpbin.org/get", 0);
 var request = new Atomic.WebRequest("GET", "https://httpbin.org/get", 0);
 
 
 // Listen for the "complete" event to see when the response is complete.
 // Listen for the "complete" event to see when the response is complete.
-request.subscribeToEvent("complete", function (event) {
+request.subscribeToEvent("WebRequestComplete", function (event) {
 
 
     if (event.error) {
     if (event.error) {
         // When something goes wrong, print the error, then return.
         // When something goes wrong, print the error, then return.