473,749 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

firefox compatible javascript

can anyone suggest a couple of websites providing *compatible*
javascript?
of course there is
http://javascript.internet.com/
http://javascriptkit.com/
and the likes, but time and again you have to try out, test it only to
find it only works in IE.
at school, we want to test a number of javascripts, preferably
compatible with *all* browsers (mainly, but not just firefox).
tnx for suggestions

Oct 3 '05 #1
9 4428
bert76 said the following on 10/3/2005 8:15 AM:
can anyone suggest a couple of websites providing *compatible*
javascript?
of course there is
http://javascript.internet.com/
http://javascriptkit.com/
Neither of which is a good js site.
and the likes, but time and again you have to try out, test it only to
find it only works in IE.
That's typically what you get from copy-n-paste sites.
at school, we want to test a number of javascripts, preferably
compatible with *all* browsers (mainly, but not just firefox).
tnx for suggestions


Learn the language, write your own cross-browser scripts.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 3 '05 #2
Grab a few that are easy to modify for FF use and modify them.
As long as they don't do anything too horrible that uses MSIE only
things that have no FF counterpart (which you usually don't see for
the web, anyway; you see that sort of thing for intranet apps), it's
not usually too hard.

Or go to dynamicdrive.co m and make sure you look specifically for
cross-browser scripts.

Oct 3 '05 #3
nikki said the following on 10/3/2005 3:31 PM:
Please quote what you are replying to, it makes following the
conversation easier.
Grab a few that are easy to modify for FF use and modify them.
In order to know what is "easy to modify for FF" it requires a level of
understanding that you wouldn't need to find copy/paste scripts, you
would already know how to write your own.
As long as they don't do anything too horrible that uses MSIE only
things that have no FF counterpart (which you usually don't see for
the web, anyway; you see that sort of thing for intranet apps), it's
not usually too hard.
And what about scripts that use non-IE code?
Or go to dynamicdrive.co m and make sure you look specifically for
cross-browser scripts.


Dynamic Drive is just as bad, if not worse, than either of the ones
mentioned.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 3 '05 #4
bert76 wrote:
time and again you have to try out, test it only to
find it only works in IE.


A big part of the problem, I think, is that so much of what you find on
the web are hacks, instead of good well-written code. Most of it was
probably written years ago too. Take for example this:

<html>
<head>
<script>functio n a (){ alert(t.i.value ) }</script>
</head>
<body>
<form name="t"><input name="i" onchange="a()"> </form>
</body>

that works, but it's not valid html. If you change <html> to this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

then suddenly that code wont work. It wont work because it was invalid
all along - I'm supposed to use document.getEle mentById("i"), but if I
was just throwing together a hack for a tips website, maybe I wouldn't
care.

So you see, the problem isn't really compatibility. It's often
validity.

Oct 3 '05 #5

Randy Webb wrote:
nikki said the following on 10/3/2005 3:31 PM:
Please quote what you are replying to, it makes following the
conversation easier.


Yeah, I forgot all about that.
I wish Google had both "reply" links quote.

(and look, people CAN remind me nicely...go figure)

Actually, I wish I had Gravity and a news server back, but the new job,
she blocks news servers and downloads.
Grab a few that are easy to modify for FF use and modify them.


In order to know what is "easy to modify for FF" it requires a level of
understanding that you wouldn't need to find copy/paste scripts, you
would already know how to write your own.


This is true.
And kind of what I was getting at, really.
Or go to dynamicdrive.co m and make sure you look specifically for
cross-browser scripts.


Dynamic Drive is just as bad, if not worse, than either of the ones
mentioned.


Oh, I don't know.
It has some bad stuff, but I like a few of their cross-browser scripts.
Then again, some people are really picky. ;)

How about posting links to sites you think are good, then?

Oct 3 '05 #6
ch************* ***@gmail.com said the following on 10/3/2005 4:34 PM:
bert76 wrote:
time and again you have to try out, test it only to
find it only works in IE.

A big part of the problem, I think, is that so much of what you find on
the web are hacks, instead of good well-written code. Most of it was
probably written years ago too. Take for example this:

<html>
<head>
<script>functio n a (){ alert(t.i.value ) }</script>
</head>
<body>
<form name="t"><input name="i" onchange="a()"> </form>
</body>

that works, but it's not valid html. If you change <html> to this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

then suddenly that code wont work. It wont work because it was invalid
all along - I'm supposed to use document.getEle mentById("i"), but if I
was just throwing together a hack for a tips website, maybe I wouldn't
care.


