?
Solved

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

Posted on 2007-03-22
3
Medium Priority
?
350 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 1000 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

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
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…
Suggested Courses

765 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