Andreu | 2c6367c | 2019-09-17 23:46:36 +0200 | [diff] [blame] | 1 | function getUrlParameter(name) { |
| 2 | name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); |
| 3 | var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); |
| 4 | var results = regex.exec(location.search); |
| 5 | return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); |
| 6 | }; |
| 7 | |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame^] | 8 | function send_request(id, msg) { |
| 9 | $.ajax({ |
| 10 | 'url': '../request.php', |
| 11 | 'type': 'GET', |
| 12 | 'dataType': 'json', |
| 13 | 'data': { 'id': id, 'msg': msg }, |
| 14 | 'success': function(data) { alert("S'ha avisat a l'altre jugador"); }, |
| 15 | 'error': function(xhr, status, error) { |
| 16 | alert(xhr.responseText); |
| 17 | } |
| 18 | }); |
Andreu | 2c6367c | 2019-09-17 23:46:36 +0200 | [diff] [blame] | 19 | } |