p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Databases (http://p2p.wrox.com/forumdisplay.php?f=62)
-   -   Problems with loading external pics into an IFrame (http://p2p.wrox.com/showthread.php?t=28553)

nancy April 25th, 2005 12:20 PM

Problems with loading external pics into an IFrame
 
Hello,
While I searched your site to find the solution to my problem, I haven't found any, which prompted me to email you with the issue at hand:
Brief: I have an employee directory that is loaded into a table (dynamically). I also have a picture stored in a folder (same root) that with FSO will "push" a camera icon to link to that employee's picture, if there is a picture. So far, so good.

On the page with the dynamic table I also have a Floating <Iframe> with images of all employees scrolling side to side (Slide show effect)

When the end-user clicks on the camera icon (in the dynamic table) that employees pic should replace the slideshow but instead the picture relaces the whole page instead of loading into the IFRAME. ?!

Here's the chunk of code that calls the Floating IFrame:

var iframetag='<iframe id="masterdiv" name="masterdiv" src="../people.htm" width="101px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no" style="position: absolute; left: -500px; top: -500px; border:8px solid #336699;"></iframe>'


Here's the code calling the camera icon (if there is a corresponding picture in the image folder)

 <%
  If (fso.FileExists(strpath)) Then%>
  <a href="<%=PICurl%>" OnClick="javascript:changePic()" class="docs"><img src="../img/EMPpic.jpg" border="0"></a>
   <%
 Else
  response.write("<P class=""dir"">n/a</P>")
 End If
 %>

And here's my changePic function:

<script>
function changePic(){
window.frames['masterdiv'].window.location.replace()
}
</script>


Please help??

Thank you,
nancy

Prashant.k.m April 26th, 2005 01:42 AM

Quote:

quote:
window.frames['masterdiv'].window.location.replace()

The problem is you are replacing the window content.

Change window to Document

Code:

window.frames['masterdiv'].document.location.replace()

nancy April 26th, 2005 10:33 AM

I copied your code and when the camera icon is clicked the picture still replaces the whole page ???

Any clue why?

Thank you,
nancy


All times are GMT -4. The time now is 05:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.