Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi.
i'm using this line to include a php page into a "main" oneCode: Select all
require_once 'verConfig.php';Code: Select all
<script type="text/javascript">
function refreshConfig (cfg) {
size = document.config.elements.length;
ctent = "";
for (i=1; i < size; i++){
ctent = ctent + document.config.elements[i].value +",";
}
ctent = ctent.substr(0,ctent.length-1);
if ( value ) {
location.href = "verConfig.php?c=<?=$c?>&calc=2&arrProd="+ctent;
} else {
location.href = "verConfig.php?c=<?=$c?>&calc=1&arrProd="+ctent;
}
}
</script>
so i'm trying to solve this problem using ajax, is there any way to use this to call the page again, without refreshing the "main" page only the included one (verConfig.php) ??
Code: Select all
function GetXmlHttpObject() {
var xmlHttp = null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
} catch (e) {
// Internet Explorer
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function updatePage() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
document.getElementById("element").value = response;
}
}
function calcConfig(...) {
try {
size = document.config.elements.length;
ctent = "";
for (i=1; i < size; i++){
ctent = ctent + document.config.elements[i].value +",";
}
ctent = ctent.substr(0,ctent.length-1);
if ( value ) {
location.href = "verConfig.php?c=<?=$c?>&calc=2&arrProd="+ctent;
} else {
location.href = "verConfig.php?c=<?=$c?>&calc=1&arrProd="+ctent;
}
xmlHttp.onreadystatechange = updatePage;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} catch (e) { }
}
thanks in advance
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]