3 ms·
Speed it up by not going through your server to get the query suggestions. You can drop the jsonp parameter and just eval the results. Or change the jsonp param
by what 16y ago
Speed it up by not going through your server to get the query suggestions. You can drop the jsonp parameter and just eval the results. Or change the jsonp parameter and include it as a script tag.
- feross 16y agoI'm now doing everything client-side using JQuery and <script> tags to get around cross-domain XHR limitations. Now Google can't block it. :)
- djb_hackernews 16y agoThey can block by referer, of which your domain is. Though I doubt they would.
- what 16y agoConsidering they offered him a job (http://news.ycombinator.com/item?id=1680265 http://news.ycombinator.com/item?id=1680265), I don't think they'll block it.
- adityagada 16y agonow a Facebook application on YouTube Instant : http://apps.facebook.com/ytinstant/ http://apps.facebook.com/ytinstant/
- shajith 16y agoI'm curious: how do you get around crossdomain XHR limitations using <script> tags? Thanks!
- feross 16y ago<script> tags aren't subject to cross-domain restrictions. Think about it - all those website statistics scripts are hosted on external servers, but their Javascript gets executed just fine. By dynamically inserting <script> tags into the page, you can force Javascript from another domain to execute in your domain.
- shajith 16y agoGot it, thanks. I finally got around to learning JSONP. JQuery's $.ajax API handles it automatically for you too (if you use the 'jsonp' or 'script' dataType options), which is very nice.