473,516 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Function being ignored in NN4

Apologies if this is a silly question, but Googling on the archive
didn't produce any answers.

I have a piece of inline Javascript which works as expected in IE 6,
Opera 7, Mozilla and NN 4. In the interests of keeping my pieces of
script together, I changed it into a function and called it thus:

<SCRIPT type="text/javascript">
buttonbar();
</SCRIPT>

This works fine in IE, Opera and Mozilla, but NN 4 does not call the
function. Could anyone suggest why?

The page is validated HTML 4.01. (And before you ask: I do have a
corresponding <NOSCRIPT> element as well.)

--
Stephen Poley
Barendrecht, Holland
Jul 20 '05 #1
4 1945


Stephen Poley wrote:
Apologies if this is a silly question, but Googling on the archive
didn't produce any answers.

I have a piece of inline Javascript which works as expected in IE 6,
Opera 7, Mozilla and NN 4. In the interests of keeping my pieces of
script together, I changed it into a function and called it thus:

<SCRIPT type="text/javascript">
buttonbar();
</SCRIPT>

This works fine in IE, Opera and Mozilla, but NN 4 does not call the
function. Could anyone suggest why?

The page is validated HTML 4.01. (And before you ask: I do have a
corresponding <NOSCRIPT> element as well.)


What does the JavaScript console in NN4 show?
Type
javascript:<return>
in the location bar and check for error messages

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
On Wed, 02 Jul 2003 14:04:38 +0200, Martin Honnen
<Ma***********@t-online.de> wrote:
Stephen Poley wrote:
Apologies if this is a silly question, but Googling on the archive
didn't produce any answers.

I have a piece of inline Javascript which works as expected in IE 6,
Opera 7, Mozilla and NN 4. In the interests of keeping my pieces of
script together, I changed it into a function and called it thus:

<SCRIPT type="text/javascript">
buttonbar();
</SCRIPT>

This works fine in IE, Opera and Mozilla, but NN 4 does not call the
function. Could anyone suggest why?

The page is validated HTML 4.01. (And before you ask: I do have a
corresponding <NOSCRIPT> element as well.)
What does the JavaScript console in NN4 show?
Type
javascript:<return>
in the location bar and check for error messages

It says:
----
JavaScript Error:
file:/C|/!Website/Development/webmatters/resize.html, line
52: invalid case expression JavaScript Error:
file:/C|/!Website/Development/webmatters/resize.html, line
192:

buttonbar is not defined.
----

Line 52 is in a function close to the top of my Javascript and should
not have been called on initial display, so I assume that NN4 starts
there for some reason when it can't find buttonbar.

Or, musing further, perhaps NN4 can't parse this and the error recovery
stops it from finding buttonbar. The statement is as follows. Line 52 is
'case small'. Is there something here that NN4 doesn't like?

switch(imgsize) {
case small: imgwidth=smaWidth; imgheight=smaHeight; imgid='1';
break;
case medium: imgwidth=medWidth; imgheight=medHeight; imgid='2';
break;
case large: imgwidth=larWidth; imgheight=larHeight; imgid='3';
break;
default: alert('Javascript error 1; please shoot the author');
}
--
Stephen Poley
Barendrecht, Holland
Jul 20 '05 #3
Hi,

Stephen Poley wrote:
On Wed, 02 Jul 2003 14:04:38 +0200, Martin Honnen
<Ma***********@t-online.de> wrote:

Stephen Poley wrote:
Apologies if this is a silly question, but Googling on the archive
didn't produce any answers.

I have a piece of inline Javascript which works as expected in IE 6,
Opera 7, Mozilla and NN 4. In the interests of keeping my pieces of
script together, I changed it into a function and called it thus:

<SCRIPT type="text/javascript">
buttonbar();
</SCRIPT>

This works fine in IE, Opera and Mozilla, but NN 4 does not call the
function. Could anyone suggest why?

The page is validated HTML 4.01. (And before you ask: I do have a
corresponding <NOSCRIPT> element as well.)

What does the JavaScript console in NN4 show?
Type
javascript:<return>
in the location bar and check for error messages


It says:
----
JavaScript Error:
file:/C|/!Website/Development/webmatters/resize.html, line
52: invalid case expression JavaScript Error:
file:/C|/!Website/Development/webmatters/resize.html, line
192:

buttonbar is not defined.
----

Line 52 is in a function close to the top of my Javascript and should
not have been called on initial display, so I assume that NN4 starts
there for some reason when it can't find buttonbar.

Or, musing further, perhaps NN4 can't parse this and the error recovery
stops it from finding buttonbar. The statement is as follows. Line 52 is
'case small'. Is there something here that NN4 doesn't like?

switch(imgsize) {
case small: imgwidth=smaWidth; imgheight=smaHeight; imgid='1';
break;
case medium: imgwidth=medWidth; imgheight=medHeight; imgid='2';
break;
case large: imgwidth=larWidth; imgheight=larHeight; imgid='3';
break;
default: alert('Javascript error 1; please shoot the author');
}


