Guten Tag,
muss eine javascript Passage verwenden und hätte nur eine kurze Frage:
Kann ich so irgendwie eine Variable senden? Vielen Dank!
VON:
<button type=\"button\" onClick="load('VARIABLE')">
NACH:
<script language="JavaScript"
type="text/javascript">
<!--
var XMLHTTP = null;
if (window.XMLHttpRequest) {
XMLHTTP = new XMLHttpRequest(); // IE 7, FF, Safari etc.
} else if (window.ActiveXObject) {
try {
XMLHTTP = new ActiveXObject("Msxml2.XMLHTTP"); // IE 5
} catch (x) {
try {
XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP"); // IE 6
} catch (x) {
}
}
}
function load() {
var ida = "show.value";
XMLHTTP.open("POST", "nachladen.php");
XMLHTTP.onreadystatechange = output;
XMLHTTP.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
XMLHTTP.send("post_variable=" +VARIABLE); <---------------------------------------------------
}
function output() {
if (XMLHTTP.readyState == 4) {
document.getElementById("daten").innerHTML = XMLHTTP.responseText;
}
}
//-->
</script>
muss eine javascript Passage verwenden und hätte nur eine kurze Frage:
Kann ich so irgendwie eine Variable senden? Vielen Dank!
VON:
<button type=\"button\" onClick="load('VARIABLE')">
NACH:
<script language="JavaScript"
type="text/javascript">
<!--
var XMLHTTP = null;
if (window.XMLHttpRequest) {
XMLHTTP = new XMLHttpRequest(); // IE 7, FF, Safari etc.
} else if (window.ActiveXObject) {
try {
XMLHTTP = new ActiveXObject("Msxml2.XMLHTTP"); // IE 5
} catch (x) {
try {
XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP"); // IE 6
} catch (x) {
}
}
}
function load() {
var ida = "show.value";
XMLHTTP.open("POST", "nachladen.php");
XMLHTTP.onreadystatechange = output;
XMLHTTP.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
XMLHTTP.send("post_variable=" +VARIABLE); <---------------------------------------------------
}
function output() {
if (XMLHTTP.readyState == 4) {
document.getElementById("daten").innerHTML = XMLHTTP.responseText;
}
}
//-->
</script>