Solved

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

Posted on 2007-03-22
3
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

739 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