the Roblox code:
local Data = game.HttpService:GetAsync('http://127.0.0.1:5500/WebsiteData/index.html') warn(Data)
the site code(JavaScript):
function httpGetAsync(theUrl, callback) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } xmlHttp.open("GET", theUrl, true); xmlHttp.send(null); }
it always warns:
13:56:42.893 - <html>
13:56:42.893 - <head>
13:56:42.894 - <title>L ua Learning 2 </title>
13:56:42.894 - <style>
13:56:42.894 - body {
13:56:42.894 - background: rgb(68, 68, 67);
13:56:42.895 - }
13:56:42.895 - h1 {
13:56:42.895 - color: #a7a7f3;
13:56:42.896 - font-family:Arial, Helvetica, sans-serif
13:56:42.896 - }
13:56:42.896 - h2 {
13:56:42.896 - color: rgb(21, 189, 231);
13:56:42.897 - text-decoration: rgb(228, 140, 33);
13:56:42.897 - border: black;
13:56:42.897 - font-family:Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
13:56:42.898 - background-color: rgb(255, 255, 255);
13:56:42.898 - }
13:56:42.898 -
13:56:42.898 - header {
13:56:42.899 - background: black;
13:56:42.899 - margin:auto;
13:56:42.899 - }
13:56:42.900 - footer {
13:56:42.900 - background: blanchedalmond;
13:56:42.900 - }
13:56:42.901 -
13:56:42.901 - li {
13:56:42.901 - color: azure;
13:56:42.902 - background-size:cover;
13:56:42.902 - }
13:56:42.902 -
13:56:42.902 - </style>
13:56:42.903 - </head>
13:56:42.903 - <head>
13:56:42.903 - <body>
13:56:42.904 -
13:56:42.904 - <!-- Code injected by live-server --> 13:56:42.904 - <script type="text/javascript"> 13:56:42.905 - // <![CDATA[ <-- For SVG support 13:56:42.905 - if ('WebSocket' in window) { 13:56:42.906 - (function () { 13:56:42.906 - function refreshCSS() { 13:56:42.906 - var sheets = [].slice.call(document.getElementsByTagName("link")); 13:56:42.907 - var head = document.getElementsByTagName("head")[0]; 13:56:42.907 - for (var i = 0; i < sheets.length; ++i) { 13:56:42.908 - var elem = sheets[i]; 13:56:42.908 - var parent = elem.parentElement || head; 13:56:42.909 - parent.removeChild(elem); 13:56:42.909 - var rel = elem.rel; 13:56:42.909 - if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { 13:56:42.910 - var url = elem.href.replace(/(&|\?)_cacheOverride=\d+/, ''); 13:56:42.910 - elem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf()); 13:56:42.911 - } 13:56:42.911 - parent.appendChild(elem); 13:56:42.912 - } 13:56:42.912 - } 13:56:42.913 - var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; 13:56:42.913 - var address = protocol + window.location.host + window.location.pathname + '/ws'; 13:56:42.914 - var socket = new WebSocket(address); 13:56:42.914 - socket.onmessage = function (msg) { 13:56:42.914 - if (msg.data == 'reload') window.location.reload(); 13:56:42.915 - else if (msg.data == 'refreshcss') refreshCSS(); 13:56:42.915 - }; 13:56:42.916 - if (sessionStorage && !sessionStorage.getItem('IsThisFirstTime_Log_From_LiveServer')) { 13:56:42.916 - console.log('Live reload enabled.'); 13:56:42.917 - sessionStorage.setItem('IsThisFirstTime_Log_From_LiveServer', true); 13:56:42.917 - } 13:56:42.918 - })(); 13:56:42.918 - } 13:56:42.919 - else { 13:56:42.919 - console.error('Upgrade your browser. This Browser is NOT supported WebSocket for Live-Reloading.'); 13:56:42.920 - } 13:56:42.920 - // ]]> 13:56:42.921 - </script></body>
13:56:42.921 - </Head>
13:56:42.921 - </html>
sorry if this don't make sense but its my first time with JavaScript
Closed as off-topic by Norbunny, moo1210, Filipalla, Torren_Mr, and karlo_tr10
This question has been closed by our community as being off-topic from ROBLOX Lua Scripting.
Why was this question closed?