I tried that but it still didn't work. I've reposted my code because I've refined it a lot so it doesn't have anything unnecessary in it.
I have a js file that is this:
Code:
/*jshint -W061 */
function call(url, parameters, callback) {
"use strict";
$.ajax({
type: 'POST',
url: url,
data: parameters,
success: function(data) {
callback(data);
},
cache: false
}
);
}
function loadJackpots() {
"use strict";
call("https://www.domain.com/passkey", { JL: 0 },
function(data) {
var divIdentifier, obj = eval('(' + data + ')');
$.each(obj.JL, function() {
divIdentifier = "";
switch (this.gameID) {
case 2:
divIdentifier = "#snap";
break;
case 5:
divIdentifier = "#dominos";
break;
case 1000:
divIdentifier = "#chess1";
break;
case 1001:
divIdentifier = "#chess2";
break;
case 1002:
divIdentifier = "#chess3";
break;
}
if (this.gameID >= 1000) {
switch (this.stakeID) {
case 4:
divIdentifier += "_50c";
break;
case 5:
divIdentifier += "_1d";
break;
case 7:
divIdentifier += "_2d";
break;
case 9:
divIdentifier += "_2d";
break;
}
}
if (this.gameID === 1000) {
switch (this.subID) {
case 0:
divIdentifier += "_1";
break;
case 1:
divIdentifier += "_2";
break;
case 2:
divIdentifier += "_3";
break;
}
}
$(divIdentifier).html("$" + this.jackpot);
});
}
);
}
I use this to actually load the values:
Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script><script type="text/javascript">
$(function() {
loadJackpots();
});
</script>
And to display the results I'm using this:
Code:
<div id="chess1">
<div id="chess1_50c">$1466.85</div>
<div id="chess1_1d">$1641.11</div>
<div id="chess1_2d">$378.04</div>
</div>
<div id="chess3">
<div id="chess3_50c">$303.86</div>
<div id="chess3_1d">$523.02</div>
<div id="chess3_2d">$1473.72</div>
</div>
</div>
<div style="float: left; margin: 194px 0 0 185px;">
<div id="chess2_1">
<div id="chess2_50c_1">$195.26</div>
<div id="chess2_1d_1">$154.37</div>
<div id="chess2_2d_1">$193.76</div>
</div>
<div id="chess2_2">
<div id="chess2_50c_2">$146.84</div>
<div id="chess2_1d_2">$119.58</div>
<div id="chess2_2d_2">$145.86</div>
</div>
<div id="chess2_3">
<div id="chess2_50c_3">$2.96</div>
<div id="chess2_1d_3">$19.25</div>
<div id="chess2_2d_3">$121.89</div>
</div>
</div>
</div>
<div style="height: 80px;">
<div id="snap">
<div id="snap_jp">$862.16</div>
</div>
<div id="dominos">
<div id="dominos_jp">$2823.18</div>
</div>
I've also tried this but to no avail, it just gave me an error saying obj is undefined:
Code:
<div id="dominos">
<div id="dominos_jp">$2823.18</div>
<script language="javascript">
document.getElementById("dominos_jp").HTML=obj.JL[1].jackpot
</script>
</div>
Bookmarks