balasund.mca Posted August 22, 2009 Share Posted August 22, 2009 Hi, In the frontend, upon clicking a button I get contact details through the below ajax script. Now I want to know what does the code inside this component do. Does it only read the contact details OR does it also write something in the database. The code is this <a href='javascript:void(0);' onclick="getDetails('MnP-JGckeyE+2222=1','JGckeyE%2222%3D1');" function getDetails(rowId,uname) { try { ajaxRequest = createXmlHttpRequest(showContact,rowId); } catch(error) { ajaxRequest = null; return false; } var params = "?uname=" + encodeURIComponent(uname)+ "&sid="+ sid + "&xhr=1"; ajaxRequest.open("GET",gbi("getContactNumUrl").value+params,true); ajaxRequest.send(null); return false; } function showContact(rowId) { // when readyState is 4, we are ready to read the server response if (ajaxRequest.readyState==4) { // continue only if HTTP status is "OK" if (ajaxRequest.status == 200) { try { var html = ajaxRequest.responseText; gbi(rowId).innerHTML = html; } catch(e) { alert("Error reading the response: " + e.toString()); } } else { alert("There was a problem retrieving the data:\n" +ajaxRequest.statusText); } } } Link to comment https://forums.phpfreaks.com/topic/171387-kindly-tell-me-how-this-ajax-code-will-work/ Share on other sites More sharing options...
corbin Posted August 22, 2009 Share Posted August 22, 2009 Does it only read the contact details OR does it also write something in the database. We can't know that without seeing the backend code. Link to comment https://forums.phpfreaks.com/topic/171387-kindly-tell-me-how-this-ajax-code-will-work/#findComment-904087 Share on other sites More sharing options...
balasund.mca Posted August 23, 2009 Author Share Posted August 23, 2009 But from the variables that is passed, is it not possible to know whether is anything written to the DB? Link to comment https://forums.phpfreaks.com/topic/171387-kindly-tell-me-how-this-ajax-code-will-work/#findComment-904273 Share on other sites More sharing options...
corbin Posted August 23, 2009 Share Posted August 23, 2009 I could guess, but as far as knowing for sure, of course it's not possible to know. Link to comment https://forums.phpfreaks.com/topic/171387-kindly-tell-me-how-this-ajax-code-will-work/#findComment-904313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.