Solved

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

Posted on 2007-03-22
3
326 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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.

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now