Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Difference between RegisterStartUpScript and RegisterClientScriptBlock ?

RegisterStartUpScript
This adds the javascript code at the end of the page before the closing of form tag.

RegisterClientScriptBlock
This adds the javascript code at the top of the page.

State various attributes of window.open ?

 
Various Window attributes are listed below :
  1. channelmode - Specifies if window should be opened in channel mode. IE only.
  2. fullscreen - Specifies if window should be opened in full screen mode. IE only.
  3. height - Specifies the height of the window.
  4. left - Specifies the x coordinates of the window in pixels. IE only. See "screenX" as well.
  5. location - Specifies if the location bar of the window should be included.
  6. menubar - Specifies if the menu bar of the window should be included.
  7. resizable - Specifies if window should be resizable.
  8. screenX - Specifies the x coordinates of the window in pixels. NS only. See "left" as well.
  9. screenY - Specifies the x coordinates of the window in pixels. NS only. See "top" as well.
  10. scrollbars - Specifies if window should contain scrollbars.
  11. status - Specifies if the status bar of the window should be included.
  12. toolbar - Specifies if the toolbar of the window (ie: reload button) should be included.
  13. top - Specifies the y coordinates of the window in pixels. IE only. See "screenY" as well.
  14. width - Specifies the width of the window.

What are different parameters to window.open ?

Different parameters of window.open are :
  1. URL - Specifies url of page to open
  2. Name - Assigns a target name to the newly opened window.
  3. Attributes - Controls the look of the opened window
window.open("URL","Name","Attributes");

Example :

window.open('www.google.com','win1','width=300,height=200,menubar');

How to open pop up window using javascript ?

window.open

How to redirect a page using JavaScript ?

Use window.location i.e window.location="http://www.redirectpage.com/redirect.html";

Popular Posts