Получить запрос на Ajax для JavaScript/JS:
<script type = "text/javascript">/* Создать xmlhttprequest объект*/var xmlhttp; функция getXmlhttpobject () {if (window.xmlhttprequest) {// код для ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest (); } else {// code для IE6, IE5 xmlhttp = new ActivexObject ("microsoft.xmlhttp"); } return xmlhttp; } // ----------------------- // function getLabelsget () {xmlhttp = getxmlhttpobject (); if (xmlhttp == null) {alert ('Ваш браузер не поддерживает Ajax!'); возвращаться; } var id = document.getElementById ('id'). Value; var url = "http://www.leefrom.com?id="+id+"& t/"+math.random (); xmlhttp.open ("Get", url, true); xmlhttp.onreadystateChange = Favok; // После отправки события было получено сообщение. Функция вызова xmlhttp.send (); } function getOkget () {if (xmlhttp.readystate == 1 || xmlhttp.readystate == 2 || xmlhttp.readystate == 3) {// Локальная подсказка: загрузка} if (xmlhttp.readystate == 4 && xmlhttp.status = 200) {vare.ReadyState == 4 & xmlhttp.responsetext; // Обработка возвращает результат}} </script>Разместите запрос на Ajax для JavaScript/JS:
<script type = "text/javascript">/* Создать xmlhttprequest объект*/var xmlhttp; функция getXmlhttpobject () {if (window.xmlhttprequest) {// код для ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest (); } else {// code для IE6, IE5 xmlhttp = new ActivexObject ("microsoft.xmlhttp"); } return xmlhttp; } // ----------------------- // function getLabelspost () {xmlhttp = getxmlhttpobject (); if (xmlhttp == null) {alert ('Ваш браузер не поддерживает Ajax!'); возвращаться; } var url = "http://www.lifefrom.com/t/"+math.random (); xmlhttp.open ("post", url, true); xmlhttp.setrequestheader ("content-type", "Application/xwww-form-urlencoded"); xmlhttp.send (); xmlhttp.onreadyStateChange = getLabelSok; // После отправки события было получено сообщение, вызов функции} getOkpost () {if (xmlhttp.readystate == 1 || xmlhttp.readystate == 2 || xmlhtp.readystate == 3) {// local stracting eppressing/iftyting/iftyting eppropting/ifaty straffity (xmlhttp.readystate == 4 && xmlhttp.status == 200) {var d = xmlhttp.responsetext; // возвращаемое значение // Обработка возвращаемого значения}} </script>Примечание. Xmlhttprequest является основой Ajax. При создании объектов xmlhttprequest вы должны быть в том же «<cript> </script> 'Tag, что и метод Ajax, который вы написали! В противном случае запрос AJAX будет ошибкой, а данные не будут возвращены. JavaScript/JS Ajax post/get запрос.
Приведенное выше краткое обсуждение JS Native Ajax, Get and Post - это весь контент, которым я делюсь с вами. Я надеюсь, что вы можете дать вам ссылку, и я надеюсь, что вы сможете поддержать Wulin.com больше.