Solved

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

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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…

706 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

19 Experts available now in Live!

Get 1:1 Help Now