Opening a new window with javascript - Posted (1993 Views)
Average Member
richfed
Posts: 999
999
In a particular instance, I am using javascript:openWindow5 to open a new window off the default.asp page. I am not too familiar with this, but I am thinking that the 5 is some sort of pre-set window. It works fine, except that there is no address bar with the back/forward/refresh, etc. buttons. How can I alter this so that a window opens "in full"?
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Senior Member
leatherlips
Posts: 1838
1838
There are several preset window types. You can change the window type if you wish but you should know that any other windows in the forum that use that preset will also be affected and may not have the results you want.
Instead, you may want to create a new window type and add it with the others. You will find them in inc_header.asp. Look for javascript:openWindow5 and you will find its presets. Copy and paste it at the bottom of the preset list and change the 5 to something different and then play with the presets until you have what you want. Be sure to change the 5 in the page that is using that preset so it will look at your new preset.
Posted
New Member
bobdsw
Posts: 62
62
If you're trying to just open up an entire new browser window, rather than a pop up you do not need JaveScript. You can use:
Code:
<a href="link" target="_blank">Link Name</a>

If you're trying to use a pop up you can search inc_header.asp for:
Code:
function openWindow5(url)
and in that function remove the 's' from toolbars - that syntax is incorrect:
Code:
...'width=450,height=525,scrollbars=yes,toolbars=yes,menubar=yes,resizable=yes'); if (window.focus){popupWin.focus();}}

The if statement we added at the end (in blue) sets focus to the pop up so that it doesn't get lost behind the main window. We had an instance where the user would be going back and forth quite a bit and if the pop up was left open it would just flash in the start menu and not actually get focus. We added this to all the OpenWindow functions in inc_header.asp




[image=left]http://knswebdesigns.net/common/images/phoenix-logo.png[/image=left]Phoenix! - Ful site integration, CSS driven & XHTML compliant, MooTools, TinyMCE editor for posts & custom content management, , Visual Theme Designer, custom menus & pages, member galleries with ASP JPeg and ASPResize, ASP WordPress style Blog, web friends, FaceBook, Twitter & other social-sharing integration, ReCaptcha & Anti-Spam Registration...and much more.
Posted
Average Member
richfed
Posts: 999
999
OK -- removing the s did show all the toolbars, EXCEPT the one with the address field in it, which is the one I want. Using IE8.
To be clear, how do I change the following code to simply open a new browser window?
" <a href=""javascript:openWindow5('links.asp')""><acronym title=""Web Links of interest ... add your own!"">Web Links</acronym></a>" & vbNewline & _
" |" & vbNewline & _
Posted
New Member
bobdsw
Posts: 62
62
add this bit in red in inc_header:
Code:
toolbar=yes,location=1
[image=left]http://knswebdesigns.net/common/images/phoenix-logo.png[/image=left]Phoenix! - Ful site integration, CSS driven & XHTML compliant, MooTools, TinyMCE editor for posts & custom content management, , Visual Theme Designer, custom menus & pages, member galleries with ASP JPeg and ASPResize, ASP WordPress style Blog, web friends, FaceBook, Twitter & other social-sharing integration, ReCaptcha & Anti-Spam Registration...and much more.
Posted
Senior Member
leatherlips
Posts: 1838
1838
You could do this:

Change the part in red:

Code:
" <a href=""javascript:openWindow5('links.asp')""><acronym title=""Web Links of interest ... add your own!"">Web Links</acronym></a>" & vbNewline & _
" |" & vbNewline & _

To:

Code:
" <a href=""links.asp"" target=""blank""><acronym title=""Web Links of interest ... add your own!"">Web Links</acronym></a>" & vbNewline & _
" |" & vbNewline & _
Posted
Average Member
richfed
Posts: 999
999
Originally posted by bobdsw
add this bit in red in inc_header:
Code:
toolbar=yes,location=1

Perfect! Thanks!
And, thank you, too, Leatherlips!
Posted
New Member
bobdsw
Posts: 62
62
My pleasure, glad to help... and I agree with Leatherlips original thought - I'm unsure what all calls openWindow5 - duplicating the entire function and renaming it openWindowX would ensure you aren't changing how the window pops up for other calls.
[image=left]http://knswebdesigns.net/common/images/phoenix-logo.png[/image=left]Phoenix! - Ful site integration, CSS driven & XHTML compliant, MooTools, TinyMCE editor for posts & custom content management, , Visual Theme Designer, custom menus & pages, member galleries with ASP JPeg and ASPResize, ASP WordPress style Blog, web friends, FaceBook, Twitter & other social-sharing integration, ReCaptcha & Anti-Spam Registration...and much more.
Posted
Average Member
richfed
Posts: 999
999
I have done just that. Blended your two suggestions. All is good!! smile
Posted
Forum Admin
HuwR
Posts: 20611
20611
openWindow5 is used to display the pop_printer_friendly page from topic.asp (in a standard snitz install)
 
You Must enter a message