I load JQUERY code with: elgg_require_js('foo‘);
But I get errors from script debugger because elgg does not recognize the php code (see examples)
What can I do?
Example 1:
$('#output-pic-rated_member').attr("src", '<?php echo $elgg_site_url?>mod/audit/images/codes/' + parseInt(data['member']['rated']) + '.jpg');
$('#outputdialogtext1_member').html(data['member']['count'] + " " + '<?php echo elgg_echo('member_audit_main_counts'); ?>');
Example 2:
var proxy2 = new wijhttpproxy({
url: "<?php echo $elgg_site_url ?>/audit/db_audittyp",
dataType: "json",
data: {
featureClass: "P",
style: "full";
maxRows: 12
},
key: 'audits'
});
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 1 like
You must log in to post replies.You don't need to use PHP for these.
If you must use PHP, create your AMD module with a PHP extension, as so foo.js.php and register it as a simplecache view (elgg_register_simplecache_view('foo.js'))