[FX.php List] [OFF] Bootstrap question

Steve Winter steve at bluecrocodile.co.nz
Thu Dec 31 14:04:57 MST 2015


And that's only going to get called when the cancel button gets clicked...

You've got them the wrong way round... Try this:

> $('.main').load(‘date.php'),function (){
> 		console.info('hello Bob');
                 
> 	
> 		}).on('click', '.cancel', function(){
// do whatever
});

But you never answered the question - when does the button with class cancel get loaded into the DOM..? Is it always present at page load, or does it come back in the return of date.php....?


Steve Winter
steve at bluecrocodile.co.nz
+44 777 852 4776

> On 31 Dec 2015, at 21:39, Bob Patin <bob at patin.com> wrote:
> 
> So…
> 
> I did this:
> 
> 	$('.main').delegate('.cancel', 'click', function(){
> 		$('.main').load(‘date.php'),function (){
> 			$('title').html('testing');
> 		}
> 		return false;
> 	});
> 
> It should put “testing” into a DIV on my page, but not only does that happen, but nothing else I put in there works either…
> 
> So odd. My DATE page is really simple—it calls the date picker widget and then puts up a pulldown menu and a couple of buttons…
> 
> Here’s a thought: one of the 2 buttons calls the CANCEL function above; that can’t be causing a loop, could it?
> 
> Should “return false” be inside the function as opposed to outside it?
> 
> B
> 
> 
>> On Dec 31, 2015, at 2:27 PM, Steve Winter <steve at bluecrocodile.co.nz> wrote:
>> 
>> Hi Bob
>> 
>> Add the callback to the load:
>> 
>> .load('date.php', function(){
>>       // your binding code goes here
>> });
>> 
>> Best I can do from the couch at 2130 on NYE ;-)
>> 
>> Cheers
>> Steve
>> 
>> Steve Winter
>> steve at bluecrocodile.co.nz
>> +44 777 852 4776
>> 
>>> On 31 Dec 2015, at 20:44, Bob Patin <bob at patin.com> wrote:
>>> 
>>> Hey Steve,
>>> 
>>> That’s what I was thinking it was… question: if I have a load() call, how do I make it so that the next calls don’t happen until the load() finishes?
>>> 
>>> Can you show me a fast example of that? That’s exactly what I was thinking, but didn’t know how to write it…
>>> 
>>> Thanks,
>>> 
>>> B
>>> 
>>> 
>>>> On Dec 31, 2015, at 1:41 PM, Steve Winter <steve at bluecrocodile.co.nz> wrote:
>>>> 
>>>> When does the cancel button end up in the DOM...? Is it as the result of the first load of date.php...?
>>>> 
>>>> If so, try binding to the cancel as a callback on that load - chances are that at the point at which the bind is being called the second Ajax request hasn't completed so it fails to bind correctly.
>>> 
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20151231/fb3c1ad2/attachment.html


More information about the FX.php_List mailing list