Changeset ee33d0c
- Timestamp:
- Nov 21, 2019, 10:38:47 AM (3 years ago)
- Branches:
- master
- Children:
- c4e2312
- Parents:
- 78c6909
- Location:
- web
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
web/core.php
r78c6909 ree33d0c 192 192 if(isset($_REQUEST[$varname])) return $_REQUEST[$varname]; 193 193 return $def; 194 } 195 196 /// Проверяет был ли получен запрос через ajax 197 /// @return boolean 198 function isAjaxRequest() 199 { 200 return isset($_SERVER['HTTP_X_REQUESTED_WITH']) 201 && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) 202 && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; 194 203 } 195 204 -
web/css/comm.js
r78c6909 ree33d0c 379 379 httpRequest.onreadystatechange = function() { popupReqWin(httpRequest,popup); }; 380 380 httpRequest.open('GET', url, true); 381 httpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 381 382 httpRequest.send(null); 382 383 return false; -
web/vitrina.php
r78c6909 ree33d0c 194 194 } 195 195 } else { 196 $tmpl->msg("Товар добавлен в корзину!", "info", "<a class='urllink' href='/vitrina.php?mode=basket'>Ваша корзина</a>"); 196 if(isAjaxRequest()) { 197 $tmpl->msg("Товар добавлен в корзину!", "info", "<a class='urllink' href='/vitrina.php?mode=basket'>Ваша корзина</a>"); 198 } else { 199 if (getenv("HTTP_REFERER")) { 200 redirect(getenv("HTTP_REFERER")); 201 } 202 } 197 203 } 198 204 } else {
Note: See TracChangeset
for help on using the changeset viewer.