title: Uncaught SyntaxError: Unexpected token < for list 1 of php (<?php)
body: <p>I tired using the proxy solution in </p>
  
  <p><a href="https://stackoverflow.com/questions/12683530/origin-http-localhost-is-not-allowed-by-access-control-allow-origin">Origin http://localhost is not allowed by Access-Control-Allow-Origin.?</a></p>
  
  <p>and on the file proxy.php I have</p>
  
  <pre><code>&lt;?php
  // File Name: proxy.php
  if (!isset($_GET['url'])) die();
  $url = urldecode($_GET['url']);
  $url = 'http://' . str_replace('http://', '', $url); // Avoid accessing the file system
  echo file_get_contents($url);
  </code></pre>
  
  <p>In main I have</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Title&lt;/title&gt;
  &lt;script src="proxy.php"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-                1.3.2.min.css" /&gt;
  &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"     src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $.ajax({
  url:"proxy.php?url=theurlofmyapi",
  type:'GET',
  dataType:"json",
  success:function(data){console.log(data.results.result[1].category);}
  });&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div data-role="header"&gt; 
  &lt;h1&gt;Upcoming Movies&lt;/h1&gt; 
  &lt;/div&gt; 
  &lt;ul id= "data" data-role="listview"&gt;
  &lt;li&gt;&lt;img src="http://content8.flixster.com/movie/11/17/20/11172082_mob.jpg"         class="ui-li-thumb"&gt;&lt;h3 class="ui-li-heading"&gt;Warning&lt;/h3&gt;&lt;p class="ui-li-desc"&gt;hot&lt;/p&gt;                           &lt;/li&gt;
  &lt;li&gt;&lt;a href="javascript:alert('hi')"&gt;Audi&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="bmw.html"&gt;BMW&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Now I call main.html in my localhost in Google chrome and the console says error on first line of php. I'm not sure what the problem is. The error message is:
      Uncaught SyntaxError: Unexpected token &lt; </p>