Show some code. I don't understand what it means to embed JS in a flex app.
Thanks for the response.
here is some code:
private static var FUNCTION_DELETE : String =
"function (inStr, inAuthHeader, verb)" +
"var xhr = new XMLHttpRequest();" +
"xhr.onreadystatechange = function() " +
"if (xhr.readyState==4) " +
"if (xhr.status == 204)" +
// some method
"xhr.open(verb, inStr, true);" +
"xhr.setRequestHeader('Authorization, Basic '+inAuthHeader);" +
ExternalInterface.call(FUNCTION_DELETE, str, encodedString, verb);
where verb is "DELETE".
I don't see any mention in the doc that you can pass the code for a function
as the first parameter to ExternalInterface.call. Where did you see that?
Normally the function is in the HTML wrapper. You could have a generic
function in the wrapper that would set up this function first then call it
Thanks for the reply,
After doing some googling, I found that one and that works fine, if we add js alert inside that code.
By the way, If the user wants to add authentication headers and pass that via external interface to the js and call xmlhttprequest for some url, then it might be possible to intercept that username and password.