I'm doing some ajax stuff which triggers on a click event, the link has a couple of values and variables.
The link in question looks like this:
<?php $link_url = esc_url(wp_nonce_url( site_url('?my_page=ajax-processor&action=dynamic_date_loop&my_date='.$date),
"dynamic_date_loop_nonce") ); ?>
The $date variable above holds a string like "2013-09".
I process this link and extract the values here:
var url = wpAjax.unserialize(element.attr('href'));
var s = {};
s.data = $.extend(s.data, { action: url.action, _ajax_nonce: url._wpnonce });
I understand the syntax for this goes something like var1:value1 but here my value is a variable, so in this context do I just add my_date: url.$date ? This just doesn't look right to me.
$datewhen you're executing your javascript code. You'll have to extract it from the query string you've assembled and placed in the javascript variableurl.