Search code examples
jquerywindowswindows-desktop-gadgetshttp-request

How to use jQuery .get() in Windows Gadget


I'm trying to get data from a web-page into my sidebar gadget via:

$.get("http://localhost/index.php", function(data) {
    $("#result").html("Data Loaded: " + data);
});

When I view this via my Apache webserver, it works.
Using this code within the Gadget, it doesn't.

Is there a way to simply get data from a web-page into a Windows Gadget?

greets - lugro (sorry for my bad English)

System: Windows 7 jQuery v1.5.2


Solution

  • Yes! you have to set this property:

    jQuery.support.cors = true;