Código HTML:
function getURLVar(urlStr,urlVarName) { var urlHalves = urlStr.split('?'); var urlVarValue = ''; if(urlHalves[1]) { var urlVars = urlHalves[1].split('&'); for(i=0; i<=(urlVars.length); i++){ if(urlVars[i]){ var urlVarPair = urlVars[i].split('='); if (urlVarPair[0] && urlVarPair[0] == urlVarName) { urlVarValue = urlVarPair[1]; break; } } } } return urlVarValue } $(document).ready(function() { $('a.insert').click(function() { var p1 = getURLVar(this.href,'p1'); var p2 = getURLVar(this.href,'p2'); var dataString = 'p1='+p1+'&p2='+p2; $.ajax({ type: 'post', url: 'jquery-record-insert.php', data: dataString, beforeSend: function() { parent.animate({'backgroundColor':'#fb6c6c'},300); }, success: function() { parent.slideUp(300,function() { parent.remove(); }); } }); }); });
Código PHP:
<div id="record-1" class="record">
<a class="insert" href="#&p1=<?PHP echo $row['p1']?>&p2=<?PHP echo $row['p2']?>">
<img border=0 src="/Imagenes/ima0.gif" height=16>
</a><?PHP echo title;?>
</div>
p1 = ??
p2 = ??
Salu2!!!!