473,703 Members | 3,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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="JavaS cript1.4">
<!--
function helpWindow(u, n) {
var upperLeft = (screen.availWi dth / 2);
var winHeight = (screen.availHe ight / 2);
var w = (screen.availWi dth / 2);
var helpwin = window.open(u, n,
"toolbar=no,sta tus=no,menubar= no,width=" + w + ",height=" + winHeight +
",left=" + upperLeft + ",top=0");
}

-->
</script>

And in the BODY

<p>Click <a href="#"
onclick="javasc ript:helpWindow ('WebHelp/GoalView_Help.h tm',
'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="JavaS cript1.4">
<!--
function helpWindow(u, n) {
var upperLeft = (screen.availWi dth / 2);
var winHeight = (screen.availHe ight / 2);
var w = (screen.availWi dth / 2);
//var params = "toolbar=no,sta tus=no,menubar= no,width=" + w +
",height=" + winHeight + ",left=" + upperLeft + ",top=0"
var helpwin = window.open(u, n,
"toolbar=no,sta tus=no,menubar= no,width=" + w + ",height=" + winHeight +
",left=" + upperLeft + ",top=0");
//var win = window.open(u, n, "toolbar=no,sta tus=no,menubar= no");
//var helpwin = window.open(u, n);
//return false;
}

//myWindow = window.open("", "tinyWindow ", 'toolbar,width= 150,height=100' )
//myWindow.docume nt.write("Welco me to this new window!")
//myWindow.docume nt.bgColor="lig htblue"

function changeURL(winNa me, newURL) {
win = window.open("", winName);
win.location.hr ef = newURL;
}

function anchor_test() {
window.alert("T his 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="javasc ript:helpWindow ('WebHelp/GoalView_Help.h tm',
'Help');">Help (function, onclick)</a> to view the help. </p>
<p>Click <a href="javascrip t:helpWindow('W ebHelp/GoalView_Help.h tm',
'Help');">Help (function, href)</a> to view the help. </p>
<p>Click <a href="" onclick="window .open('WebHelp/GoalView_Help.h tm',
'Help',
'toolbar=no,sta tus=no,menubar= no,width=600,he ight=500,left=0 ,top=0')">Help
(direct)</a> to view the help. </p>
<p>Click <a href="" onclick="window .open('WebHelp/GoalView_Help.h tm',
'Help')">Help (direct, no window parameter)</a> to view the help. </p>
<FORM>
<INPUT TYPE="button" VALUE="Help (function)"
onClick="helpWi ndow('WebHelp/GoalView_Help.h tm', 'Help')">
<INPUT TYPE="button" VALUE="Help (direct)"
onClick="window .open('WebHelp/GoalView_Help.h tm', 'Help')">
<INPUT TYPE="button" VALUE="Load ZDNet (function)"
onClick="change URL('news', 'http://www.zdnet.com/')">
<INPUT TYPE="button" VALUE="Load ZDNet (direct)"
onClick="window .open('http://www.zdnet.com/', 'news')">
</FORM>
<p><A HREF="javascrip t:anchor_test() ">Test</a></p>
<p><a href="javascrip t:greetVisitor( )">Click for a greeting</a></p>
<p><a href="#" onmouseover="al ert('This is an
alert.')">&nbsp ;&nbsp;&nbsp;&n bsp;&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 9800


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="JavaS cript1.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="JavaS cript1.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
2721
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 below is for the up and down buttons along with a reset button (which reloads the list as it was originally) and a change button which applies the changes. In Explorer and Safari for Mac, this code works flawlessly. When I tested on Explorer in...
1
4650
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 double-clicking on the error did nothing. Knowing how many problems there have been in Microsnot's tools throughout this project, I tried simply closing VisStudio and reopening the project. The error mysteriously vanished.
2
4635
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 ProcessSN(ByVal sender As System.Object, ByVal e As System.EventArgs)
5
4967
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
3187
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 missing from the code? Thanks - Jon Private Sub MakeParentTable() ' Create a new DataTable. Dim myDataTable As Datatable = New Datatable("ParentTable")
14
14174
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 "squiggly" blue line does appear under myClass so I half expeced it. However, I had written
1
2148
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 javascript error " Object expected". These errors i am getting after implementing ajax. Also this error is shown only the first time i trying to submit. Next time this error won't come. This may be because the ajax update the content dynamically and if...
1
2912
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
1395
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 code is for a single cell of a suduko game. The point of the assignment is to check and validate the input going into the box.
2
5743
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="<%= ViewData %>" /> -
0
8759
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9252
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9017
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8966
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6588
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5922
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.