views:

30

answers:

1

Hi, 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
      }
    });    
...
...
A: 

Just make sure that your external file is loaded first.

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