Hi Paul. Your JQuery integration with CF to load remote content looks like
very cool. Do you can share that script with us(CFers)?
I'm using wddxAjax to load remote content but with JQuery this could be fine
and fun! ;-)
Cheers
Marco Antonio C. Santos
2007/2/7, Paul <[EMAIL PROTECTED]>:
I think I already am, Andy. Here's my first few lines; do I need to do
something more? (And thanks, btw.)
$(function() {
/* Load the initial screen content */
$("#content").load("includes/sh4-welcome.cfm?nocache=
<cfoutput>#getTickCount()#</cfoutput>");
/* Assign the onclick event handler to all the images on
the keypad. */
$("#keypad img").click(function() {
...
------------------------------
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Andy Matthews
*Sent:* Wednesday, February 07, 2007 2:12 PM
*To:* 'jQuery Discussion.'
*Subject:* Re: [jQuery] jQuery operations on ajax data
You just have to reassign the function to the images after you load in
content.
------------------------------
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Paul
*Sent:* Wednesday, February 07, 2007 3:14 PM
*To:* 'jQuery Discussion.'
*Subject:* [jQuery] jQuery operations on ajax data
I'm using jQuery to assign a function to every image within a div on my
page:
$("#keypad img").click(function() { ...
It worked great, until I set about organizing the screens in my
single-page application. I want to load the content dynamically as a user
moves about the application, so I'm trying to initialize the first screen
like so:
$("#content").load("includes/sh4-welcome.cfm");
This renders the html properly, but it breaks the jQuery click function I
was assigning to the images. (The #keypad div is within the file being
loaded at runtime.) There aren't any JS errors, but nothing happens when I
click. If I remove the ajax call, and instead put the data back inline the
good old-fashioned way, the click functions work again.
Is there a rule I don't know about using jQuery functions on ajax-loaded
data?
-Paul
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/