User Tools

Site Tools


eg-259:lecture12

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eg-259:lecture12 [2012/03/07 07:56] – [The Renderers] eechriseg-259:lecture12 [2012/03/07 08:06] (current) – [What's Next?] eechris
Line 317: Line 317:
 The first parameter of the call to ''open()'' is the HTTP request method -- ''GET'', ''POST'', ''HEAD'' or any other method you want to use and that is supported by your server. Keep the method capitalized as per the HTTP standard; otherwise some browsers (like Firefox) might not process the request. For more information on the possible HTTP request methods you can check the W3C specs.  The first parameter of the call to ''open()'' is the HTTP request method -- ''GET'', ''POST'', ''HEAD'' or any other method you want to use and that is supported by your server. Keep the method capitalized as per the HTTP standard; otherwise some browsers (like Firefox) might not process the request. For more information on the possible HTTP request methods you can check the W3C specs. 
  
-The second parameter is the URL of the page you're requesting. As a security feature, you cannot call pages on 3rd-party domains. Be sure to use the exact domain name on all of your pages or you will get a 'permission denied' error when you call ''open()''. A common pitfall is accessing your site by //domain.tld//, but attempting to call pages with //%%www.domain.tld%%//+The second parameter is the URL of the resource you're requesting.  
 + 
 +<note warn> 
 +You cannot access resources from 3rd-party domains. This is called cross site scripting (XSS) [[wp>Cross-site_scripting]] and is not allowed as a security feature. Be sure to use the exact domain name on all of your pages or you will get a 'permission denied' error when you call ''open()''. A common mistake is accessing your site by //domain.tld//, but attempting to get resources with //%%www.domain.tld%%// 
 +</note>
  
 The third parameter sets whether the request is asynchronous. If ''TRUE'', the execution of the JavaScript function will continue while the response of the server has not yet arrived. This is the A in AJAX.  The third parameter sets whether the request is asynchronous. If ''TRUE'', the execution of the JavaScript function will continue while the response of the server has not yet arrived. This is the A in AJAX. 
Line 331: Line 335:
  
 Otherwise, the server will discard the POSTed data.  Otherwise, the server will discard the POSTed data. 
- 
  
 ===== Step 2: Handling the Server Response ===== ===== Step 2: Handling the Server Response =====
Line 584: Line 587:
   * Mapping resources to files    * Mapping resources to files 
  
-[[eg-259:ch15|Previous Lecture]] | [[eg-259:home]] | [[eg-259:lecture14|Next Lecture]]+[[eg-259:ch15|Previous Session]] | [[eg-259:home]] | [[eg-259:lecture14|Next Session]]
eg-259/lecture12.1331107000.txt.gz · Last modified: 2012/03/07 07:56 by eechris