Solved

Hidden iframe/ajax to refresh portion of a page linked to the database

Posted on 2007-03-22
3
334 Views
Last Modified: 2011-10-03
I am using a hidden iframe to upload file in php which seems to be working. However, my problem now is to refresh a portion of the page without refreshing the entire page. Now, for this portion I have included a file which pulls records from the database.  I was thinking of using a div and refreshing that div(with the hidden iframe to do the server stuffs)  but not sure as to how to do this. Can anyone help me out. Its urgent and your help will be highly appreciated.
0
Comment
Question by:Sid123
  • 2
3 Comments
 
LVL 3

Expert Comment

by:exoska
ID: 18776045
well
if the layer to be updated is an include file,

foa, at the father page isolate your content to be updated via a div like you said
<div id=tobeupdated>
<?include("hereisthefileofdb.php;?>
</div>


after the iframe finishes the job,
let it include the file like this; ( in the iframe, finished and submitted page )

<div id=upps>
<?include("hereisthefileofdb.php;?>
</div>
<script>
document.body.onload=function(){
   window.parent.document.getElementById('tobeupdated').innerHTML = document.getElementById('upps').innerHTML;
}
</script>




try this,
if there s some syntax typo, sorry :)
0
 

Author Comment

by:Sid123
ID: 18778308
Hi,
   Thanks for the solution and it does work in IE but not in Mozilla. Do you have any idea on this one?
0
 
LVL 3

Accepted Solution

by:
exoska earned 250 total points
ID: 18778836
try this script buddy

<script>
window.onload=function(){
   window.parent.document.getElementById('tobeupdated').innerHTML = document.getElementById('upps').innerHTML;
}
</script>
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question