1
I require you to consult the website http://world.secondlife.com/resident/24e6998d-7bf2-4d03-b38b-acf8f2a21fc1 and take the value that is in meta name="member_count" content="53"
in that case 53
Try to see if I can explain myself better.
I want to make a JS that manages to get the number of members of the link I posted up
So I intend that I can get that information and manipulate that value
The goal is to be able to display on my site the number of members of the group that shows on the link posted
What’s the best way to do this?
I’m trying to file a requisition XMLHttpRequest
but I was unsuccessful
function loadXMLDoc(){
var xmlhttp;
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}else{
xmlhttp=new
ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://world.secondlife.com/resident/24e6998d-7bf2-4d03-b38b-acf8f2a21fc1",true);
xmlhttp.send();
}
<input type="button" onclick="loadXMLDoc()">Request data</button>
<div id="myDiv"></div>
Try to improve your question, I do not understand very well what you want to do.
– PauloHDSousa
Ever tried to use
document.write()
to make sure that he is retrieving the desired information?– mutlei
has http://world.secondlife.com/resident/24e6998d-7bf2-4d03-b38b-acf8f2a21fc1 page and I would like to find a way to get the information 53 which is the number of members
– Amadeu Antunes
does not return anything xmlhttp.responseText
– Amadeu Antunes
You will not succeed. The server you are trying to access does not allow CORS.
XMLHttpRequest cannot load http://world.secondlife.com/resident/24e6998d-7bf2-4d03-b38b-acf8f2a21fc1?_=1418733119899. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://jsbin.com' is therefore not allowed access.
– Renato Gama
There is no way for me to capture the information of the number of members ?
– Amadeu Antunes
If the site does not allow CORS, then the only way will be by using a server-side approach, or by installing something in the client: browser extension or an HTTP server.
– Miguel Angelo
In LSL I made an llHTTPRequest() to the site http://world.secondlife.com/resident/24e6998d-7bf2-4d03-b38b-acf8f2a21fc1 and was able to obtain this information. The problem is that if I use LSL I have to send the information to a PHP and save it in a database. So I tried to use JS the same way I used LSL to get the same data. http://wiki.secondlife.com/wiki/World_API
– Amadeu Antunes