473,388 Members | 1,201 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,388 software developers and data experts.

Give window title name

I was making an application in asp .net mostly with help from the asp.net forums and i am using javascript to open a popup in my gridview. I wanted to open a window with the title "MAIN TEST" how do i set the value of the title name ? i am guessing this is the syntax : window.name="main test"; but it doesnt seem to work, here is the script, any help would be appreciated.
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2.  function openNewWindow(URL)
  3.  {
  4.   day = new Date();
  5.   id = day.getTime();
  6.   window.name="main test";
  7.   eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width=500,height=600');");
  8.  }
  9. </script>
Thanks and regards in advance.
Sep 16 '07 #1
2 2385
5,821 Expert 4TB
Heya, dhaneshrs. Welcome (back) to TSDN!

Please use CODE tags when posting source code:

JavaScript code goes here.
Sep 16 '07 #2
5,390 Expert Mod 4TB
hi ...

don't use eval in your code ... except you have to eval things like json-data ... there is no need for eval besides that ... have a look at the following example that you may use for your problem:

Expand|Select|Wrap|Line Numbers
  1. window['page' + id] = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=no,location=no,statusbar=no  ,menubar=no,resizable=yes,width=500,height=600'); 
  3. window['page' + id].document.title = 'test';
kind regards

ps: and you may drop the window.name statement ... this simply creates a member variable 'name' for window, that is not used the way you want ...
Sep 16 '07 #3

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

Similar topics

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...
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it...
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
by: John Bokma | last post by:
I have two windows in a frame. I want to be able that each can open a pop up window and that the handle to that window can be stored somewhere, so that each can talk to the pop up. is it...
by: Peter Kirk | last post by:
Hi, I want to open a popup-window which displays a list to the user. From this list, the user can select an item, and the data regarding this item is then transferred to some fields on the main...
by: umashd | last post by:
Hi, I am doing a web based project for my graduation. I studied bit of java for backend processesing and javascript for the client. Here is the scenario. In the FORM, I use INPUT TYPE=text...
by: Daniel Morrissey | last post by:
Why will the following code not change the window title of the new window? window.open "Default.htm" ,"YO"
by: Tom Gur | last post by:
Hi, I was wondering how do I get control over a window (Win32). to be more specific, I need to find a handle to a window of a certain program and minimize the window.
by: yuenli | last post by:
Hi! I am facing a problem here. I wish to open a sub window from another sub window which means when i click on the main parent window a small window will appear then when i click on the button on...
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,...
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...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...
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: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.