Tuesday 15 May 2012

javascript - How to call a function to an element dynamically loaded by Ajax? -


I'm trying to use the Select jQuery plugin, but my content is loaded by Ajax, And I'm not getting it to work.

I am using Grails and I do not want to inline code, so I tried to load it with .on () jQuery method, but I could not get it later I do not want to put an incident, I want to load it when my content loads, and I can not find another solution

I am trying to do something like this: < P> My page calls a remote link:

  & lt; G: remoteLink controller = "strategy" action = "index" update = "content box" & gt; & Lt; / G: Rematilink & gt;   

Then, all my HTML selections have to be triggered by the plugin and provide the plugin from the general selection:

  $ (document) .on (' Click ',' selection ', function () {$ (select'). SelectBoxIt ()})   

But I do not want to trigger them with click event, Are called, then they should trigger right.

Since my content has not been added to my first page load, I thought that the .on () method was the right choice but it gives me an event, and when the page loads () < / P>

Thanks in advance.

Maybe reading this, and sorry, I can not help much.

No comments:

Post a Comment