Working example of reveal loading data from a url?

Hello all,

have been using the latest foundation.

The reveal docs and video’s do not give me the details and I need to get this working.

The version 5 docs show an example I want:

<button data-reveal-id="myModal" data-reveal-ajax="http://some-url">
    Click Me For A Modal
</button>

<a href="http://some-url" data-reveal-id="myModal" data-reveal-ajax="true">
    Click Me For A Modal
</a>

And a working example I found has the url in the reveal div, I want to pass the url into the reveal.

Anybody got a dead simple example?

This would be much appreciated

Regards,

Gerrit Kuilder

do you have the correct JS libraries loaded?

Yes, everything is working fine, no error messages, reveal works, but I can’t pass it a URL to load, all the samples and examples and documentation I have seen say it should be possible. But all the examples I have seen have the url in the reveal itself but I want to pass the url from the link where I open the reveal.

Ok,

bit of hack but it works for me:


    $(".openreveal").on('click', function (event) {
      var $reveallink = $(this);
      var $modal = $('#exampleModal1');
      //var $modal = $reveallink.data("reveal-open");
      var ajax_url = $reveallink.data("ajax");
      $
        .ajax(ajax_url)
        .done(function (resp) {
          $modal
            .html(resp)
            .foundation('open');
        });
    });

And the links, button and

 <button class="button openreveal" data-reveal-open="#exampleModal1" data-ajax="/player/reveal">Click me for a modal</button>
<a class="openreveal" data-reveal-open="#exampleModal1" data-ajax="/player/reveal">

As you can see I hardcoded the reveal, when I tried to use the reveal-open value it did not work for me.

Hope this helps someone.

Regards,

Gerrit

dang, the close button does not work…