473,386 Members | 1,827 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.

new window problem

2
i have the following code ..witch will change the background off my page from files on my computer..but it opens a new window to do it .
Can it be made to change the background on the same window ??

<HTML>
<HEAD>
<TITLE> New Document </TITLE>

<script>
function display_image(image) {
myWindow = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menub ar=0,scrollbars=0,resizable=1,copyhistory=0,width= 1024,height=768,target=_parent" );
myWindow.document.open();

myWindow.document.write("</HEAD><BODY BACKGROUND=" + image + "><center><br><br><br>");
}
</script>

</HEAD>
<link href="style.css" rel="stylesheet" type="text/css" />
<center>
<BODY>
<table border="2" width="100%" height="100%">
<tr><td>
<form>
<p><input type="file" name="url"><br>
<input TYPE="button" VALUE="Wallpaper"
onClick="display_image(&quot;file:///&quot;+document.forms[0].url.value)"> </p>
</form>

</td>
</tr>
</table>
</BODY>
</center>
</HTML>
Mar 9 '08 #1
3 1005
hsriat
1,654 Expert 1GB
Here is a good example which can help you.
Mar 9 '08 #2
nameno
2
thanks ..managed to make it open in the same page ,but now i have another problem..

is there a way to strech the images automaticly according to the table size ?/?
Mar 9 '08 #3
hsriat
1,654 Expert 1GB
thanks ..managed to make it open in the same page ,but now i have another problem..

is there a way to strech the images automaticly according to the table size ?/?
I think you may not do that with background image. But with the <img>, you can do that by changing its width attribute
Mar 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
2
by: Charles Packer | last post by:
From one of the online Javascript tutorials, I learned how to open a new window and set its size. I'm building a page that has several small photographs, and I want to let the viewer examine...
2
by: Randell D. | last post by:
HELP! Its taken me ages - I'm a newbie and I've compiled bits of code that I've read in this newsgroup over time to create one of my most intricate functions to date... Basically, the script...
4
by: Phillip Parr | last post by:
Hello, I have a nice system where someone clicks on a picture to show the full version. This pops up in a window.open box. It works great, the only problem is that if the user clicks a second...
4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
1
by: MrFez | last post by:
I have an webform from which I open a child window to display a calendar. When a date is selected in the calendar window it attempts to set the value of a textbox in the main (parent) window by...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
7
by: multicherry | last post by:
Hi, Having searched for a way to fetch a window object by name, all I came across were answers along the line of... "All you have to do is say windowObj = window.open("blah", "name");" which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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,...

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.