-
3 Aug 2010 8:41 AM #1
Correct the error of using EVAL () in AIR
Correct the error of using EVAL () in AIR
hello friends,
I want to know how I can do to correct this mistakes as it is very important to me, I tell you what I'm trying to do:
First I have a system in Adobe AIR, and everything works fine, but I want to do is that in a PHP page prints I say alert ('HELLO');
and the application I want to execute a function that returns me is what the AJAX, as shown below:
Code:Ext.Ajax.request({ url:'http://127.0.0.1/test.php', method:'POST', autoLoad:true, params:{ pUsu:String('pUsu'), pPsw:String('pPsw') }, evalScripts:true, success:function(result,request){ eval(result.responseText); }, failure:function(result,request){ air.trace('Failure'); } });
then if you look where I have the eval is that what it should return the AJAX run:
This bone
all I have in the test.php page is:Code:eval (result.responseText);
por me da un error que es:PHP Code:<?php
echo("
alert('Hola ... !!!');
");
?>
Error: Adobe AIR runtime security violation for JavaScript code in the application security sandbox (eval)
if anyone knows how to correct this error and they would appreciate a lot, and it is very important for me to do that because I need to run functions that come from the pages of php
-
3 Aug 2010 9:34 PM #2
I have to disappoint you. It's not possible to use eval() inside/after Ext.onReady.
Define the functions in JavaScript and return the parameters you need. Preferably in JSON.
So
Code:success: function(response) { var r = Ext.decode(response.responseText); alert(r.myAlertText); }PHP Code:echo json_encode(array(
'myAlertText' => 'Hello'
));
Programming today is a race between software engineers striving to build bigger and better Ń–diot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)
Enhanced ExtJS adapter for Adobe AIR
Similar Threads
-
Eval Security Issue in Adobe AIR 1.5.3/ExtJS 3.1.1
By sara_762001 in forum Ext.air for Adobe AIRReplies: 11Last Post: 1 Apr 2010, 6:59 AM -
ExtJs Lint / correct error description / design flaw detection
By ZeusTheTrueGod in forum Community DiscussionReplies: 9Last Post: 10 Mar 2010, 8:22 PM -
[SOLVED] GroupView for adobe air. eval problem
By PranKe01 in forum Ext.air for Adobe AIRReplies: 4Last Post: 4 Dec 2009, 2:33 AM -
is this correct way to expose eval?
By xevin in forum Ext.air for Adobe AIRReplies: 0Last Post: 17 Jan 2009, 4:23 AM -
Air runtime security restriction for eval
By MuratCorlu in forum Ext.air for Adobe AIRReplies: 2Last Post: 28 Aug 2008, 11:43 AM


Reply With Quote