HTTP & AJAX06.HTTP & AJAX 19 décembre 2023 Développement web il3 HTTP & AJAX HE-Arc (DGR) 2022 HyperText Transfer Protocol • Protocole application : invention www en 1990 (v0.9) – Connexion, GET, réponse, userid=joe&password=guessme • Outils HTTP – CLI : curl – Browser dev tools • Exemples PATCH : mnot4 , SOA bits5 AJAX : Historique • Asynchronous Javascript And Xml • Buzzword, Jesse James Garret6, 2005 • Mise à jour Request (IE5, 1999 pour OWA) – Fetch API • Pas obligatoire d’avoir du JS, XML ni d’être asynchrone ! AJAX • XHR est devenue la méthode standard jusqu’à 2018 – Popularisée par Google (GMaps, GMail, …) –0 码力 | 11 页 | 91.09 KB | 1 年前3
CakePHP Cookbook 2.x
CakePHP comes with a set of view helpers that make things like linking, form output, JavaScript and AJAX a snap. You can learn more about how to use them in Helpers, but what’s important to note here is single argument, which can be the request METHOD (get, put, post, delete) or some request identifier (ajax). It is not a way to check for specific posted data. For instance, $this->request->is('book') will presentational logic to be accessed and shared between views. One of the core helpers, JsHelper, makes AJAX requests within views much easier and comes with support for jQuery (default), Prototype and Mootools0 码力 | 1096 页 | 958.62 KB | 1 年前3
Learning LaravelToken Mismatch Error in AJAX 179 Introduction 179 Examples 179 Setup Token on Header 179 Set token on tag 179 Check session storage path & permission 179 Use _token field on Ajax 180 Chapter 62: use ModelNotFoundException. if ($e instanceof ModelNotFoundException) { // ajax 404 json feedback if ($request->ajax()) { return response()->json(['error' => 'Not Found'], 404); laravel-datatables This package is created to handle server-side works of DataTables jQuery Plugin via AJAX option by using Eloquent ORM, Fluent Query Builder or Collection. Read more about this here or here0 码力 | 216 页 | 1.58 MB | 1 年前3
CakePHP Cookbook 2.x
CakePHP comes with a set of view helpers that make things like linking, form output, JavaScript and AJAX a snap. You can learn more about how to use them in Helpers, but what’s important to note here is single argument, which can be the request METHOD (get, put, post, delete) or some request identifier (ajax). It is not a way to check for specific posted data. For instance, $this->request->is('book') will presentational logic to be accessed and shared between views. One of the core helpers, JsHelper, makes AJAX requests within views much easier and comes with support for jQuery (default), Prototype and Mootools0 码力 | 820 页 | 2.52 MB | 1 年前3
CakePHP Cookbook 4.x
instead of defining view class mappings in RequestHandlerComponent. The automatic view switching for ‘ajax’ requests offered by RequestHandlerComponent is deprecated. Instead you can either handle this in beforeRender. if ($this->request->is('ajax')) { $this->viewBuilder()->setClassName('Ajax'); } Alternatively, you can have the HTML view class switch to the ajax layout as required in your controller the current request is HEAD. is('options') Check to see whether the current request is OPTIONS. is('ajax') Check to see whether the current request came with X-Requested- With = XMLHttpRequest. is('ssl')0 码力 | 1249 页 | 1.04 MB | 1 年前3
《Slides Dev Web》 07. jQuery
Manipulations CSS – Réponse aux évenements du navigateur – Effets visuels et animations – Requêtes et réponses Ajax • Abstraction implémentations différents navigateurs • Facile à apprendre • Utilisation du chaînage ready, load, resize, scroll, unload • Exemple $("p").click(function(){ // code à éxecuter ici }); AJAX5 • $(selector).load(URL, data, callback) – URL : Ressource ciblée par la requête – data : éventuel contenu – callback : fonction de rappel avec 3 paramètres : 5https://www.w3schools.com/jquery/jquery_ajax_load.asp 4 ∗ responseTxt ∗ statusTxt ∗ xhr • $.get(URL, callback) • $.post(URL, data, callback)0 码力 | 5 页 | 49.45 KB | 1 年前3
CmlPHP v2.x 开发手册
ool($name, $default = null) Request Cml\Http\Request 用来获取请求的一些信息如 用户ip 、 是 否为移动端发起请求 、 是否为ajax请求 等; 获取用户IP地址 \Cml\Http\Request::ip() 获取用户标识 \Cml\Http\Request::userAgent() 获取主机名称 \Cml\Http\Request::host() sMobile() 判断是否为POST请求 \Cml\Http\Request::isPost() 判断是否为GET请求 \Cml\Http\Request::isGet() 判断是否为AJAX请求 \Cml\Http\Request::isAjax() 判断是否以cli方式运行 \Cml\Http\Request::isCli() 获取POST过来的二进制数据,与手机端交互 的调试信息外, 在debug=true下, 框架本身就提供了详尽的调试信息. 普通请求会看到页面下的cmlphp控制台里面显示了程序运行信息 ajax请求(Html渲染引擎),打开浏览器调试工具,会在浏览器控制台 看到程序运行信息 ajax请求(Json渲染引擎),打开浏览器调试工具,会在浏览器请求响 应中看到返回的sql信息 在debug=true开发环境下以上几种调试信息一般已经满足开发0 码力 | 245 页 | 720.67 KB | 1 年前3
CmlPHP v2.x 开发手册
l($name, $default = null) 38 Request Cml\Http\Request 用来获取请求的一些信息如 用户ip 、 是否为移动端发起请求 、 是否为ajax 请求 等; 获取用户IP地址 \Cml\Http\Request::ip() 获取用户标识 \Cml\Http\Request::userAgent() 获取主机名称 \Cml\Http\Request::host() sMobile() 判断是否为POST请求 \Cml\Http\Request::isPost() 判断是否为GET请求 \Cml\Http\Request::isGet() 判断是否为AJAX请求 \Cml\Http\Request::isAjax() 判断是否以cli方式运行 \Cml\Http\Request::isCli() 获取POST过来的二进制数据,与手机端交互 外, 在debug=true下,框架本身就提供了详尽的调试 信息. 普通请求会看到页面下的cmlphp控制台里面显示了程序运行信息 100 ajax请求(Html渲染引擎),打开浏览器调试工具,会在浏览器控制台看到程序运行信息 ajax请求(Json渲染引擎),打开浏览器调试工具,会在浏览器请求响应中看到返回的sql信息 在debug=true开发环境下以上几种调试信息一般已经满足开发中的调试需求了。0 码力 | 143 页 | 1.54 MB | 1 年前3
CakePHP Cookbook 4.x
instead of defining view class mappings in RequestHandlerComponent. The automatic view switching for ‘ajax’ requests offered by RequestHandlerComponent is deprecated. Instead you can either handle this in beforeRender. if ($this->request->is('ajax')) { $this->viewBuilder()->setClassName('Ajax'); } Alternatively, you can have the HTML view class switch to the ajax layout as required in your controller current request is HEAD. • is('options') Check to see whether the current request is OPTIONS. • is('ajax') Check to see whether the current request came with X-Requested-With = XMLHttpRequest. • is('ssl')0 码力 | 967 页 | 2.88 MB | 1 年前3
CmlPHP v2.x 开发手册
stBool($name, $default = null) Request Cml\Http\Request 用来获取请求的一些信息如 用户ip 、 是否为移动端发起请求 、 是否为 ajax请求 等; 获取用户IP地址 \Cml\Http\Request::ip() 获取用户标识 \Cml\Http\Request::userAgent() 获取主机名称 \Cml\Http\Request::host() sMobile() 判断是否为POST请求 \Cml\Http\Request::isPost() 判断是否为GET请求 \Cml\Http\Request::isGet() 判断是否为AJAX请求 \Cml\Http\Request::isAjax() 判断是否以cli方式运行 \Cml\Http\Request::isCli() 获取POST过来的二进制数据,与手机端交互 框架本身就提供 了详尽的调试信息. 普 通 请 求 会 看 到 页 面 下 的 cmlphp 控 制 台 里 面 显 示 了 程 序 运 行 信 息 ajax请求(Html渲染引擎),打开浏览器调试工具,会在浏览器控制台看到程序 运行信息 ajax请求(Json渲染引擎),打开浏览器调试工具,会在浏览器请求响应中看到 返回的sql信息 在debug=true开发环境下以上几种调试信息一般已经满足开发中的调试0 码力 | 251 页 | 973.37 KB | 1 年前3
共 24 条
- 1
- 2
- 3













