Hi there I have some diffrent sites that i'd like to view as one long page using javascript is there anyway to do that?
The reason is that they are related in a sense and that I can use javascript to do some counting of things that i usually do everyday aswell as a lot of other people in my school does.
I tried using AJAX but im not sure what i'm doing wrong or maybe AJAX might be restricted to one page only.
Heres some code from my FAILED ajax test.
<html>
<body>
<script language="javascript" type="text/javascript">
<!--
//Browser Support Code
function ajaxFunction(){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('ajaxDiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
//var age = document.getElementById('age').value;
//var wpm = document.getElementById('wpm').value;
//var sex = document.getElementById('sex').value;
//var queryString = "?age=" + age + "&wpm=" + wpm + "&sex=" + sex;
ajaxRequest.open("GET",
"http://schema.sys.kth.se/4DACTION/WebShowSearch/2/1-0?wv_type=5&wv_category=1154&wv_ts=20090817T162950X9217&wv_search=&wv_startWeek=934&wv_stopWeek=1002&wv_first=0&wv_addObj=&wv_delObj=&wv_obj1=26878000&wv_text=Textformat",
true);
ajaxRequest.send(null);
}
//-->
</script>
<form name='myForm'>
<!--
Max Age: <input type='text' id='age' /><br />
Max WPM: <input type='text' id='wpm' /><br />
Sex: <select id='sex'>
<option value='m'>m</option>
<option value='f'>f</option>
</select>
-->
<input type='button' onclick='ajaxFunction()' value='Query MySQL' />
</form>
<div id='ajaxDiv'>Your result will display here</div>
</body>
</html>