No, you don't use getElementById to gain access to a form by its name.
You use the forms collection:

document.forms['formNAME'].elements['elementNAME'].value;

You went from one IE-only example to another IE-only example.
So you see, the problem isn't really compatibility. It's often
validity.


No, it's im/proper accessing that is the problem, along with validity
but more times than not, its crappy script writing.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 3 '05 #7
nikki said the following on 10/3/2005 4:51 PM:
Randy Webb wrote:
nikki said the following on 10/3/2005 3:31 PM:
Please quote what you are replying to, it makes following the
conversatio n easier.
Yeah, I forgot all about that.
I wish Google had both "reply" links quote.

(and look, people CAN remind me nicely...go figure)


I wish this were already in the FAQ though, it seems to be a major
problem for Google users:

<FAQENTRY>
If you want to post a followup via groups.google.c om, don't use
the "Reply" link at the bottom of the article. Click on "show
options" at the top of the article, then click on the "Reply" at
the bottom of the article headers.
</FAQENTRY>
Actually, I wish I had Gravity and a news server back, but the new job,
she blocks news servers and downloads.

Grab a few that are easy to modify for FF use and modify them.


In order to know what is "easy to modify for FF" it requires a level of
understandi ng that you wouldn't need to find copy/paste scripts, you
would already know how to write your own.

This is true.
And kind of what I was getting at, really.

Or go to dynamicdrive.co m and make sure you look specifically for
cross-browser scripts.


Dynamic Drive is just as bad, if not worse, than either of the ones
mentioned.

Oh, I don't know.
It has some bad stuff, but I like a few of their cross-browser scripts.
Then again, some people are really picky. ;)

How about posting links to sites you think are good, then?


Personally, I have the same opinion that Jim Ley has. I don't like
canned copy/paste scripts. I would rather write a specific script for a
specific case.

But that aside, I honestly don't know of any "good" sites that have
copy/paste scripts.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 3 '05 #8
ch************* ***@gmail.com wrote:
bert76 wrote:
time and again you have to try out, test it only to
find it only works in IE.
A big part of the problem, I think, is that so much of what
you find on the web are hacks, instead of good well-written
code. Most of it was probably written years ago too.

Take for example this:

<html>
<head>
<script>functio n a (){ alert(t.i.value ) }</script>
</head>
<body>
<form name="t"><input name="i" onchange="a()"> </form>
</body>
As HTML 4 transitional the only invalid aspects of that mark-up appear
to be the absence of a TITLE element and a missing TYPE attribute in the
SCRIPT element. Neither of those errors would impact upon the behaviour
of the script in any real-world browsers.
that works,
Well, it doesn't. Assuming that a named form will be made available as a
named property of the global object is a bad habit aquifer because it is
true of IE browsers. It was never true of a significant proportion of
other browsers. That script never would have worked in a Netscape
browser, for example.
but it's not valid html. If you change <html> to this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
That is seriously disingenuous. Asking any script to survive the
transition from HTML to XHTML is very optimistic, as the XHTML DOM
requires a style of scripting that is very distinct from that required
for an HTML DOM. Asking HTML mark-up to successfully pass through an XML
parser is totally unrealistic.
then suddenly that code wont work.
Given that the original script was aimed at proprietary features of IE's
object model, and IE doesn't support/render XHTML at all, that isn't a
particularly unexpected change, though very few non-trivial scripts
would survive the transition form an HTML DOM to an XHTML DOM anyway.
It wont work because it was
invalid all along -
The invalidity in the original is not a factor in determining whether
that script would work or not.
I'm supposed to use document.getEle mentById("i"),
There are no elements in the original mark-up that have the ID "i", so
that would not be a useful change to make. The W3C HTML DOM specified
(and very back-compatible) - document.forms - collection is the place to
look-up forms by name (and/or ID, in W3C DOM implementations ), and the -
elements - collection of the form is the place to look-up named (and/or
IDed, in W3C DOM implementations ) form controls.

<snip> So you see, the problem isn't really compatibility.
It's often validity.


You haven't made your point at all. There are plenty of opportunities to
demonstrate invalid mark-up (particularly structurally invalid mark-up)
having a detrimental impact upon the scripted interaction with the
resulting DOM, particularly around the invalid placement of forms within
TABLE elements, but this 'example' is most likely to detract from a
case for the use of valid mark-up.

