A page is displayed in a div

Source: Internet
Author: User

Text: A page is displayed in a div

1.<iframe> method

2.ajax method

ajax+ stream implementation without frame limit block refresh:

Main Frame Index page:

Js:

$ (function () {
$ ("#dialog"). Dialog ({
width:500,
height:550
});
$ ("#dialog"). OpenDialog ();
$ ("#dialog"). Hide ();   
});

Html:
< div id= "dialog" >
</div>

Child frames page:
Js:

function Opendia () {
var querystr={
id:$ ( ' #id '). Val ()
   };
$.get ("itemplot.asp", querystr,function (data ) {
/ / Gets the div object on the main frame
var index_dialog=window.parent.parent.$ (" #dialog");
/ / fill in the HTML text stream fetched by the AJAX submission page into the main frame div
index_dialog.html (data);
/ /make its gradient Display
index_dialog.fadein ( );
//ok
   });
}

Data source page:

Note that the head and title tags are removed from the jquery request page.

When you add the Close button, be careful not to window.close (), just empty the div and hide it. :
Function Diaclose () {
var index_dialog=window.parent.parent.$ ("#dialog");
Index_dialog.empty ();
Index_dialog.fadeout ();
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.