Welcome Guest, Not a member yet? Register   Sign In
jQuery.Live
#1

[eluser]Philo01[/eluser]
Hi there! Smile

I'm working on a jQuery plugin for my application.
Somehow jQuery Live works for if I use it to check if a form is submitted:
Code:
$(o.submitForm).live("submit",function()

Now I also monitor a button using the following code:
Code:
$(this).click(function () {

This works, but I need it work after content is loaded via ajax.
Normally I would use the live method like this:

Code:
$(this).live("click",function() {

But somehow this is not working.
Does anyone know if this has to do because its written in a plugin?

Kind regards,

Philo


Edit
-----------

Somehow this works:

Code:
$('#user_list .edit').ajaxForms({
button:'#user_list .edit'
});

If I then call this config:

Code:
$(o.button).live("click",function() {

This is kinda wierd because "this" links to the same object as I defined manualy in the button config"#user_list .edit".
#2

[eluser]InsiteFX[/eluser]
$(document).ready( function() {


Enjoy
InsiteFX
#3

[eluser]Philo01[/eluser]
[quote author="InsiteFX" date="1260745609"]$(document).ready( function() {


Enjoy
InsiteFX[/quote]

Thanks but already had that around my code Wink
So that isn't the problem, thanks though.

Kind regards,

Philo
#4

[eluser]ggoforth[/eluser]
I'm not exactly sure about your problem, but from the documentation, "submit" is not a valid live event (yet). I hear in the newest version of jQuery it will be supported, but it's not currently showing on the website as being supported. Could this be why it's not working?

http://docs.jquery.com/Events/live




Theme © iAndrew 2016 - Forum software by © MyBB