내 자바 스크립트 나 다른 스크립트 소스를 가리 키도록 필요한 것은 Ultimatly, 그것은 단지 당신의 텍스트 에게있다! 또는 그것은 당신 만이 아니다! 컨테이너 ID가 '< div id = "container">'인이 isup.me/echelonservices.co.uk의 결과 페이지 소스 내에 있습니다.다른 웹 사이트
내가 지금 할 수있는 방법을 발견하지만, 올바른 사이트에 자바를 가리킬 수 없습니다. isup.me/echelonservices.co.uk : 내가 무슨 짓을하면 다음과 같은 URL을 사용합니다. 그러나, 나는 이것을하는 데 문제가 있습니다. 누군가가 웹 서버에서 웹 페이지를 호스팅하지 않고 Javascript 나 다른 스크립트 소스를 사용할 수있는 방법을 알려줄 수 있습니까? 그래서 로컬 클라이언트 컴퓨터에서 웹 페이지를 실행합니다.
<script type="text/javascript">
//Specify where the sctipt should be running the code against.
window.location.protocol = "http"
window.location.host = "isup.me/echelonservices.co.uk"
//Look for the Class ID and output to a variable.
element = document.getElementById('container');
var Status = element.textContent || element.innerText;
//If the "Status" says: UP write UP, DOWN write DOWN and anything else write Status could not be determined!
if (Status=="UP") {document.write('<div style="color:#00BB00;font-family:Arial;font-weight:bold">UP</div>')}
else {if (Status=="DOWN") {document.write('<div style="color:#FF0000;font-family:Arial;font-weight:bold">DOWN</div>')}
else {document.write('<div style="color:#EDA200;font-family:Arial;font-weight:bold">WARNING:<br>Status could not be determined!</div>')};};
</script>
마지막에게 같은 다른 클라이언트 측 기술에 확인하시기 바랍니다 coe 문단은 문제없이 작동합니다. 그 첫 번째, 아마도 두 번째, 내가 도움이 필요합니다. – Echelon
그 헤더에서 응답을 수정해야합니다. 할 수 없다면 브라우저에서 자바 스크립트의 데이터를 사용할 수 없습니다. – dandavis
JavaScript로 다른 도메인의 DOM에 액세스 할 수 있다고 생각하지 않습니다. 이것을 서버 측 코드로 구현해야합니다. –