jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Loading the content of a window/popup into an IFRAME?
This topic contains 6 replies, has 2 voices, and was last updated by Lucian 10 years, 11 months ago.
-
Author
-
Hi,
Not sure if has been asked before…
Is it possible to load a web page into a window — specifying an url as a parameter and using an IFRAME as a container?Thx
- This topic was modified 10 years, 11 months ago by admin. Reason: Moderated according to the Forum Policy: http://www.jqwidgets.com/community/topic/welcome-to-jqwidgets-forum/
Hello Lucian,
Yes, it is possible to have an iframe as a jqxWindow’s content.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/That’s what I have expected indeed, although it’s not obvious in the source code.
I have a hunch how that might be possible but it’s better to ask for a POC. 🙂
If you could share a link to a demo would be great.Thanks
Hi Lucian,
Here is an example on the matter:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>jQuery Window CSS Styling Sample</title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.summer.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.8.2.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#jqxwindow").jqxWindow({ height: 500, width: 500, theme: 'summer' }); $("#jqxwindow").jqxWindow('setContent', '<iframe src="http://www.jqwidgets.com/" width="100%" height="100%"></iframe>'); }); </script></head><body> <div id='jqxwindow'> <div> Header</div> <div id='content'> </div> </div></body></html>
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I thought so, but I wasn’t sure about how to call setContent. Let’s say I’ve seen something like this before in the jQuery world. 🙂
Next… can we use the property initContent to achieve the same thing? How?Now.. I have to mention a little something I found awkward.
I hope you’re already addressing the way jqx api is called and work towards offering to developers a simple unified way of doing it.
What I mean is sometimes we’re supposed to call a method like this: $(“#jqxwindow”).jqxWindow(‘setContent’, ‘abc’);
while in other cases we should be using this syntax: $(‘#tab’).jqxTabs().show();
Why is that? 🙂Hi Lucian,
For this purpose, initContent would not be apropriate. Use the setContent method instead.
As for your second question, the following is an incorrect expression:
$(‘#tab’).jqxTabs().show();
show() is a base jQuery method and to call it you need only a selector, i.e.:
$("#tab").show();
jQWidgets methods, on the other hand, are called this way:
$(“#jqxwindow”).jqxWindow(‘setContent’, ‘abc’);
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/That’s one mystery less.
Very much appreciated,
Lucian -
AuthorPosts
You must be logged in to reply to this topic.