I am trying to get this code working —
var loader;
$(function() {
loader = new air.HTMLLoader();
loader.addEventListener(air.Event.COMPLETE, complete);
loader.load(new air.URLRequest('http://www.lilpirate.net/blog'));
});
function complete() {
$(loader.window.document).ready(function(){
$("#texts").val($("#header",loader.window.document).val());
alert("Complete!");
});
}
After compiling it using adl, the window opens and all goes as expected, but in the terminal I get the message
Error : Adobe Flash Player error: could not load cURL library
I get the Complete! alert message, but the textarea with id texts is not updated with the data in #header which is on http://www.lilpirate.net/blog
I think this is happening because of the error message adl is throwing.
I’m running Fedora 13 x64 and have installed flash player correctly(firefox test). I also have libcurl and libcurl-devel packages installed.
Help!
You can achieve what you are trying to do (I think) without using the air HTMLLoader like this:
SECURITY NOTE
I had better just say that this works because air will allow cross domain ajax requests. Air will also allow unrestricted access to the local filesystem. You need to be very carefull that you don’t include any malicious scripts using this method.
You should definitely take steps to sanitise the response for example using
dataFilter(data, type)to remove any script elements.