开发者

How do i Open a page in a dialog box using jQuery?

I need to open the login.aspx page in a dialog box when the user clicks the 'login' link. I've looked at jQuery UI Dialog, but it looks like it can't open whole pages 开发者_如何学Cfrom a given URL?

Do you guys have any tips to what I can use?


You can just create an <iframe> and .dialog() it to get what you're after, short a simple. Elijah Manor has a full post with code on how to do this.

Here's a quick version:

$('<iframe src="login.aspx" />').dialog({
   title: 'Login',
   width: 600,
   height: 400,
   modal: true,
}).width(570).height(370); //give it a bit of padding


Use an <iframe>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