Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call and open modal by function #225

Closed
bitpaydotir opened this issue Jun 13, 2018 · 2 comments
Closed

call and open modal by function #225

bitpaydotir opened this issue Jun 13, 2018 · 2 comments

Comments

@bitpaydotir
Copy link

bitpaydotir commented Jun 13, 2018

can open modal by function?

function showIp(url, userId)
    {
      //event.preventDefault();
      //this.blur(); // Manually remove focus from clicked link.
      $.get(url, function(html) {
        $(html).appendTo('body').modal();

      });
    }

i need pass data through "onClick" and get result via "ajax"(i wrote this but not worked):
<a href="#" id="showIp" onClick="showIp('url.html', 1)">test</a>

please help

@gorillamoe
Copy link
Collaborator

Can you try this, please?

function showIp(url, userId) {
        $.get(url, function(html) {
                $('<div/>').append(html).appendTo('body').modal();
        });
}

See demo link

@bitpaydotir
Copy link
Author

bitpaydotir commented Jun 13, 2018

it's worked, but loading image is not show :(
thanks

@kylefox kylefox closed this as completed Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants