admin管理员组

文章数量:1417070

I was wondering if there is a possibility to reinitialize foundation after the content was changed with ajax.

In my case I am trying to reinitialize foundations abide form validation on a form that is passed back from an ajax call.

I tried to just call $(document).foundation() which should reinit all the javascript ...

I was wondering if there is a possibility to reinitialize foundation after the content was changed with ajax.

In my case I am trying to reinitialize foundations abide form validation on a form that is passed back from an ajax call.

I tried to just call $(document).foundation() which should reinit all the javascript ...

Share Improve this question edited Nov 6, 2014 at 18:32 BenMorel 36.7k52 gold badges206 silver badges337 bronze badges asked Aug 23, 2013 at 21:19 Thomas VenturiniThomas Venturini 3,7505 gold badges36 silver badges47 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

nice, I found out how to reinitialize the abide validation on my form

just call

$(document).foundation('abide','events');

While this seems to still work for now in Foundation 5, there's an updated way to correctly do this in Foundation 5:

$('#yourFormID').foundation({bindings:'events'});

本文标签: javascriptzurb foundation and events on ajax loaded contentStack Overflow