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

IE problem with open.window

I am quite new to javascript, and don't seem to find the problem with
stupid internet explorer.
The script works fine in safari and mozilla.
I searched the groups, but evidently put in the wrong keywords, didn't
find the solution.
It seems to be as easy as it gets: open a new window with a new url.
in IE (I am using IE in mac osx), the error message is:

Microsoft JScript runtime error:
Line: 9
Char: 8
Error: Type mismatch

Thanks for any tips! I am getting crazy over this!
q.

here are the scripts:

test.js:
function launchDisplay(mydata) {
datasetWindow=window.open("describe_data.cgi" + mydata, " ",
"width=500,height=200,scrollbars=yes, resizable=yes")
}

test.html:
<head><title>Untitled Document</title>
<script language="JavaScript" src="test.js"
type="text/javascript"></script>
</head><body><a HREF="#" onClick="launchDisplay('?dataset=mydataset');
return false;">Display Properties of selected Dataset</a>
<br />
</body>
</html>
Jul 23 '05 #1
4 7563
DU
Anna Quick wrote:
I am quite new to javascript, and don't seem to find the problem with
stupid internet explorer.
The script works fine in safari and mozilla.
I searched the groups, but evidently put in the wrong keywords, didn't
find the solution.
It seems to be as easy as it gets: open a new window with a new url.
in IE (I am using IE in mac osx)
IE for Mac OS X is a rare bird.

, the error message is:
Microsoft JScript runtime error:
Line: 9
Char: 8
Error: Type mismatch

Thanks for any tips! I am getting crazy over this!
q.

here are the scripts:

test.js:
function launchDisplay(mydata) {
datasetWindow=window.open("describe_data.cgi" + mydata, " ",
"width=500,height=200,scrollbars=yes, resizable=yes")
Avoid an empty string for the window name. Avoid blank space in the 3rd
parameter of the window.open (in the windowFeatures string list): this
is an error for Netscape browsers.
}

test.html:
<head><title>Untitled Document</title>
<script language="JavaScript" src="test.js"
language is deprecated while type is both backward and forward-compatible.
type="text/javascript"></script>
</head><body><a HREF="#" onClick="launchDisplay('?dataset=mydataset');
The problem with this is that nothing happens (no document, no content
at all) if javascript support is disabled. About 8-12% of users have
javascript disabled. Your code here is not robust, not promoting
accessibility to content.
return false;">Display Properties of selected Dataset</a>

Try this:

In your html:
-------------
<a href="describe_data.cgi?dataset=mydataset" target="RequestedPopup"
onclick="launchDisplay(this.href, this.target); return false;"
title="Clicking this link will create a new window or will reuse an
already opened window">Display Properties of selected Dataset <img
src="http://www10.brinkster.com/doctorunclear/GRAPHICS/PNG/OpenRequestedPopup.png"
width="25" height="25" alt="[will create a new window]"></a>

In your <script> in your <head>:
--------------------------------

<script type="text/javascript">
var WindowObjectReference, strPreviousURL;
function launchDisplay(strCurrentURL, strTarget)
{
if(WindowObjectReference == null || WindowObjectReference.closed)
{
WindowObjectReference = window.open(strCurrentURL, strTarget,
"width=500,height=200,resizable,scrollbars,status" );
}
else if(strPreviousURL != strCurrentURL)
{
WindowObjectReference = window.open(strCurrentURL, strTarget,
"width=500,height=200,resizable,scrollbars,status" );
WindowObjectReference.focus();
}
else
{
WindowObjectReference.focus();
};
strPreviousURL = strCurrentURL;
}
</script>

You can furthermore develop the accessibility, usability ideas of such
script with cursor styling and make the new window coordinate positions
and dimensions entirely scalable, proportional to the user's browser
viewport.

DU
Jul 23 '05 #2
DU,thanks for your help. Unfortunately, it still doesn't work.
I tried it on a windows xp computer, and IE gave an error message as
well.

The html file I posted is actually a very reduced one generated by
CGI.pm. I didn't do any browser checking/etc. yet, because I want to
have the basic function in place first.

The URL is:
http://www.operartists.net/test.html

The debugging error message in IE (XP) is: invalid argument (pointing
to the window.open line).
below again the current version of the files. I am sure that it is
something trivial that is wrong. Any help??? no problems with mozilla
or safari.
Thanks! q.

test.html:
<head><title>Dataset Test</title>
<script src="test.js" type="text/javascript"></script>
</head><body>
<a HREF="/cgi-bin/describe_datasets.cgi?dataset=testset"
target="Dataset Description"
onClick="launchDisplay('?dataset=testset'); return false;">Display
Properties of selected Dataset</a>
<br />
</body>
</html>