Richard.
Oct 3 '05 #9
bert76 a écrit :
can anyone suggest a couple of websites providing *compatible*
javascript?
The thing is if you use web standards compliant DOM attributes and
methods, chances are your webpage will be working as expected on all
modern browsers.
of course there is
http://javascript.internet.com/
Deprecated, rusted pages, full of invalid markup code and invalid CSS
code, full of poor, wrong coding practices, etc..
http://javascriptkit.com/
and the likes, but time and again you have to try out, test it only to
find it only works in IE.
Yep.
at school, we want to test a number of javascripts, preferably
compatible with *all* browsers (mainly, but not just firefox).
tnx for suggestions

Using Web Standards in Your Web Pages
(in particular the dom access section)
http://www.mozilla.org/docs/web-deve...upgrade_2.html

Mozilla Web Author FAQ
http://www.mozilla.org/docs/web-developer/faq.html

http://www.digital-web.com/articles/...rowsers_part1/
http://www.digital-web.com/articles/...rowsers_part2/

Making your web page compatible with Mozilla
(will show some differences in supported event object models)
http://www.reloco.com.ar/mozilla/compat.html

My website:
http://www.gtalbot.org/DHTMLSection/
will work for all modern browsers, although I have used hacks to
workaround incompatibiliti es

Gérard
--
remove blah to email me
Oct 6 '05 #10

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

Similar topics

4
17994
by: realraven2000 | last post by:
Hi, my colleague coded the following onclick events with Javascript which only seem to fire in IE not in firefox. The checkboxes are built in Form frmProdDet while looping through a recordset (ncount=0..1..2..n) of Stock Items. The idea is to prefill quantity of ordered items with 1 when buy checkbox is checked, and to empty it when cleared. I put in alert for testing displays in IE fine, not in fx. My guess its a syntactical problem.
6
30045
by: scot_nery | last post by:
I got this working in all browsers but FF/NS. It's not picking up the event to find the mouse position. In a perfect world, you mouse over the link and a mouse bubble pops up. Thanks for help. scot
6
18285
by: Justin Beasley | last post by:
Here is an answer for those who are looking for a keystroke evaluation script that works in Internet Explorer (IE 5.5, 6.0, 7.0 for PC--IE 4.0, 5.2 for Mac), Mozilla Firefox (Windows, Linux, and Apple Macintosh), Safari, Opera, and other off-brand web browsers. I have gone through many groups trying to find code that didn't break in Firefox--yet still worked in other browsers. Although many people give input on this topic, few are...
2
1819
by: John | last post by:
I've been working on making my ASP.NET web apps compatible with Firefox (the uplevel configs for web.config are a real help). However, one really weird thing is a GotoAnchor() function I have (server side), which injects javascript along the lines of: location = '#buttons'; I use this so that, following postback, I can just back down to the relevant part of the page.
19
10552
by: k.karthikit | last post by:
Hello all, In some hidden variable (<input type="hidden" name="hiddenId" value="test" /> ,i stored some value.I accessed the value "test" using var id = document.getElementById( 'hiddenId' ); It is working fine in IE. But in Mozilla Firefox , null value is returned.Is there any way to use hidden variables compatible to browsers......?
1
271
by: gouri.misra | last post by:
Hi, Seems i have an error and i cant find a way around it. Using firefox whenever i try to assign the value from a grid to a textbox using: contrTxtName.value = eval("contrDgProductGroups.rows.cells."+textValue); where textValue = textContent when the browser type is firefox.
2
1861
by: Serena | last post by:
I have a problem whit this script. It is compatible with IE but isn't with Firefox. The error are: 1) "e has no properties" at----- "if(e.pageX || e.pageY) {" 2) "document.getElementById()" at------> "popText0.style.visibility="visible" Help me please Serena
1
1638
by: Shahin | last post by:
Hi, The following code works fine in IE, but in Firefox it does not: <SCRIPT LANGUAGE="JavaScript" <!--src="change_image.js"--> function changeImage(filename,image_id) { mainimage.src = filename; document.getElementById("img1").style.visibility = "hidden"; document.getElementById("img2").style.visibility = "hidden";
1
1462
by: break9 | last post by:
I have a form that I uses javascript and <tr> tags to display or hide form fields. The problem is that Firefox won't acknowledge or pass any variables from any fields that were hidden when the page originally loaded. any help is appreciated. here is the javascript; var containerTag = 'TR'; var compatible = ( document.getElementById && document.getElementsByTagName && document.createElement && !(navigator.userAgent.indexOf('MSIE...
0
8997
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
8833
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
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...
1
9335
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
9256
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...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
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
3
2218
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.