Hey Jason,

You must have a reason why the server cannot simply query Wikipedia?

You can use CORS Ajax calls these days so there is no need for a link. See
for example the following snippet from Wt.js:

  var crossDomain =
    (url.indexOf("://") != -1 || url.indexOf("//") == 0) &&
    host(url) != window.location.host;

  function createRequest(method, url) {
    var request = null;
    var supportsRequestHeader = true;
    if (window.XMLHttpRequest) {
      request = new XMLHttpRequest();
      if (crossDomain) {
if ("withCredentials" in request) {
  if (url) {
    request.open(method, url, true);
    request.withCredentials = "true";
  }
} else if (typeof XDomainRequest != "undefined") {
  request = new XDomainRequest();
  if (url) {
    supportsRequestHeader = false;
    try {
      request.open(method, url + '&contentType=x-www-form-urlencoded');
    } catch (err) {
      request = null;
    }
  }
} else
  request = null;
      } else
if (url)
  request.open(method, url, true);
    } else if (!crossDomain && window.ActiveXObject) {
      try {
request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (err) {
try {
  request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (err2) {
}
      }
      if (url && request)
request.open(method, url, true);
    }

    if (request && url && supportsRequestHeader)
      request.setRequestHeader("Content-type",
       "application/x-www-form-urlencoded");

    return request;
  }


Regards,
koen


2013/11/27 Jason H <scorp...@yahoo.com>

> I need to have the browser query Wikipedia and return the results to the
> WApplication (after some processing in the browser)
> I've looked into it and Wikipedia would support this via the CORS
> mechanism.
>
> I was going to do some JS and include it then call it with
> WApplication.doJavaScript(), but I don't see where I can control <link>
> elements.
> I also have to set the origin header.
>
> Thanks!
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to