test.js:
var WindowObjectReference, strPreviousURL;
function launchDisplay(dataset_collection)
{
if(WindowObjectReference == null ||
WindowObjectReference.closed) {
WindowObjectReference =
window.open("/cgi-bin/describe_datasets.cgi" + dataset_collection,
"Dataset Description",
"width=500,height=200,resizable,scrollbars,status" );
}
else if(strPreviousURL != dataset_collection) {
WindowObjectReference =
window.open("/cgi-bin/describe_datasets.cgi" + dataset_collection,
"Dataset Description",
"width=500,height=200,resizable,scrollbars,status" );
WindowObjectReference.focus();
}
else {
WindowObjectReference.focus();
};
strPreviousURL = dataset_collection;
}
Jul 23 '05 #3
DU
Anna Quick wrote:
DU,thanks for your help. Unfortunately, it still doesn't work.
I tried it on a windows xp computer, and IE gave an error message as
well.

The html file I posted is actually a very reduced one generated by
CGI.pm. I didn't do any browser checking/etc. yet, because I want to
have the basic function in place first.

The URL is:
http://www.operartists.net/test.html

The debugging error message in IE (XP) is: invalid argument (pointing
to the window.open line).
below again the current version of the files. I am sure that it is
something trivial that is wrong. Any help??? no problems with mozilla
or safari.
Thanks! q.

test.html:
<head><title>Dataset Test</title>
<script src="test.js" type="text/javascript"></script>
</head><body>
<a HREF="/cgi-bin/describe_datasets.cgi?dataset=testset"
target="Dataset Description"
target attribute value MUST NOT have a blank space; otherwise it won't
work in MSIE 6 for windows. That, I'm absolutely sure of. Use
target="Dataset_Description" or
target="DatasetDescription"
onClick="launchDisplay('?dataset=testset');
I recommend not making any concatenation operation when determining the
URI. This is not recommendable.

I'll examine your test.html page.

DU

return false;">Display Properties of selected Dataset</a>
<br />
</body>
</html>

test.js:
var WindowObjectReference, strPreviousURL;
function launchDisplay(dataset_collection)
{
if(WindowObjectReference == null ||
WindowObjectReference.closed) {
WindowObjectReference =
window.open("/cgi-bin/describe_datasets.cgi" + dataset_collection,
"Dataset Description",
"width=500,height=200,resizable,scrollbars,status" );
}
else if(strPreviousURL != dataset_collection) {
WindowObjectReference =
window.open("/cgi-bin/describe_datasets.cgi" + dataset_collection,
"Dataset Description",
"width=500,height=200,resizable,scrollbars,status" );
WindowObjectReference.focus();
}
else {
WindowObjectReference.focus();
};
strPreviousURL = dataset_collection;
}

Jul 23 '05 #4
DU
Anna Quick wrote:
DU,thanks for your help. Unfortunately, it still doesn't work.
I tried it on a windows xp computer, and IE gave an error message as
well.

The html file I posted is actually a very reduced one generated by
CGI.pm. I didn't do any browser checking/etc. yet, because I want to
have the basic function in place first.

The URL is:
http://www.operartists.net/test.html

The debugging error message in IE (XP) is: invalid argument (pointing
to the window.open line).
below again the current version of the files. I am sure that it is
something trivial that is wrong. Any help??? no problems with mozilla
or safari.
Thanks! q.

test.html:
<head><title>Dataset Test</title>
<script src="test.js" type="text/javascript"></script>
</head><body>
<a HREF="/cgi-bin/describe_datasets.cgi?dataset=testset"
target="Dataset Description"
onClick="launchDisplay('?dataset=testset'); return false;">Display
One 1 hand, you define the relative url of the referenced resource (the
href value), on the other hand, you call a function which will
concatenate string to establish the url value. This is not recommendable
and should be avoided. In the code I gave you, I edited the relative url
as the href value and then use this.href for the called function
launchDisplay. Not only this is better but it also help code
maintenance: you only have 1 string to update.
And I still maintain the rest I said in the other post: no blank space
in the target attribute value, do not concatenate strings when making
the window.open() call.
The complete code I provided should work in case the user has javascript
disabled.
For the sake of this, try your MSIE for Mac at this page:

http://www10.brinkster.com/doctorunc...pera7Bugs.html

You may try other pages in my javascript section which uses requested
popups. Let me know which pages which do not work.

DU
Properties of selected Dataset</a>
<br />
</body>
</html>

test.js:
var WindowObjectReference, strPreviousURL;
function launchDisplay(dataset_collection)
{
if(WindowObjectReference == null ||
WindowObjectReference.closed) {
WindowObjectReference =
window.open("/cgi-bin/describe_datasets.cgi" + dataset_collection,
"Dataset Description",
"width=500,height=200,resizable,scrollbars,status" );
}
else if(strPreviousURL != dataset_collection) {
WindowObjectReference =
window.open("/cgi-bin/describe_datasets.cgi" + dataset_collection,
"Dataset Description",
"width=500,height=200,resizable,scrollbars,status" );
WindowObjectReference.focus();
}
else {
WindowObjectReference.focus();
};
strPreviousURL = dataset_collection;
}

Jul 23 '05 #5

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...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
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: Robert Atkinson | last post by:
Does anyone know how to replace <a href="url" target="_blank"> with window.open, keeping the window settings the same, i.e. same size, same toolbars, etc. I've tried document.open, and...
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: ...
2
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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.