javascript - Wordpress symbols undefined in proxy called AJAX script -
i working hard populate extjs data grid in wordpress plugin. totally new web programming following may stupid question.
i managed write php script delivers webpage embedded java sript code creates extjs data grid in front side , sucessfully queries data using extjs proxy, model , data store. json proxy calls separate getdata.php script (by url) queries database, converts retrieved data json format , returns them echo. works.
now intended add debugging code getdata.php script. unfortunately when using if (wp_debug) {}
error telling me use of undefined constant wp_debug
(which found out debugging network access since database script called proxy , not produce visible output). in other scripts can use wp_debug symbol without problems.
any idea why getdata.php doesn't know wp_debug while other scripts of plugin do?
update: seems wordpress smybols unknown in getdata.php.
update2: ajax scripts need called using special wordpress methods. see answer below.
if you've done danny suggested , didn't work think may beg question of whether or not page done plugin or otherwise generated wordpress or if it's php page wrote happens in same folder/server doesn't @ point include or call upon wordpress. if it's later make sure you're including wp-load so:
include('wp-load.php');
Comments
Post a Comment