Skip to content

Commit

Permalink
Fix for internet exporer (caching)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyer committed Apr 6, 2011
1 parent 1f13fe0 commit d0fab37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ public void setTimestamp(long timestamp) {

@Override
public String toString() {
return "TradeResponse [accountName=" + accountName + ", confirmationNumber=" + confirmationNumber + ", error="
+ error + ", errorMessage=" + errorMessage + ", orderType=" + orderType + ", price=" + price
return "TradeResponse [accountName=" + accountName + ", requestId="
+ requestId + ", confirmationNumber=" + confirmationNumber
+ ", error=" + error + ", errorMessage=" + errorMessage
+ ", orderType=" + orderType + ", price=" + price
+ ", quantity=" + quantity + ", ticker=" + ticker + "]";
}

Expand Down
8 changes: 5 additions & 3 deletions stocks/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
}
function confirm(id) {
if (lasttrades.id) {
clearTimeout(lasttrades.id)
clearTimeout(lasttrades.id);
delete lasttrades.id;
}
$.get("trade?requestId=" + id, function(response) {
if (response && response.requestId) {
Expand All @@ -90,11 +91,12 @@
}));
delete lasttrades.id;
} else {
lasttrades.id = setTimeout("confirm('" + id + "')", 1000);
lasttrades.id = setTimeout("confirm('" + id + "')", 2000);
}
});
}
$(function() {
$.ajaxSetup({cache:false});
$('#start').click(start);
$('#stop').click(stop);
$('#clear').click(clear);
Expand All @@ -109,7 +111,7 @@
function(request) {
var message = "Processing...";
if (request && request.ticker) {
confirm(request.id)
confirm(request.id);
} else {
message = "The trade request was invalid. Please provide a quantity and a stock ticker.";
}
Expand Down

0 comments on commit d0fab37

Please sign in to comment.