I recently found out that Netscape 4 chokes on case labels which are
defined somewhere else in the code. Pretty boring (if you really *have*
to use Netscape 4), since it prevents you to use (pseudo-)constants as
case labels. What seems to happens is that Netscape 4 parses the
switch..case part before it parses the place where the
(pseudo-)constants are defined. Changing the order of the definitions in
the script didn't change the problem. Replacing the case label with
numerals did solve the problem, but is not satisfying from a
programmer's POV.

This and other reasons convinced me to definitely drop Netscape 4 as a
development tool and to use Mozilla/Venkman to develop. My target is now
Netscape 7 / IE5+ and I will give only the simplest version of my sites
to Netscape 4 users, as well as a request to upgrade.

This problem doesn't happen on Mozilla/Netscape 7.

HTH,

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #4
On Thu, 03 Jul 2003 07:01:45 +0200, "Laurent Bugnion, GalaSoft"
<galasoft-LB@bluewin_NO_SPAM.ch> wrote:
I recently found out that Netscape 4 chokes on case labels which are
defined somewhere else in the code. Pretty boring (if you really *have*
to use Netscape 4), since it prevents you to use (pseudo-)constants as
case labels. What seems to happens is that Netscape 4 parses the
switch..case part before it parses the place where the
(pseudo-)constants are defined.
Thank you very much - that did indeed turn out to be the problem.
Changing the order of the definitions in
the script didn't change the problem. Replacing the case label with
numerals did solve the problem, but is not satisfying from a
programmer's POV.
Agreed. Actually all I need to do in Netscape 4 is explain to the reader
that the specific function concerned is unavailable. So I managed to fix
it by putting the buttonbar() function in a separate <SCRIPT> element,
immediately after the element containing the case statement. The script
is at least together in the <HEAD>, which is what I wanted.
This and other reasons convinced me to definitely drop Netscape 4 as a
development tool and to use Mozilla/Venkman to develop. My target is now
Netscape 7 / IE5+ and I will give only the simplest version of my sites
to Netscape 4 users, as well as a request to upgrade.


I mainly use Opera, and also test the results in Mozilla and IE. If I
get into doing a lot of Javascript, I'll probably use Mozilla more.
Netscape 4 is, as you imply, mainly a damage-limitation exercise, but I
do still get about 3%-4% NN4 visitors, so I'm not abandoning them just
yet.

--
Stephen Poley
Barendrecht, Holland
Jul 20 '05 #5

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

Similar topics

9
4936
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or...
2
3622
by: joe | last post by:
hi, after reading some articles and faq, i want to clarify myself what's correct(conform to standard) and what's not? or what should be correct but it isn't simply because compilers don't support. (first i compiled them with g++3.x. ERR means compiler will bark, otherwise it does accept it. Then the Comeau C/C++ 4.3.3 comes)
9
7486
by: Pushker Pradhan | last post by:
I've a function which accepts void * as the arg because the actual datatype can be char or float or anything. The fuction: void convolve(void *x, float *convx, uint32 numrowsx, uint32 numcolsx, float *h, uint32 hlen, dwt_process ROWSORCOLS) Usage in main() convolve((float*)x, xLP, tileLength, tileWidth, ld, filterlen, DWT_ROWS);
19
3313
by: anguo | last post by:
i find in many hash function use 5381,for exampla: static constmap_hash hash(char *pchData, int iLen) { unsigned char cBuf; constmap_hash ulHashId; ulHashId = 5381; while (iLen > 0) { cBuf = *pchData++ - 'A'; if (cBuf <= 'Z' - 'A')
8
1795
by: David M. Wilson | last post by:
I know this doesn't specifically pertain to the scope of comp.lang.c, but I don't know of a better forum to post it on, besides, what is the practicality of comp.lang.c if it weren't for answers to questions such as this? :) I see an awful lot of code on a day to day basis like so: (void) printf(...);
11
4707
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to create content to put at the address pointed to by f. In particular, I'd like to avoid/replace the memcpy line. Possible application (inspired by Paul...
12
2097
by: Nico Schuyt | last post by:
Maybe a stupid question (I'm not so familiar with javascript), but: I want to change background of a paragraph or list item on mouseover. The following code works: <p onMouseover="this.style.backgroundColor='yellow'" onMouseout="this.style.backgroundColor='white'">ppppp</p> Now I want to minimize the coding bij using a function. How do I...
0
1835
by: Fuzzyman | last post by:
Hello all, The following is a copy of a blog entry. It's asking a question about future statements and the built in compile function. I'd appreciate any pointers or comments about possible approaches. `Movable Python <http://www.voidspace.org.uk/python/movpy/>`_ supports running both Python scripts and ``.pyc`` bytecode files. It does...
13
7240
by: Mike -- Email Ignored | last post by:
Is a pure virtual function in allowed in a template base class? In any case, I have one working. Am I skating on thin ice? Thanks, Mike.
49
2676
by: Davy | last post by:
Hi all, I am writing a function, which return the pointer of the int. But it seems to be wrong. Any suggestion? int * get_p_t(int t) { return &t; } int main()
0
7276
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...
0
7408
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. ...
1
7142
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...
0
7548
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...
0
5714
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
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...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.