Note that there are some explanatory texts on larger screens.

plurals
  1. POjsonp crossbrowser mistakes from domain or code side
    primarykey
    data
    text
    <p>im newbie in api and json getting data so i have a question regarding of getting the information by using <code>jsonp</code> from my website: <code>http://pda.bilgiteknolojileri.net/</code> i know that the domain name is pda not the api :) this is not my mistake though, not my domains, but i can moderate them, anyway i have a code:</p> <pre><code> var url='http://pda.bilgiteknolojileri.net'; $.ajax({ type: "GET", url: url, dataType: 'jsonp', jsonp: 'jsonp', crossDomain: true, success: function(cats) { $.each(cats.data, function(i, data) { var cat=data.cat; var cat_id=data.cat_id; $('#category').append('&lt;option value="'+cat_id+'"&gt;'+cat+'&lt;/option&gt;'); }); } }); </code></pre> <p>as far as i understand the code is ok, but there is a mistake in console: <code>Uncaught SyntaxError: Unexpected token &lt;</code> and second not big mistake <code>Resource interpreted as Script but transferred with MIME type text/html</code> what im doing wrong? is it the cross-browser mistake from the domain side or mine in code?</p> <p><strong>Request Headers:</strong></p> <pre><code>GET /?callback=jQuery182007281651743687689_1382452295311&amp;_=1382452295320 HTTP/1.1 Host: pda.bilgiteknolojileri.net Connection: keep-alive Cache-Control: no-cache Pragma: no-cache Accept: */* User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 DNT: 1 Accept-Encoding: gzip,deflate,sdch Accept-Language: tr,en-US;q=0.8,en;q=0.6,ru;q=0.4 Cookie: fbm_224237501004640=base_domain=.bilgiteknolojileri.net; CFID=337971; CFTOKEN=5130db21daca4ae5-BE9FEE21-0FA8-399A-7485246A32933BCE; JSESSIONID=7030f7b10f91d2d2d0ce10456f5c7a302350; WRK_COOKIE_ID=BE9FF125%2DA082%2D5206%2DD01747735EADD58B; __utma=56243896.53108638.1381244578.1382443118.1382450419.21; __utmc=56243896; __utmz=56243896.1381244578.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) </code></pre> <p><strong>Query string parameters</strong></p> <pre><code>callback:jQuery182007281651743687689_1382452295311 _:1382452295320 </code></pre> <p><strong>Response headers:</strong></p> <pre><code>HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Tue, 22 Oct 2013 14:19:24 GMT </code></pre> <p>The problem is that the response is in text/html format, where it should be javascript/application, what should i change? i cant get any data at all... thank you for the help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload