JavaScript popup window

preview_player
Показать описание
Link for all dot net and sql server video tutorial playlists

Link for slides, code samples and text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

In this video we will discuss, how to open a popup window using JavaScript.

URL - URL of the page to open. If URL is not specified, a new window with about:blank is opened
name - Specifies the target attribute or the name of the window.
_blank - URL is loaded into a new window. This is the default value if not specified.
_parent - URL is loaded into the parent frame
_self - URL replaces the current page
_top - URL replaces any framesets that may be loaded
name - name of the window
features - Must be a comma-separated list. Some of the browsers does not support these features.
menubar (yes/no) - Shows or hides the browser menu
toolbar (yes/no) - Shows or hides the browser navigation bar
location (yes/no) - Shows or hides the address field
status (yes/no) - Shows or hides the status bar
resizable (yes/no) - Whether or not the window is resizable
scrollbars (yes/no) - Whether or not to display scroll bars
top(pixels) - The top position of the window
left(pixels) - The left position of the window
height (pixels) - The height of the new window
width (pixels) - The width of the new window

replace - Specifies whether the URL creates a new entry or replaces the current entry in the browser history. Works only if the url is loaded into the same window.
true - URL replaces the current document in the browser history list
false - URL creates a new entry in the browser history list

Most modern browsers open new tabs instead of separate windows. If you want to open the popup in a new window, one workaround I have found is to specify the URL, name, and features(height and width) parameters. This may not work in all browsers and it also depends on user's browser preferences.

When name parameter is set to _self, the new window replaces the current window

Specify where you want the new popup window to be positioned using top and left features.

Disable scrollbars and resizing. Works in IE but not in Chrome.

[input type="button" value="Open popup" onclick="openPopup()" /]
[input type="button" value="Close popup" onclick="closePopup()" /]
[script type="text/javascript"]
var popup;
function openPopup()
{
}

function closePopup()
{
}
[/script]
Рекомендации по теме
Комментарии
Автор

I searched many times for popup stuffs nd sir u are great..u explained us so well thanks sir u are awesome

UnboxTheBox
Автор

Very interesting! I am trying to open the video on the same page however, not in a new window or tab. I am actually trying to open up in a different box, but this is still closer than what I had before thank you.

jonathanhammond
Автор

so deep understanding of knowledge.I wonder how..

iqbaljournals
Автор

Wonderful way of teaching. Thanks for all this.

yudhveersingh
Автор

i was so sure you were maybe russian or something, but when i saw google redirecting to co.uk i was kinda astonished! heheh! anyway thank you for this informational video. i love it <3

NcroGaming
Автор

This is what i was looking for. Thank you so much🙂

vishwaschaudhary
Автор

Thank you sir for  such a great and clear video 

Endless_Tails
Автор

hello kudvenkat ..hey nice explaination.
you are from Uk..

iqbaljournals
Автор

Thanks for your guidance. i have one question and i.e how to minimize window by scripting ? like close.... Could you please let me know ?

umeshbelge
Автор

Hey kudvenkat  I have some issues with my popup.
When it opens, is in the center top of the screen, and I want it in the middle of the screen. Also It's not working the Rezisable attribute. I'm always using chrome.

rresttringiddo
Автор

great video! Can I ask how someone could activate the pop up window from just plain text on the webpage rather then from a button?

foggymedia
Автор

how to bind pop up's data into mail page text box's like if i select 'A' from pop up which is define in li (list), how it will come into main page textbox??

rashmisinghcsr
Автор

Hello Venkat, is there anyway to make the popup modal?

ConaxHateGG
Автор

popup.close() is not working..Any work around for this?

kalasrujana
Автор

Hi, I have a doubt. I have a requirement where I want my html file to open in chrome. But chrome is not my default browser. Is it possible to do this dynamically using JavaScript

gameanand
Автор

Kudvenkat ..what if I want to put image not open popup word then what coding I need to use? any help?

shopbuzz
Автор

Hi there i need to have child window on the left while i still use parent window entries and still child window to be top left without dissaprearing, please let me know the script. thank you

iamceylon
Автор

What can be the code to open a normal window from a popup, specifically for chrome browser? Please help.

SIngleManish
Автор

Hi, can you please explain how to disable the address bar in pop up window using Java script. I have tried with location=0 attribute. but its not working in IE. Please explain how to

amalags
Автор

How to run window pop automatically in a specific website??

subhasjha