I am writing a PHP framework that allows PHP developers to create ExtJS interfaces with forms, grids, tabs and menus using PHP classes only.
To create a TabPanel, for example, a PHP class is created with an array of URLs that load dynamically when the user clicks on the tab title.
To do this, I use the following Javascript function, which loads a PHP page through an AJAX call and runs any scripts inside it.
function loadViewViaAjax(url) {
Ext.Ajax.request({
url: url,
success: function(objServerResponse) {
var responseText = objServerResponse.responseText;
var scripts, scriptsFinder=/<script[^>]*>([\s\S]+)<\/script>/gi;
while(scripts=scriptsFinder.exec(responseText)) {
eval(scripts[1]);
}
}
});
}
, eval(), do eval() . , PHP, AJAX, , , , , .
javascript eval(), , , script, .. TabPanels, Javascript ?