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

"Object expected" error with pop-up function in IE6, Firefox fine

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 in a link. that
function can have parameters for URL and window name passed to it.

This works peachy in Firefox (1.0). With IE 6 (6.0.29) on two separate
computers, I get an "onject expected" error. Going to the MS-based
debugger just tells me the line where the "error' occurs, but I can get
no explanation.

Here's the basic code:

In the HEAD section

<script language="JavaScript1.4">
<!--
function helpWindow(u, n) {
var upperLeft = (screen.availWidth / 2);
var winHeight = (screen.availHeight / 2);
var w = (screen.availWidth / 2);
var helpwin = window.open(u, n,
"toolbar=no,status=no,menubar=no,width=" + w + ",height=" + winHeight +
",left=" + upperLeft + ",top=0");
}

-->
</script>

And in the BODY

<p>Click <a href="#"
onclick="javascript:helpWindow('WebHelp/GoalView_Help.htm',
'Help');">Help (function, onclick)</a> to view the help. </p>
(Note that the user agent may wrap lines, but line breaks are only in
the appropriate places in the actual code.)

When I click this link, two things happen. First, I get the error noted
above. Then when I dismiss the error, I get an Explorer-like listing of
files.

I've been doing some experimenting, trying some different code from
different web sites, trying to do the same action directly instead of
calling the function in the link, etc. Here's the current state of the
entire code:

<script language="JavaScript1.4">
<!--
function helpWindow(u, n) {
var upperLeft = (screen.availWidth / 2);
var winHeight = (screen.availHeight / 2);
var w = (screen.availWidth / 2);
//var params = "toolbar=no,status=no,menubar=no,width=" + w +
",height=" + winHeight + ",left=" + upperLeft + ",top=0"
var helpwin = window.open(u, n,
"toolbar=no,status=no,menubar=no,width=" + w + ",height=" + winHeight +
",left=" + upperLeft + ",top=0");
//var win = window.open(u, n, "toolbar=no,status=no,menubar=no");
//var helpwin = window.open(u, n);
//return false;
}

//myWindow = window.open("", "tinyWindow", 'toolbar,width=150,height=100')
//myWindow.document.write("Welcome to this new window!")
//myWindow.document.bgColor="lightblue"

function changeURL(winName, newURL) {
win = window.open("", winName);
win.location.href = newURL;
}

function anchor_test() {
window.alert("This is an anchor test.")
}

function greetVisitor()
{
var myName = prompt("Please enter your name.", "");
alert("Welcome " + myName + "!")
}
-->
</script>

</head>

<body>
<p>This page is intended to demonstate an HTML-based Help system
possibility for GoalView.</p>
<p>Click <a href="#"
onclick="javascript:helpWindow('WebHelp/GoalView_Help.htm',
'Help');">Help (function, onclick)</a> to view the help. </p>
<p>Click <a href="javascript:helpWindow('WebHelp/GoalView_Help.htm',
'Help');">Help (function, href)</a> to view the help. </p>
<p>Click <a href="" onclick="window.open('WebHelp/GoalView_Help.htm',
'Help',
'toolbar=no,status=no,menubar=no,width=600,height= 500,left=0,top=0')">Help
(direct)</a> to view the help. </p>
<p>Click <a href="" onclick="window.open('WebHelp/GoalView_Help.htm',
'Help')">Help (direct, no window parameter)</a> to view the help. </p>
<FORM>
<INPUT TYPE="button" VALUE="Help (function)"
onClick="helpWindow('WebHelp/GoalView_Help.htm', 'Help')">
<INPUT TYPE="button" VALUE="Help (direct)"
onClick="window.open('WebHelp/GoalView_Help.htm', 'Help')">
<INPUT TYPE="button" VALUE="Load ZDNet (function)"
onClick="changeURL('news', 'http://www.zdnet.com/')">
<INPUT TYPE="button" VALUE="Load ZDNet (direct)"
onClick="window.open('http://www.zdnet.com/', 'news')">
</FORM>
<p><A HREF="javascript:anchor_test()">Test</a></p>
<p><a href="javascript:greetVisitor()">Click for a greeting</a></p>
<p><a href="#" onmouseover="alert('This is an
alert.')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></p>

There are 4 links, 4 buttons, then 3 more links.

Of the first 4 links:

