If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Sending Data: back to my PHP function as arguments

Hello,

I'm very new to jQuery and only recently been adapting to JS while working with it. Crazy I know.
Also, WordPress complicates things much further than standard AJAX... I've been able to break through (don't ask how many hours) until this:

I'm trying to send latitude and longitude to my PHP function (gathered from JS, navigator.geolocation). I've tried several things but right now I'm building up an object(?) that's working but not creating valid arguments for my PHP query function to use.

Trying to get my latitude and longitude into this action function so I can actually start working on conditional queries and such.

Can you tell me why I cannot just do it the way I was by building up a JS object with everything in it then referencing it within my AJAX function? It triggers my query function but something regarding scope maybe why I can't get those lat lon vars?

UPDATE:
I created a JS object to build up my "data string?" and logged it. This is what my console shows for my data object:

I completely understand, and for what it's worth you're right on about regular AJAX jQuery stuff.
UPDATE:
The way it works is that POST vars are only available WITHIN the action function I guess... I was trying to grab them in the global scope of functions.php but you cannot. In fact doing so broke my site. Once I tried using them within the function they were available.