Alright, I'm rather old at JavaScript -- I haven't fiddled with it in the longest time. I need someone to help me out with something.
I know what document.write does, but it doesn't help me with my goal: I want to be able to manipulate specific files on my server.
Let me clarify this -
I want to set up a specific directory where I will allow my users to manipulate files. More specifically, I want to allow them to manipulate the text on 1 file (for example, userhome.html). I know one can do this using AJAX, as I have been able to switch the displayed content of one of my pages with an AJAX script.
err... here is the source code I am using right now:
here is the HTML page:
I want the users to be able to edit the "demo.html", "demo2.html" and "demo3.html" files.
The page can be found at http://www.enderia.net/ulrin.com/index/test.html and I appreciate all replies (even those who tell me I'm an idiot -- at least I got noticed and you're keeping this thread alive so somebody with the intellect I require can find it ^^)
I know what document.write does, but it doesn't help me with my goal: I want to be able to manipulate specific files on my server.
Let me clarify this -
I want to set up a specific directory where I will allow my users to manipulate files. More specifically, I want to allow them to manipulate the text on 1 file (for example, userhome.html). I know one can do this using AJAX, as I have been able to switch the displayed content of one of my pages with an AJAX script.
err... here is the source code I am using right now:
Code:
function ajaxLoader(url,id) {
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function() {
if (x.readyState == 4 && x.status == 200) {
el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
here is the HTML page:
Code:
<html>
<head>
<script type="text/javascript" src="ajaxLoader.js"></script>
<style>@import url("mystyle.css");</style>
</head>
<body onload="ajaxLoader('demo.html','contentLYR')">
This is a test page/script. :)
<input type="button" value="Demo Page 1" onClick="ajaxLoader('demo.html','contentLYR')">
<input type="button" value="Demo Page 2" onClick="ajaxLoader('demo2.html','contentLYR')">
<input type="button" value="Demo Page 3" onClick="ajaxLoader('index.html','contentLYR')">
<div id="contentLYR">
</div>
</body>
</html>
I want the users to be able to edit the "demo.html", "demo2.html" and "demo3.html" files.
The page can be found at http://www.enderia.net/ulrin.com/index/test.html and I appreciate all replies (even those who tell me I'm an idiot -- at least I got noticed and you're keeping this thread alive so somebody with the intellect I require can find it ^^)