Login
Кто использует курл? Вывод результата запроса на страницу в HTML?
1688 просмотров
Перейти к просмотру всей ветки
in Antwort 7495 08.10.23 19:23
Карочи, я решил проблемку мультизапроса как мог: наделал в терминале дырок "ембед", в каждой дырке отдельный запрос:
<html><body><embed src="01.htm" scrolling="no" width="600" height="35" style="border:1px solid gray; margin-bottom: 5px;" /><br><embed src="02.htm" scrolling="no" width="600" height="35" style="border:1px solid gray; margin-bottom: 5px;" /><br><embed src="03.htm" scrolling="no" width="600" height="35" style="border:1px solid gray; margin-bottom: 5px;" /><br></body></html>
отдельная страница выглядит так:
<html><body><script type="text/javascript" src="jquery.js"></script><script src="rpc.js"></script><script src="address-balance.js"></script><b><div class="mypanel"></div></b><script type="text/javascript">var text1 = Address;const myArray = text1.split(",");var ADDRESS = myArray[2];var url = rpc;$.ajax({url: rpc,crossDomain: true,method: 'post',contentType: 'application/json',data: JSON.stringify({'id': 0,'jsonrpc': '2.0','method': 'eth_getBalance',params: [ADDRESS,'latest']})}).done(function(response) {let text = (parseInt(response.result, 16)/1000000000000000000);$(".mypanel").html(" 03: " + ADDRESS + " = " + text);});</script></body></html>
дополнительно 3 яваскрипта: это понятное дело jquery.js,
+ rpc.js, где записываю адрес страницы куда слать запрос:
var rpc = 'https:eth.drpc.org';
и address-balance.js, где записываю через запятую адреса:
var Address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B,0x0000000000000000000000000000000000007495,';
