473,412 Members | 5,385 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

How to open a new window

When the surfer clicks on the anchor, I would like to have a new window
open. Can this be done? This is what I have tried:

<!--
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
<td align="left" class="Even"><a href="#"
onClick="MM_openBrWindow('show_imagephp','','')"> Notice </a></td>
Todd
Oct 30 '05 #1
5 4096
Lee
Todd Cary said:

When the surfer clicks on the anchor, I would like to have a new window
open. Can this be done? This is what I have tried:

<!--
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
<td align="left" class="Even"><a href="#"
onClick="MM_openBrWindow('show_imagephp','','') "> Notice </a></td>


That should work, assuming that all of the parts of the page that
you haven't shown us are correct and the browser isn't set to
refuse to allow popup windows from script.

The window will probably be empty, becuase "show_imagephp" doesn't
look like a valid URL. Did you mean "show_image.php" ?

The comments around the function definition are pointless, and
one of the things that we're assuming is that that function
definition is contained in a <script type="text/javascript"></script>
block.

What happens when you try it?

Oct 30 '05 #2
Todd Cary wrote:
When the surfer clicks on the anchor, I would like to have a new window
open.
Does the surfer want a new window to open? I'm yet to encounter a popup that
was a good idea.
<!--
Pointless
function MM_openBrWindow(theURL,winName,features) {
Uh oh. A Macromedia JavaScript routine. Anything that starts MM_ is likely
to be a bad idea.
window.open(theURL,winName,features);
So, this funtion takes three parameters, then passes them on to another
function with takes the same three parameters, in the same order, with no
manipulation of them whatsoever. Get rid of it.
}
The one like of code in this script with no problems!
//-->
Pointless. Ditch it.
<td align="left" class="Even">
Why isn't that align left in your stylesheet?
<a href="#"
Href equals what? Why are you linking to the top of the page here? If you
want to attach JavaScript to a link, then the link itself should do
something sensible. Usually this means a sane fallback, sometimes it means
a link to a document begging forgiveness to the user for not having a
proper fallback in place for when the scripting fails.
onClick="MM_openBrWindow('show_imagephp','','')"> Notice </a></td>


<a href="show_imagephp"
onclick="if (window.open) { window.open(this.href,'popup',''); return
false; }">

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Oct 30 '05 #3
First I want to express my appreciation to those who took the time to
answer my question. As you can determine from my code, this is not my
area of expertise. Every few months I am asked to create a Web site for
my client, and since I am their only programmer (Delphi is my main
language), I get the task of creating the sites.

In this particular site, the attorney's will search for class action
claims that are in TIFF format and view them in PDF. All of this is
being done dynamically in php (quite a learning curve for me!) which
brings up a PDF page in the PDF viewer. My challenge is to make wo when
the viewer closes the PDF page, they do not close the browser. My
solution is to make a new window for the PDF Viewer.

As indicated by your detailed responses, HTML and JavaScript are your
areas of expertise. Your suggestions are welcomed, including the
improved use of CSS (wish one of you worked for my client so I could
learn from you0.

Host: http://209.204.172.137/carf/php/login.php
User: tester
PW: test

Thank you again....

Todd

*** Sent via Developersdex http://www.developersdex.com ***
Oct 30 '05 #4
I forgot to say that I had a typo with the escape characters in PHP so
the URL was not correct plus some other typos. Thank you for finding
them!

<td class="Even"><a href="#" onClick="MM_openBrWindow('show_image.php?
image=./tiff/demo_good.tif&session_id=1130685270
&claim_ref=1000001','','')">1000001</a></td>

Also, there is only one test record in the DB that is brought up with a
"C" in the Last name field.

http://209.204.172.137/carf/php/login.php

User: tester
PW: test


*** Sent via Developersdex http://www.developersdex.com ***
Oct 30 '05 #5
> > onClick="MM_openBrWindow('show_imagephp','','')"> Notice </a></td>

<a href="show_imagephp"
onclick="if (window.open) { window.open(this.href,'popup',''); return
false; }">


Tod, if the purpose of your popup is to avoid that the user moves away
from your main page, then could use a variation of David's suggestion:

<a href="show_imagephp" target="popup"
onclick="if (window.open) { window.open(this.href,this.target,'');
return false; }">

Gert-Jan
Oct 30 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
6
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone...
10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
2
by: Samir Pandey | last post by:
Hello, I am using the following javascript code to open a new window. Somehow, IE always opens a new window. It doesn't open target url in the window name given. All i want is, if there is a...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
2
by: Larry R Harrison Jr | last post by:
I have pull-down menus in javascript and I have the code for opening a link in a new window. But I want it to open a full-sized window. I can't figure out the syntax. What I have so far: ...
8
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
13
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.