[jQuery] Re: Oddity with Jquery and Adobe AIR
Ah... That makes perfect sense then. In that case, I believe that AIR has trouble (or might not be able to) read externally loaded Javascript. It's a sandboxing issue: http://labs.adobe.com/wiki/index.php/AIR:HTML_Security_FAQ#So_what_does_this _new_security_model_look_like.3F -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gecko68 Sent: Thursday, September 11, 2008 8:16 PM To: jQuery (English) Subject: [jQuery] Re: Oddity with Jquery and Adobe AIR Yes the click event works. But it will require a lot more programming since the HTML being added is generated via Ajax. I guess I could bring the data in via json and assemble the HTML objects from within the original script. I am curious why it works in safari but not webkit/air. Thanks for the assist. On Sep 11, 4:40 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Why are you using onclick attributes? jQuery supports the click event > natively (which also works in AIR apps: > > Looks like for your HTML the jQuery might be this: > > $('span.pageName a').click(function(){ > // do something here > > }); > > This has the added benefit of cleaning up your HTML and making it far > easier to read. > > andy matthews > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] > On > > Behalf Of gecko68 > Sent: Thursday, September 11, 2008 1:45 PM > To: jQuery (English) > Subject: [jQuery] Oddity with Jquery and Adobe AIR > > I am trying to append some HTML to an object. It includes href's and > onclick events, but for some reason in AIR the onclicks don't seem to fire. > > var pageName = 'text'; > var x = 1; > var newPageData = " class='pageName'>"+pageName+"" + " onclick='alert("+x+");'> class='mini-icon'>" > + > "Check > me div>"; > > $('.scrollContainer').append(newPageData); > > It all appears fine, but when I click the icon, nothing happens. I > have tested this script in FireFox and Opera with no problems. > > Any help would be appreciated. > Dan
[jQuery] Re: Oddity with Jquery and Adobe AIR
Yes the click event works. But it will require a lot more programming since the HTML being added is generated via Ajax. I guess I could bring the data in via json and assemble the HTML objects from within the original script. I am curious why it works in safari but not webkit/air. Thanks for the assist. On Sep 11, 4:40 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Why are you using onclick attributes? jQuery supports the click event > natively (which also works in AIR apps: > > Looks like for your HTML the jQuery might be this: > > $('span.pageName a').click(function(){ > // do something here > > }); > > This has the added benefit of cleaning up your HTML and making it far easier > to read. > > andy matthews > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of gecko68 > Sent: Thursday, September 11, 2008 1:45 PM > To: jQuery (English) > Subject: [jQuery] Oddity with Jquery and Adobe AIR > > I am trying to append some HTML to an object. It includes href's and onclick > events, but for some reason in AIR the onclicks don't seem to fire. > > var pageName = 'text'; > var x = 1; > var newPageData = " class='pageName'>"+pageName+"" + " onclick='alert("+x+");'> class='mini-icon'>" > + > "Check me div>"; > > $('.scrollContainer').append(newPageData); > > It all appears fine, but when I click the icon, nothing happens. I have > tested this script in FireFox and Opera with no problems. > > Any help would be appreciated. > Dan
[jQuery] Re: Oddity with Jquery and Adobe AIR
Why are you using onclick attributes? jQuery supports the click event natively (which also works in AIR apps: Looks like for your HTML the jQuery might be this: $('span.pageName a').click(function(){ // do something here }); This has the added benefit of cleaning up your HTML and making it far easier to read. andy matthews -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gecko68 Sent: Thursday, September 11, 2008 1:45 PM To: jQuery (English) Subject: [jQuery] Oddity with Jquery and Adobe AIR I am trying to append some HTML to an object. It includes href's and onclick events, but for some reason in AIR the onclicks don't seem to fire. var pageName = 'text'; var x = 1; var newPageData = ""+pageName+"" + "" + "Check me"; $('.scrollContainer').append(newPageData); It all appears fine, but when I click the icon, nothing happens. I have tested this script in FireFox and Opera with no problems. Any help would be appreciated. Dan