The image verification code you entered is incorrect.

Javascript: Open a custom new browser window within your html code

Whatz up Andre!


1) The JavaScript function to open a new browser (remember this is also called a popup...many tools will block it) is:
window.open("URL","Name","Optional_Windows_Attributes")

With:
URL(required): URL to the target.
Can be a relative path like myGreatPageName.htm or absolute http://www.sitebuddy.com
Name(optional): is the name of the new windows, it can be empty: ""
Optional_Windows_Attributes(optional): a comma separated list of Window properties/attributes.

The Windows attributes can be any of:
width: in pixel example, width=500
height:  in pixel example, height=400
left: in pixel offset from the left side of the screen, example left=100
top: in pixel offset from the top of the screen, example top=100
toolbar: 0 or 1 to indicate if the new window should have the toolbar (back, forward ...)
location:  0 or 1 to indicate if the new window should have the location bar (where you enter URLs ...)
directories: 0 or 1 to indicate if the new window the should have the "bookmars, what's new..." bar
status
:  0 or 1 to indicate if the new window should have the status bar (the bar at the bottom of the browser...)
scrollbars:  0 or 1 to indicate if the new window should have the scrollbars
resizable:  0 or 1 to indicate if the new window should be resizable
menubar:  0 or 1 to indicate if the new window should have menus
titlebar:  0 or 1 to indicate if the new window should a title bar
fullscreen:   0 or 1 to indicate if the new window should use the full screen

2) Now define a JavaScript function:
Note you could skip this step and call directly the "window.open" function, within the HTML (see example later).

<script>
function loadwindow(){
window.open("http://www.sitebuddy.com/view/MySQL","","width=500,height=400,status=1")
}
</script>

3) Now how to call your JavaScript function:

<form><input type="button" onClick="loadwindow()" value="Load Window"></form>

or:

<a href="" onclick="loadwindow()">Sitebuddy.com rocks>Sitebuddy.com rocks</a>

Sitebuddy.com rocks

or:

<a href="javascript:void(0)" onclick="javascript:window.open('http://www.sitebuddy.com/view/MySQL','MyWindow','width=500,height=400,status=0,toolbar=0, location=0,resizable=0,menubar=0,titlebar=0'); return true;">Sitebuddy.com check out those MySQL article, they rock</a>

Sitebuddy.com check out those MySQL article, they rock



Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
More information about formatting options Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.