Bhushan
Bhushan

Reputation: 6181

refresh page without refreshing the iframe

I have a jsp file in which I am showing external page at the top of the page (using iframe) & other part is the output of html code written in the jsp file.

HTML Code looks like:

<body>
    <iframe src="http://www.example.com"
            width="100%" 
            height="60" 
            style="border: none;"
            id="ifrm">
    </iframe>
    <table>.....</table>
    <table>.....</table>
</body>

Now I want to refresh page programmatically without refreshing the iframe.

My question is that Can I refresh page without refreshing the iframe?

Answers/hints will be appreciated.

Upvotes: 0

Views: 1819

Answers (1)

Santosh
Santosh

Reputation: 17913

The iframe is embedded in the the main HMTL page (or the the JSP). So if page is refreshed, the iframe is going to be loaded again for sure.

To avoid that, I can think of following two options:

  1. Use AJAX to populate the remaining content of the page. This will involve making Ajax Call and rendering the contents (<table>..</table> etc.)again.

  2. Easier option: put the remaining content in another iframe. This will involve creating another JSP page for the remaining content.

Upvotes: 1

Related Questions