Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access-Control-Allow-Origin error while connecting to api fixed #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions website_example/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ <h4 class="yourStats">Payments</h4>



/* Market data polling */
/* Market data polling */

var intervalMarketPolling = setInterval(updateMarkets, 300000); //poll market data every 5 minutes
var xhrMarketGets = {};
Expand All @@ -287,7 +287,13 @@ <h4 class="yourStats">Payments</h4>
var marketsData = [];
for (var i = 0; i < cryptonatorWidget.length; i++){
(function(i){
xhrMarketGets[cryptonatorWidget[i]] = $.get('https://www.cryptonator.com/api/ticker/' + cryptonatorWidget[i], function(data){
cryptonatorWidget[i] = cryptonatorWidget[i].replace('{symbol}', lastStats.config.symbol.toLowerCase());
xhrMarketGets[cryptonatorWidget[i]] = $.get('https://api.cryptonator.com/api/ticker/' + cryptonatorWidget[i], function(data){
if(data.error) {
return;
}
$('.marketRate').show();

marketsData[i] = data;
completedFetches++;
if (completedFetches !== cryptonatorWidget.length) return;
Expand All @@ -311,7 +317,6 @@ <h4 class="yourStats">Payments</h4>




/* Hash Profitability Calculator */

$('#calcHashRate').keyup(calcEstimateProfit).change(calcEstimateProfit);
Expand Down