0

I'm having an issue in the success callback of my ajax function. On success of the ajax function I want to call a javascript function that is defined in an external file that is included in the header. However the javascript function never gets called. Is there something I am doing wrong here?

My JQuery looks like this:

$(document).ready(function() {

   $.ajax({
      type: 'get',
      url: 'lib/ajaxDB.php',
      data: 'ajax=1&action=locations&uid=<?php echo $uid; ?>&token=<?php echo $admin->getToken(); ?>',
      success: function(data) {
          addUserLocations(data); // call function in gmaps.js
      }
    });    
...
...
3
  • Check your console, are you getting any errors? Commented Sep 23, 2010 at 10:33
  • 1
    code looks ok ... try firefox error console to check other errors... Commented Sep 23, 2010 at 10:34
  • Thanks, I never really do javascript. I checked console and it says the function is not defined, but it is. I'll try move the function into the main index.php page. Commented Sep 23, 2010 at 11:20

1 Answer 1

0

Just make sure that your external file is loaded first.

Sign up to request clarification or add additional context in comments.

1 Comment

I have, it is loaded in the header. I've doubled checked functions names etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.