CodeIgniter Forums
[question] getXMLHTTP - CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [question] getXMLHTTP - CI (/showthread.php?tid=24073)



[question] getXMLHTTP - CI - El Forum - 10-29-2009

[eluser]sloth[/eluser]
Salam,

I want to create another xmlhttp request combine with CI.
I controller to call page : 'visit/add/583'
here a javascriptfunction:

Code:
function getXMLHTTP() {  
......
......
......
}  

function getKecamatan(strURL) {  
    var req = getXMLHTTP();  
    if (req) {  
        req.onreadystatechange = function() {  
            if (req.readyState == 4) {  
                // only if “OK”  
                if (req.status == 200) {  
                    document.getElementById('id_kecamatan')[removed]=req.responseText;  
                } else {  
                    alert("There was a problem while using XMLHTTP:\n" + req.statusText);  
                }  
            }  
        }  
        req.open("GET", strURL, true);  
        req.send(null);  
    }  
}

i already have view to call that javascriptfunction.

Result from xmlhttp it call 'visit/add/getNakes/5'
I want it call 'visit/getNakes/5'

NB : i already have function getNakes on controller visit.