title: JSONP and AngularJS
body: <p>I'm developing software to integrate into a router, like the rest of our stack it's developed using AngularJS, the router manufacturer has an API built into the router which returns JSON(P?).</p>
  
  <p>To be a pain, they've prefixed the JSON response with </p>
  
  <pre><code>while(1);
  </code></pre>
  
  <p>Then commented out the JSON response, within the (minified) code they've written it is using this, so there is a way to access the data.</p>
  
  <p>Whenever I try (using ngResource) it's just running the while(1); function and causing the browser to crash. </p>
  
  <p>HTTP Response:</p>
  
  <pre><code>while(1); /*[{"username":"admin",
                "userlevel":2,
                "promptinfo":"",
                "enableprompt":false,
                "ID":"InternetGatewayDevice.UserInterface.X_Web.UserInfo.1.",
                "FirstLogin":1}]*/
  </code></pre>