473,404 Members | 2,174 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,404 software developers and data experts.

window.open not working from inside user defined function

Hi,

I'm trying to use window.open from inside a user defined function, and
it's not working. A code example is shown below. Thanks for any help
you can give.

Mountain Man
============

<script>

function openFootnote(contentURL) {
window.open('contentURL','footnotes','height=180,w idth=160');
}

</script>

I've tried calling on the function 2 different ways, as shown below.
Nothing happens either way.

<a href="javascript:(void)" onClick="openFootnote(fn1.html);">...</a>

<a href="javascript:(void)" onClick="return
openFootnote(fn1.html);">...</a>
Jul 17 '05 #1
4 1976
This is a PHP group, not a Javascript group. You are OT.

--
Fred H

void FredH::Contact() {
TextToSpeach.say("frode at age dee dee dot en oh");
}
Jul 17 '05 #2
off topic here.
try: alt.javascript
"Mountain Man" <ei*************@yahoo.com> wrote in message
news:78**************************@posting.google.c om...
Hi,

I'm trying to use window.open from inside a user defined function, and
it's not working. A code example is shown below. Thanks for any help
you can give.

Mountain Man
============

<script>

function openFootnote(contentURL) {
window.open('contentURL','footnotes','height=180,w idth=160');
}

</script>

I've tried calling on the function 2 different ways, as shown below.
Nothing happens either way.

<a href="javascript:(void)" onClick="openFootnote(fn1.html);">...</a>

<a href="javascript:(void)" onClick="return
openFootnote(fn1.html);">...</a>

Jul 17 '05 #3
*** Mountain Man wrote/escribió (26 Feb 2004 03:38:55 -0800):
function openFootnote(contentURL) {
window.open('contentURL','footnotes','height=180,w idth=160');
} <a href="javascript:(void)" onClick="return
openFootnote(fn1.html);">...</a>


Since openFootnote() returns nothing there's no point in doing this. Just
try:

<a href="javascript:openFootnote('fn1.html')">

Anyway, I guess your own code should work fine, simply note fn1.html is not
a variable but a string and you forgot quotes.
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #4
Oops!

I didn't mean to send this post here. I could have sworn I was sending
to comp.lang.javacript before I hit the submit button. Sorry.

Best wishes,

Mountain Man
Jul 17 '05 #5

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

Similar topics

3
by: Michael | last post by:
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following: <a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a> The problem...
2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
9
by: Justin Koivisto | last post by:
Is there a way to create an alert-like message box that uses a custom image? Basically, I want to replace the default ! image with something else. -- Justin Koivisto - spam@koivi.com PHP...
2
by: Mountain Man | last post by:
Hi, I'm trying to use window.open from inside a user defined function, and it's not working. A code example is shown below. Thanks for any help you can give. Mountain Man ============ ...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
2
by: Matt | last post by:
In the following code, page1.asp is inside the frame of main.html. When the user click submit button in page1.asp, it will submit the form and open a new window called page2.asp. When the user...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
3
by: Jimmy | last post by:
Is it possible to open a pop-up browser window (modal-style) inside another browser? e.g. // assuming something is calling this function inside the html as some event got triggered function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.