How do you open a URL in a dialog box JQUERY UI

前端 未结 4 1467
情书的邮戳
情书的邮戳 2020-12-17 00:52

I\'ve been looking for a simple solution for quite some time. I want a page (for example http://www.google.com) to be displayed in a JQuery UI Dialog window. The plan is to

4条回答
  •  生来不讨喜
    2020-12-17 01:00

    This might help.. Here what i am doing is i am hovering on a link and the url is opening in a dialog box.. You should use class instead of id if multiple same tags are getting created dynamically..ohterwise it will work for only single id.

    $('.openwindow').click(function(){
    var $this=$(this);
             $.ajax({
                    url: $this.attr('href');//You got the link here
                    success: function(data) {
                        //show the dialog here..
                        //"data" contains the html returned by the url
                    },
                    error: function(jqXHR){
                        //Do something here
                    }
                  });
            });
    

提交回复
热议问题