<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 22:18:32 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[David M&uuml;ller: Cross Domain AJAX Guide]]></title>
      <guid>http://www.phpdeveloper.org/news/18868</guid>
      <link>http://www.phpdeveloper.org/news/18868</link>
      <description><![CDATA[<p>
In his latest post <i>David M&uuml;ller</i> covers some of the things to consider when <a href="http://www.d-mueller.de/blog/cross-domain-ajax-guide/">working with cross-domain ajax requests</a> including CORS and iframes.
</p>
<blockquote>
As it is widely known, AJAX Requests are only possible if port, protocol and domain of sender and receiver are equal. [...] Having this cleared out, we will cover ways around this restriction.
</blockquote>
<p>
He covers three main approaches to allowing these cross-domain requests (and some of the security implications that can come with them):
</p>
<ul>
<li>CORS (Cross Origin Resource Sharing)
<li>JSONP (Javascript with a local domain callback)
<li>Iframes
</ul>
<p>
He also briefly mentions things like <a href="https://developer.mozilla.org/en-US/docs/DOM/window.postMessage">window.postMessage</a> (HTML5) and the use of a backend script to proxy a request into your application's local code. 
</p>]]></description>
      <pubDate>Mon, 10 Dec 2012 12:17:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Building A RESTful PHP Server: Output Handlers]]></title>
      <guid>http://www.phpdeveloper.org/news/17478</guid>
      <link>http://www.phpdeveloper.org/news/17478</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> is back with another post in her "Building a RESTful PHP Server" series today with <a href="http://www.lornajane.net/posts/2012/building-a-restful-php-server-output-handlers">this new post</a> showing how to work with output handlers (her focus is on JSON).
</p>
<blockquote>
So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way.
</blockquote>
<p>
She advocates using output handlers instead of the usual views you'd think of in a typical MVCish sort of application. The difference here is that there's not a lot of extra overhead to produce the results - it's literally an output directly from a class extending the base view (including the correct headers). She also briefly mentions the inclusion of <a href="http://en.wikipedia.org/wiki/JSONP">JSONP</a> functionality, allowing you to specify a local callback to execute when the request is returned. A few other "nice to haves" are also mentioned like the number of results returned and pagination support.
</p>]]></description>
      <pubDate>Wed, 01 Feb 2012 10:25:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[WebSpeaks.in: Cross Domain Posting using PHP and JavaScript: ITS POSSIBLE!]]></title>
      <guid>http://www.phpdeveloper.org/news/15610</guid>
      <link>http://www.phpdeveloper.org/news/15610</link>
      <description><![CDATA[<p>
Ever been frustrated by the fact that your javascript code can't make JSON requests to sites under other other domains? Well, WebSpeaks.in has <a href="http://www.webspeaks.in/2010/12/well.html">some happy news</a> for you in the form of JSONP.
</p>
<blockquote>
Well.....finally i have worked out how to post cross-domain data which is restricted by browser's security policies. What is it?? This will be used for posting AJAX requests via java-script to any web-service or web-page in any DOMAIN and also get back the results from there.
</blockquote>
<p>
JSONP allows you to call a URL outside of the domain the script is running from with a callback. This callback lives in the calling script so, technically, it never leaves that scope. There's <a href="http://www.google.com/search?q=jsonp">lots of other resources</a> out there to help you implement it in your own code including <a href="http://api.jquery.com/jQuery.getJSON/">jQuery</a> and <a href="http://www.prototypejs.org/learn/json">Prototype</a> JSON handling.
</p>]]></description>
      <pubDate>Tue, 21 Dec 2010 11:51:35 -0600</pubDate>
    </item>
  </channel>
</rss>
