mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
make it work on IE too (nw)
This commit is contained in:
parent
a586a7ad9b
commit
2ab6a079d8
@ -24,21 +24,27 @@
|
|||||||
writeToScreen('<b style="color: green;">Connected</b>');
|
writeToScreen('<b style="color: green;">Connected</b>');
|
||||||
};
|
};
|
||||||
websocket.onclose = function(ev) {
|
websocket.onclose = function(ev) {
|
||||||
writeToScreen('<b style="color: white;">disconnected</b>');
|
writeToScreen('<b style="color: white;">Disconnected</b>');
|
||||||
};
|
};
|
||||||
websocket.onmessage = function(ev) {
|
websocket.onmessage = function(ev) {
|
||||||
if (ev.data=='update_machine')
|
if (ev.data=='update_machine')
|
||||||
{
|
{
|
||||||
$.getJSON('json/game', function(data) {
|
$.ajax({
|
||||||
|
url: "json/game",
|
||||||
|
cache: false,
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
var items = [];
|
var items = [];
|
||||||
if(data.name =='___empty') {
|
if(data.name =='__empty') {
|
||||||
items.push('No driver running');
|
items.push('No driver running');
|
||||||
} else {
|
} else {
|
||||||
items.push('<h1>Currently running : ' + data.description + ' [' + data.manufacturer+']</h1>');
|
items.push('<h1>Currently running : ' + data.description + ' [' + data.manufacturer+']</h1>');
|
||||||
|
|
||||||
}
|
}
|
||||||
document.getElementById('current').innerHTML = items.join('');
|
document.getElementById('current').innerHTML = items.join('');
|
||||||
});
|
},
|
||||||
|
error: function (request, status, error) { alert(status + ", " + error); }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user