jQTouch icon indicating copy to clipboard operation
jQTouch copied to clipboard

Selecting items with jQuery on new AJAX loaded pages

Open fidoboy opened this issue 12 years ago • 1 comments

Ok, what i'm trying is to use my own functions from a .js script that it's loaded at the top level page, that is, the index page. That script remains loaded all the time when i'm browsing the pages. The pages loaded using AJAX sometimes are very simmilar and they contains elements with dublicated IDs so, to solve this issue i use jQuery(jQT.hist[0].hash + ' #myidentifier') to select them. I've though that adding the current page hash makes them unique and it works on the first loaded page, but then when loading more pages the function stops locating the elements and returns null values, i'm not sure why, but i suspect that has something to do with DOM refresh and changes not being loaded, cause the selected item (jQT.hist[0].hash + ' #myidentifier') exists and it's loaded but the selector returns no results. Can anyone help with this? What i'm doing wrong? How can i make a generic funcion to be used from any loaded page and being capable to locate the loaded elements??

Many thanks in advance, i hope that my question was clear and you got the idea...

fidoboy avatar Mar 16 '12 14:03 fidoboy

It seems AJAX calls are problem of Beta4.

See some of the issues, it seems all have from with AJAX.

ns-1m avatar Mar 29 '12 03:03 ns-1m