php - Ajax request to self-page not working -
i have php page follow javascript code in it:
$("#savebutton").click(function() { hlalert('saving...'); $.getjson("<?php echo $php_self; ?>", { ajax: 1, classes: $("#alllessons").serialize() }, function(output) { if (output.status == false) { hlalert(output.message); } else { hlalert('saved!.'); } }); });
for whatever real not work. javascript before , after exectute these seemingly not. not failed status returned.
hlalert() function displays twitter alert message.
at top of php page have code
<?php if ($_get['ajax'] == 1) { // parse ajax values // output json , die } // regular page code
i tried changing names of passed values in getjson call, doesn't anything. i've tried putting page getjson calls different file , doesn't either.
is there fundamentally wrong getjson code cannot see? allowed make $.ajax calls self-page?
thanks
do mean $_server['php_self']
? not sure if there $php_self
.
Comments
Post a Comment