Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a workaround. The following code is a Phonegap command that implements Cross Domain Call functionality. </p> <pre><code>using System; using System.IO; using System.Net; using System.Runtime.Serialization; using WP7CordovaClassLib.Cordova; using WP7CordovaClassLib.Cordova.Commands; using WP7CordovaClassLib.Cordova.JSON; namespace Cordova.Extension.Commands //namespace is predefined, don't change it! { public class Cdc : BaseCommand //Cross domain call { [DataContract] public class CdcOptions { [DataMember(Name = "path")] public string Path { get; set; } } public void Call(string args) { CdcOptions options = JsonHelper.Deserialize&lt;CdcOptions&gt;(args); var url = new Uri(options.Path, UriKind.Absolute); var webClient = new WebClient(); webClient.OpenReadCompleted += (s, e) =&gt; { if (e.Error != null) { DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Error")); return; } //Stream -&gt; string var sr = new StreamReader(e.Result); var result = sr.ReadToEnd(); DispatchCommandResult( new PluginResult(PluginResult.Status.OK, result)); }; webClient.OpenReadAsync(url, url); } } } </code></pre> <p>Test on the client side:</p> <p> <br> </p> <pre><code> &lt;script type="text/javascript"&gt; function cdc(path, success, fail) { PhoneGap.exec( success, //success fail, //fail "Cdc", //service "Call", //action path //args ); }; function onDeviceReady(e) { cdc( { path: "http://stackoverflow.com/questions/9291809/workaround-for-missing-whitelist-in-phonegap-for-windows-phone" }, function (arg) { document.getElementById('test').innerHTML = arg; }, function (arg) { document.getElementById('test').innerHTML = arg; }); } document.addEventListener("deviceready", onDeviceReady, false); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="test"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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