- Code: Select all
function ajaxform(){
var ajaxRequest; // ajax
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;
}
}
}
// Detta er sent til serverinn
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('ajaxDiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
var fran = document.getElementById('franvaluta').value;
var till = document.getElementById('tilvaluata').value;
var summa = document.getElementById('summa').value;
var queryString = "?fran=" + fran + "&till=" + till + "&summa=" + summa;
ajaxRequest.open("GET","includes/valuta.php" + queryString, true);
ajaxRequest.send(null);
last line in form is like
<input class="valutabuttom" type='button' onclick='ajaxform()' value='Valitera' />
</form>
Okei my problem is that when i get on homepage like index.php , this code works fine but when i get on page like
http://www.site.com/katagories/something/something.htm this script dont work , ive tried to change like
- Code: Select all
ajaxRequest.open("GET","[b]/[/b]includes/valuta.php" +
but without anyluck. Maybe someone here can help me with soulution.



