473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Is there a better way then iframe?

There has got to be a better way to do this instead of using the iframe
tag. I am looking for a solution that doesn't reload the entire page.
There will much more than the select tag on the initial page.

When it is in production, getimage.asp will have a DB lookup to
determine the file name and imageID will actually be a number (not the
filename).

Also it doesn't seem to work in Firefox.

Thanks
Brian

------------------------------------

<html>
<head>
<title>Image Test</title>
<script language="JavaScript">
function getImageList()
{
imageID =
document.form1.imageID.options[document.form1.imageID.selectedIndex].value;
document.frmRemote.location = "getImage.asp?imageID="+imageID
}
</script>
</head>
<body>
<table height=10>
<tr>
<td>
<form name="form1">
<select name="imageID" size="1" style="width:135px;"
onChange="getImageList();">
<option value="">Image ...</option>
<option value="external.jpg">1</option>
<option value="getacro.gif">2</option>
<option value="go.gif">3</option>
</select>
</form>
</td>
<td>
<iframe name="frmRemote" scrolling="no" id="frmRemote"
height="25"></iframe>
</td
</tr>
</table>
</body>
</html>

[getImage.asp]
<%@ Language=VBScript %>
<%imageID = trim(Request("imageID"))%>
<html>
<head>
</head>
<body leftmargin="0" topmargin="0">
<%if not imageID = "" then%>
<img src="/images/<%=imageID%>"></img>
<%end if%>
</body>
</html>

Jul 25 '06 #1
3 1244
You could do this à la AJAX. See http://en.wikipedia.org/wiki/AJAX and in
particular http://en.wikipedia.org/wiki/XMLHttpRequest

--
Patrice

"Brian D" <bd*******@yahoo.coma écrit dans le message de news:
11**********************@p79g2000cwp.googlegroups. com...
There has got to be a better way to do this instead of using the iframe
tag. I am looking for a solution that doesn't reload the entire page.
There will much more than the select tag on the initial page.

When it is in production, getimage.asp will have a DB lookup to
determine the file name and imageID will actually be a number (not the
filename).

Also it doesn't seem to work in Firefox.

Thanks
Brian

------------------------------------

<html>
<head>
<title>Image Test</title>
<script language="JavaScript">
function getImageList()
{
imageID =
document.form1.imageID.options[document.form1.imageID.selectedIndex].value;
document.frmRemote.location = "getImage.asp?imageID="+imageID
}
</script>
</head>
<body>
<table height=10>
<tr>
<td>
<form name="form1">
<select name="imageID" size="1" style="width:135px;"
onChange="getImageList();">
<option value="">Image ...</option>
<option value="external.jpg">1</option>
<option value="getacro.gif">2</option>
<option value="go.gif">3</option>
</select>
</form>
</td>
<td>
<iframe name="frmRemote" scrolling="no" id="frmRemote"
height="25"></iframe>
</td
</tr>
</table>
</body>
</html>

[getImage.asp]
<%@ Language=VBScript %>
<%imageID = trim(Request("imageID"))%>
<html>
<head>
</head>
<body leftmargin="0" topmargin="0">
<%if not imageID = "" then%>
<img src="/images/<%=imageID%>"></img>
<%end if%>
</body>
</html>

Jul 25 '06 #2
Patrice,

Thanks for the quick response. I should have thought about it for 5
more minutes though. This is what I came up with instead:

<html>
<head>
<title>Image Test</title>
<script language="JavaScript">
function getImageList()
{
if (!document.images)
return
document.images.image.src='/images/'+document.form1.imageID.options[document.form1.imageID.selectedIndex].value
}
</script>
</head>
<body>
<form name="form1">
<table>
<tr>
<td>
<select name="imageID" size="1" style="width:135px;"
onChange="getImageList();">
<option value="" selected>Image ...</option>
<option value="external.jpg">1</option>
<option value="getacro.gif">2</option>
<option value="go.gif">3</option>
</select>
</td>
<td>
<img src="/images/space.gif" name="image"></img>
</td>
</tr>
</table>
</form>
</body>
</html>

Jul 25 '06 #3
Great it's solved.

Next time, please be explicit about the exact problem you are trying to
solve (my understanding was that you wanted later to refresh a whole lot of
things, not just an image, I understand now that you wanted to refresh just
the image, saying that you want to refresh the image because you'll have
much more information on the page later (those information won't be
refreshed)).

TIA

--

Patrice

"Brian D" <bd*******@yahoo.coma écrit dans le message de news:
11*********************@h48g2000cwc.googlegroups.c om...
Patrice,

Thanks for the quick response. I should have thought about it for 5
more minutes though. This is what I came up with instead:

<html>
<head>
<title>Image Test</title>
<script language="JavaScript">
function getImageList()
{
if (!document.images)
return
document.images.image.src='/images/'+document.form1.imageID.options[document.form1.imageID.selectedIndex].value
}
</script>
</head>
<body>
<form name="form1">
<table>
<tr>
<td>
<select name="imageID" size="1" style="width:135px;"
onChange="getImageList();">
<option value="" selected>Image ...</option>
<option value="external.jpg">1</option>
<option value="getacro.gif">2</option>
<option value="go.gif">3</option>
</select>
</td>
<td>
<img src="/images/space.gif" name="image"></img>
</td>
</tr>
</table>
</form>
</body>
</html>

Jul 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Csaba2000 | last post by:
I want to be able to embed a single quote into an INPUT element within a dynamically generated IFRAME. The example below shows how the IFRAME is generated. Challenge: I'd like the alert box to...
7
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+...
0
by: Martin | last post by:
I understand that as of IE5.5 iframes respect the z-index style property. However I have noticed some odd behaviour when the iframe's src is set to an MHT web archive instead of an HTML file. ...
3
by: Richard | last post by:
in a previous aspx page i got a few records printed throu window.print() function in javascript. but now i have the records in a to RTF and i want to run the same function print, which ofcourse...
1
by: Ryan Ternier | last post by:
I'm using an iFrame in our application to show a screen. This screen is a regular screen, but when passed a few parameters, it turns off all the headings / logo's so it can be used inside a...
1
by: jaktharkhan | last post by:
Hi, I really really need help in trying to figure out how can I do a CloneNode on an Iframe where the cloned IFRAME clones with all its contents?. Basically what I am doing is dynamically building...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
1
by: Z1P2 | last post by:
I would like to gradually resize an iframe in an onmouseover event. I can easily do it with an image, but when I try to do it with an iframe, it doesn't do anything. So first of all, is it possible...
1
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.