Forum Moderators: open
{
newwindow=window.open(url,'name','height=500,width=600,resizable=yes,scrollbars=yes, menubar=yes');
if (window.focus) {newwindow.focus()}
}
then
<td class="vtCell"><a href="javascript:openWindow(http://www.example.com/Homelife/inventory.asp?subd=Ashley Place&cnty=Douglas&county=Douglas&subdivision=Ashley Place&lb=Hlcm01&source=GAMLS');">View
Available Homes</a></td>
My question is...even though i have given our page they link to a different page title, it shows our url in the top blue bar instead of the actual page title.
Any idea why or how we can change that?
Thanks!
[edited by: encyclo at 1:51 pm (utc) on Mar. 23, 2006]
[edit reason] examplified [/edit]
could you show us the code from the <head> tag of your destination page?
I'll check it out and get back with you.
They would just have to add the following line to this JavaScript code to enable the address bar.
location=yes
It would look like this:
newwindow=window.open(url,'name','location=yes,height=500,width=600,resizable=yes,scrollbars=yes, menubar=yes');
I work with JS all the time and this seems like a better solution that both solves your problems and is better for the end user:
<a href="example.com" target="new window">New win</a>
But the JS coder in me cannot ignore some things, sorry, they stray from the topic:
newwindow=window.open(url,'name','height=500,width=600,resizable=yes,scrollbars=yes, menubar=yes');
if (window.focus) {newwindow.focus()}
....
<td class="vtCell"><a href="javascript:openWindow(http://www.example.com/Homelife/inventory.asp?subd=Ashley Place&cnty=Douglas&county=Douglas&subdivision=Ashley Place&lb=Hlcm01&source=GAMLS');">View
Available Homes</a></td>
1. The WINDOW NAME attribute needs to be unique. If you always name it "name" all the links will open in that SAME window. So if someone clicks a link, leaves it open, clicks back in the main window, and clicks another link, it appears to them that nothing happens and your site is broken, even though it's loading in the window behind.
var day = new Date();
var id = day.getTime();
newwindow=window.open(url,id,'height=500,...........
2. The "yes" "1" or "on" values are not required for any boolean attributes in open(). Leaving them off equals no, including them equals yes:
newwindow=window.open(url,id,'height=500,width=600,location,resizable,scrollbars, menubar');
3. Lastly, your content is INACESSIBLE if Javascript is disabled or not supported, because there's not likely any page called "javascript:" on your site. :-) By making the small change below, this allows users to get to your content with JS disabled. The "return false" only executes if JS is enabled, and tells the browser to NOT follow the link. Try it:
<a href="http://www.example.com/Homelife/inventory.asp?subd=Ashley Place&cnty=Douglas&county=Douglas&subdivision=Ashley Place&lb=Hlcm01&source=GAMLS" onClick="openWindow(http://www.example.com/Homelife/inventory.asp?subd=Ashley Place&cnty=Douglas&county=Douglas&subdivision=Ashley Place&lb=Hlcm01&source=GAMLS'); return false;">View
Available Homes</a>
All in all - it really sounds to me like new window is a much better choice. :-D