[jQuery] Help with livequery logic

2008-07-03 Thread Eric Snyder
I am trying livequery to solve this problem. I have a youth mentoring 
site that has profiles. They want to filter the profiles. I have a div 
that I use to stuff the filtered data into (#FilteredProfiles). The 
filtered data has pagination links at the bottom that I do not have 
control over. I want to bind a function to those links that does a post 
and gets new data. The problem is that the new data that is returned has 
new pagination links that need the function rebound. If I do not rebind 
the pagination links then the ones that are created by the cms are used 
and the browser loads the wrong page.

I have used livequery in this logic with success so I know it is 
working. The problem lies in the area marked "This is the problem area". 
When that code executes the post does it's thing but the new links 
inside the new data do not get the function rebound. If I remove that 
section of logic then the link that I click on changes text to 
"Clicked!" like it is supposed to.

Does anybody have any suggestions?

Thanks!

**
$(document).ready(function(){
getData();
$("#FilterSubmit").livequery('click', function(){
getData();
});//End of the filterSubmit actions
});//end of ready function


function getData(){
var 
$pagename="http://www.youthmentoring.net/includes/publicProfiles"+$("#gender 
option:selected").val()+$("#location option:selected").val();
$("#FilteredProfiles").html('http://www.youthmentoring.net/images/text-fetching data.gif" 
alt="Fetching data">');
$("#FilteredProfiles").load($pagename, function(data){
$("#FilteredProfiles").html(data);
$('#Pagination > a').livequery('click', function() {
var pattern=/P[0-9]([0-9]*)?/;
var $urlAppend;
if ($(this).attr("href").match(/P[0-9]([0-9]*)?/)){
$urlAppend = $(this).attr("href").match(/P[0-9]([0-9]*)?/)[0];
}else{
$urlAppend = "P0";
}
//Display getting data graphic
//This is the problem area
$("#FilteredProfiles").html('http://www.youthmentoring.net/images/text-fetching data.gif" 
alt="Fetching data">');
var 
$url="http://www.youthmentoring.net/includes/publicProfiles"+$("#gender 
option:selected").val()+$("#location 
option:selected").val()+"/"+$urlAppend ;
$("#FilteredProfiles").post($url, function(data){
$("#FilteredProfiles").html(data);
});
//End of the problem area
$(this).text('Clicked').blur();
return false;
});
});//End of load
}//End of getData function
**


[jQuery] Problem with .load

2008-07-02 Thread Eric Snyder

I have the following code:

$(document).ready(function(){
$("#FilterSubmit").click(function(){
var 
$pagename="http://www.agreatyouthmentoringorganization.net/includes/publicProfiles"+$("#gender
 
option:selected").val()+$("#location option:selected").val();
$("#FilteredProfiles").html('http://www.agreatyouthmentoringorganization.net/images/text-fetching 
data.gif" alt="Fetching data">');
$("#FilteredProfiles").load($pagename, {limit: 25}, function(data){
alert(data);
$("#FilteredProfiles").html(data);
});
});//End of the filterSubmit actions
});//end of ready function

It seems that I can get it to work only on the FF browser I am doing the 
dev work on. When I try it on any other FF or IE browser it fails. What 
happens is the loading data graphic gets displayed and it comes back 
with data and the alert fires but no data displays in the 
FilteredProfiles div.

I ahve looked and looked at this with no joy. Any help would be appreciated.