Im trying do display my body onload in a div tag, but cant solve it ? Can It be because I have 3 function in my javascript ?
When Im using a simple form, it works like a charm. But I dont want the form, just it to be displayed in a Div tag.
Thanks for al the help youre giving me here 🙂
this is my script
<script language="javascript" type="text/javascript">
<!--
// Get the HTTP Object
function getHTTPObject(){
if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest) return new XMLHttpRequest();
else {
alert("Your browser does not support AJAX.");
return null;
}
}
// Change the value of the outputText field
function setOutput(){
if(httpObject.readyState == 4){
document.getElementById('outputText').value = httpObject.responseText;
}
}
// Implement business logic
function doWork(){
httpObject = getHTTPObject();
if (httpObject != null) {
httpObject.open("GET", "rss.php?rssFeed="
+document.getElementById('inputText').value, true);
httpObject.send(null);
httpObject.onreadystatechange = setOutput;
}
}
var httpObject = null;
//-->
</script>
This is the code im using for displaying.
The thing is that I do not want to use input type or textarea. since i get a border around the displaying text.
I just want it to look like plain text. not textfields.
<body onload="doWork()">
<div id="page-wrap">
<h1> Dagens ordspråk</h1>
<div id="myDiv">
<input type="hidden" onclick="doWork();" name="inputText" id="inputText"/>
<textarea name="outputText" id="outputText" cols="50" rows="20"></
</textarea>
</div>
</div>
Change
to
And you can convert your textarea to a
divto hold the results now..Alternatively you can style the textarea and input to not have a border..