Showing posts with label New. Show all posts
Showing posts with label New. Show all posts

How to open a new window with JavaScript

To open a new window, you will need to use yet another ready-made JavaScript function. Here is what it looks like:

window.open('url to open','window name','attribute1,attribute2')

This is the function that allows you to open a new browser window for the viewer to use. Note that all the names and attributes are separated with a comma rather than spaces. Here is what all the stuff inside is:

1. 'url to open'
This is the web address of the page you wish to appear in the new window.

2. 'window name'
You can name your window whatever you like, in case you need to make a reference to the window later.

3. 'attribute1,attribute2'
As with alot of other things, you have a choice of attributes you can adjust.

Window Attributes
Below is a list of the attributes you can use:

1. width=300Use this to define the width of the new window.
2.height=200Use this to define the height of the new window.
3. resizable=yes or noUse this to control whether or not you want the user to be able to resize the window.
4. scrollbars=yes or noThis lets you decide whether or not to have scrollbars on the window.
5. toolbar=yes or noWhether or not the new window should have the browser
navigation bar at the top (The back, foward, stop buttons..etc.).
6. location=yes or noWhether or not you wish to show the location box with the current url (The place to type http://address).
7. directories=yes or noWhether or not the window should show the extra buttons. (what's cool, personal buttons, etc...).
8. status=yes or noWhether or not to show the window status bar at the bottom of the window.
9. menubar=yes or noWhether or not to show the menus at the top of the window (File, Edit, etc...).
10. copyhistory=yes or noWhether or not to copy the old browser window's history list to the new window.


All right, here's an example code for opening a new window:

Moving MS SQL Databases To A New Location

Method 1
1. Create new MS SQL data location (E:\MSSQL\data\)
2. Stop MS SQL server
3. Move all databases to a new location (move *.mdf and *.ldf files)
4. Create junction link between old and new MS SQL data folders
5. Start MS SQL server
In case you have some databases with different from default locations, perform:
1. Detach these databases
2. Copy these databases from old location to a new location
3. Attach these databases from a new location

Method 2
1. Go to MS SQL Enterprise Manager
2. Choose the MS SQL server Properties option. For this, go to Expand SQL Server Group->MS SQL server





3. On the Database Settings tab, change New database location and set the path to:
Default data directory, i.e. a new logical disk (E:\MSSQL\DATA\)
Default log directory (E:\MSSQL\DATA\)






4. Create the following folder E:\MSSQL\DATA\
5. Set the same NTFS permissions as in the folder [drive]:\Program Files\Microsoft SQL\Server\MSSQL\DATA (the path where DB's are located ).
6. Go to MS SQL Enterprise Manager->Databases and right click on the Necessary database->All tasks->Detach Database with option Update statistics prior detach. Make sure to check database and database log files locations before detaching a database.




7. Go to [drive]:\Program Files\Microsoft SQL Server\MSSQL\DATA and copy Detached DB files (*.mdf and *.ldf) to a new folder E:\MSSQL\DATA\
8. Go to MS SQL Enterprise Manager->Databases and right click on Databases->Attach Database->.
9. Put the path to the necessary database (E:\MSSQL\DATA\) and select hsadmin in Specify database owner field.
10. Repeat steps 6-8 for the rest of databases.