0

I had made one function for making pagination ,sorting and listing all in one and that function I call on load of page of body like

<body onload='MYFUNCTION(parm1,param2,param3)'>

Now i want to apply some jquery on the button which shows all document in fancybox which come by that onload but when i try to do on

$(function(){
    $(#container).on('click','#button',function(){
        //code here for load fancybox and getting all image stuff by ajax 
    });
});

than i not get that element because it cant find it on page load so what can i do
inshort - how to select element in jquery which is load after page load
Thank you..

RevanthKrishnaKumar V.
  • 1,855
  • 1
  • 21
  • 34
  • So delegate to `document` level. That's said i'm not sure to understand your question... – A. Wolff Jul 20 '15 at 18:06
  • When you do delegation with `.on()` the selector on the left should be a static element, the selector in the argument list is the dynamically added element(s). – Barmar Jul 20 '15 at 18:09
  • thxx for telling me i trying to find it from 2 days on stackoverflow . – Bhaumik Bhuva Jul 20 '15 at 18:15

0 Answers0