0

hi

i have created a php file which calls a php function and echos the results.

i dont want to display the results i want to use them in a jquery function.

jQuery('body').prepend("<div id='target'></div>");
    gMap.gmap3({
        action: 'init',
        onces: {
            bounds_changed: function() {
                var number = 0;
                jQuery(this).gmap3({
                    action: 'getBounds',
                    callback: function() {
				  ### THIS IS WHERE I WANT THE RESULTS ##
                    }
                });
            }
        }
    },

i have been searching and think i need to use ajax to get the php page

$.ajax({
  url: 'ajax/test.html',
  success: function(data) {
    $('.result').html(data);
    alert('Load was performed.');
  }
});

but how can i use the data whwere i want it?

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by pritaeas
0

Tutorial ? It's just code. An explanation would make it a tutorial.

For improvement, you can use json_encode() in your php file, to return a JSON object. If you do, then the split() function is obsolete (a , in your return value would break the data too). Best thing is that it would still work, if you have the need to return a list of records.

Edited by pritaeas: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.