1. Error message, "No" to debug, nothing else happens
2. Error message, "No" to debug, nothing else happens
3. Opens new window, size and position correct, originating page lists
Explorer-like list of files instead of remaining on the originating page
4. Opens new full size window, originating page lists Explorer-like list
of files instead of remaining on the originating page

Of the 4 buttons:

1. Error message, "No" to debug, nothing else happens
2. Opens a new, full-size window, originating page remains
3. Error message, "No" to debug, nothing else happens (This code was
taken unmodified from another JS site)
4. Opens a new, full-size window, originating page remains

Of the last 3 links:

1. Error message, "No" to debug, nothing else happens (This code was
taken unmodified from another JS site)
2. Error message, "No" to debug, nothing else happens (This code was
taken unmodified from another JS site)
3. On mouseover, displayes an alert (This code was taken unmodified from
another JS site)

The fact that the pop-up code works fine in Firefox (and that when I
type javascript: in the Firefox address bar afterwards and get nothing
in the JavaScript console) leads me to believe that this is an IE
problem. But what? I've disabled all I can know/think of as far as
allowing pop-ups in IE.

If anyone has any clues they can pass on, you know how to un-munge email
(if you want to reply privately as well as post a solution here).

thx

--
--
Chuck Martin
User Assistance & Experience Engineer
twriter "at" sonic "dot" net www.writeforyou.com

"I see in your eyes the same fear that would take the heart of me.
The day may come when the courage of Men fail, when we forsake our
friends and break all bonds of fellowship. But it is not this day!
This day, we fight!"
- Aragorn

"All you have to decide is what to do with the time that is given you."
- Gandalf
Jul 23 '05 #1
2 9757


Chuck Martin wrote:

This works peachy in Firefox (1.0). With IE 6 (6.0.29) on two separate
computers, I get an "onject expected" error.
<script language="JavaScript1.4">


Use
<script type="text/javascript">
and I think the IE problem will go away although I haven't looked at
details of the rest of your post.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin Honnen wrote:


Chuck Martin wrote:

This works peachy in Firefox (1.0). With IE 6 (6.0.29) on two separate
computers, I get an "onject expected" error.

<script language="JavaScript1.4">

Use
<script type="text/javascript">
and I think the IE problem will go away although I haven't looked at
details of the rest of your post.

Martin,

That worked. I think you from the bottom of my heart.

I also used your response to go to another part of one of my JavaScript
books to find that the language attribute is deprecaetd. That wasn't
what was taught in my Internet Programming class just last spring.

My utmost thanks.

--
--
Chuck Martin
User Assistance & Experience Engineer
twriter "at" sonic "dot" net www.writeforyou.com

"I see in your eyes the same fear that would take the heart of me.
The day may come when the courage of Men fail, when we forsake our
friends and break all bonds of fellowship. But it is not this day!
This day, we fight!"
- Aragorn

"All you have to decide is what to do with the time that is given you."
- Gandalf
Jul 23 '05 #3

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

Similar topics

5
by: Rick | last post by:
I wrote the following code as part of a page where users can reorder a list of items by highlighting an item in a list box and clicking an "up" or "down" button to move the items around. The code...
1
by: The Late Nate the Great | last post by:
Using VC# in creating a .NET Compact Framework project, I received this message first thing Monday morning (talk about a bad omen for the week!). It gave a line number that didn't apply, and...
2
by: Kathy Burke | last post by:
Hi again, I'm trying to run a sub from within another: Public Sub txtScan_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtScan.TextChanged ...
5
by: TJS | last post by:
trying to display pdf file in browser fails on this line: Response.ContentType = "application/pdf" getting an error about no declaration found for "response" what declaration is needed ???
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
14
by: Geoff Jones | last post by:
Hi I'm trying to use a class that I've written in a form. Unfortunately, when I write something like: Public x As New myClass I get the compile time error: "Type Expected". Indeed, the...
1
by: monudjn | last post by:
Hi I am implementing ajax in portal. Using ajax i am able to updating the content of portlets asynchronously. However i am facing a problem The Problem: While submitting the form i am getting...
1
by: chaos | last post by:
i always saw this error in my web page http://i175.photobucket.com/albums/w133/chaos2005_01/Error-1.jpg Wt can i do in order to remove the error
2
Niner49
by: Niner49 | last post by:
I am a newbie in the world of html/javascript and I'm have a little problem with an assignment I'm doing for a class. The url for the page is: http://webpages.uncc.edu/~cpedwar1/suduko.htm The...
2
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%=...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.