[jQuery] Re: Noob Question: Using Selectors after ajax load
Thanks a lot for the help! Really appreciate it -Eric
[jQuery] Re: Noob Question: Using Selectors after ajax load
What is the structure of the page you are loading into your div? Could it be that the new content is causing problems, like duplicate id's, and that is causing the inability to find elements? On Jun 25, 10:22 am, Eric [EMAIL PROTECTED] wrote: I am sure this has been answered before, but I could not find it. I click on a link which loads a second page into a div using the load function $(document).ready( function() { $(.actions a).bind (click, function () { $(#ajax_div).load($(this).attr(href)); return false; } ) $('#SampleCustDue, #SampleCustReq, #SampleVendorReq, #SampleVendorActual, #SampleVendorRec, #SampleCustShip, #SampleCustApprove, #SampleVendorApprove').datepicker(); }); The page that is being loaded has several text fields that I am using the date picker plugin for (#SampleCustDue etc...) The problem is that the selectors are not finding these fields after the page has been loaded in the #ajax_div. My guess is that the page needs to be re-indexed, but I cannot find a function to do that. My other attempt was to create a new $(document).ready() function in the page that was being loaded via ajax, but that never seemed to get called. Any ideas? Thanks in advance!
[jQuery] Re: Noob Question: Using Selectors after ajax load
Take a look at http://brandonaaron.net/docs/livequery/ On Jun 25, 12:22 pm, Eric [EMAIL PROTECTED] wrote: I am sure this has been answered before, but I could not find it. I click on a link which loads a second page into a div using the load function $(document).ready( function() { $(.actions a).bind (click, function () { $(#ajax_div).load($(this).attr(href)); return false; } ) $('#SampleCustDue, #SampleCustReq, #SampleVendorReq, #SampleVendorActual, #SampleVendorRec, #SampleCustShip, #SampleCustApprove, #SampleVendorApprove').datepicker(); }); The page that is being loaded has several text fields that I am using the date picker plugin for (#SampleCustDue etc...) The problem is that the selectors are not finding these fields after the page has been loaded in the #ajax_div. My guess is that the page needs to be re-indexed, but I cannot find a function to do that. My other attempt was to create a new $(document).ready() function in the page that was being loaded via ajax, but that never seemed to get called. Any ideas? Thanks in advance!