I'm a super-beginner at J.S.: I never wrote any JavaScript before
From: "Razzbar" <
[email protected]>
You have <div id = " daPlace">
--------------------^ (an extra space).
No I don't. You're halucinating. I connected via that URL in your
copied text from my posting (which I've recopied above here), looked at
source, and it showed exactly this:
<div id = "daPlace"></div>
I suspect you bumped the space bar while you had the source in some
text editor and didn't notice you'd changed it, then looked carefully
and saw the space. Try that URL again and see.
Anyway, this afternoon I was on campus where I had access to online Web
browsers, and I wanted to see whether the innerHTML usage for the div
daPlace would work on any of the browsers available there (IE and
Mozilla Firesomething on desktop, true Mozilla and old obsolete version
of Netscape available only deep inside the START menus). So I went to
my Tripod site, skipped over all the top-of-page banner ads, closed all
the pop-up ads that were on top of my Web page, and noticed that none
of the text field/area had anything at all in them, which means the
page load javascript didn't happen. And when I clicked on the buttons
nothing at all happened, so *everything* U had created was non-working.
There happened to be a JavaScript expert available, and she copied the
source from the Tripod page to a local file, omitting the Tripod ads
(except she failed to copy the <html> and </html> tags, which we'll see
later was a crucial mistake). So then when we tried a browser on that
local copy the JavaScript Math arithmetic was working, but the
innerHTML and java.math.BigInteger was still broken. But then I used
FTP to get the original file from my Unix shell account, and when I
double-clicked on that in Windows both the JavaScript Math stuff and
the innerHTML were working, while the java.math.BigInteger was still
broken.
Her explanation of the final result was that:
- The JavaScript Math stuff is standard JavaScript, so that's why it
works everywhere (except from Tripod where the banner ads somehow break
JavaScript totally).
- The innerHTML stuff is a new feature not yet known at the time my
1999 version of Netscape on my laptop was programmed, so that's why it
didn't work on my laptop. But all the versions of browsers at DeAnza,
even the old obsolete Netscape they have hidden away, are new enough to
have innerHTML installed.
- My use of java.math.BigInteger is something that was correct way back
in 1999 when my old version of Netscape was written, but it's no longer
correct so none of the new browsers support it. (Do you perhaps know
what the current way is for doing that?) I found it described in that
online croczilla JavaScript reference manual:
http://www.croczilla.com/~alex/reference/javascript_ref/java.html#1193137
See what it says there? What it says works fine in my very old 1999
version of Netscape, but not in anything newer, sigh. Is there a more
up to date reference manual that I should be using instead of the very
very out-of-date croczilla manual?
So anyway, at that point she suggested I host my JavaScript pages on
some site that doesn't have banner ads, such as Geocities, so then I
updated my file to have static text in daPlace that said no button has
yet been pushed, and set innerHTML sets in all four buttons to say
which button was pressed (as I originally intended), tested it locally
(it all works!!), and uploaded the updated file to my Geocities
account, and tried it: It worked from there exactly the same as from
local file. So here's the URL:
http://www.geocities.com/rem642b/JavaScript/js1.html
Please try it in your Web browser and let me know what parts of it work
as-is.
Hmm, I notice that it says the toplevel 'java' object is a synonym for
Packages.java, so maybe if I replace java.math.BigInteger by
Packages.java.math.BigInteger, it'll still work in my old Netscape but
will also work in newer browsers? Let me try it in my old Netscape
right now before posting this ... yup, I've made that change locally on
my laptop, and Packages.java.math.BigInteger works just exactly the
same as java.math.BigInteger in my very old Netscape. I can't upload
the new file to Geocities because they discontinued their FTP server a
couple years ago so there's now way to upload from Unix, and there's no
point uploading the new version to my Tripod site where you suffer all
those problems with banner ads, so please do this: Connect to my
Geocities copy where everything works except it's still using
java.math.BigInteger instead of the more correct
Packages.java.math.BigInteger, and check to see if everything except
that works, then patch your own private copy of the source to make that
Packages fix, and see if the BigInteger stuff now works for you.
Thursday I'll be campus again where I'll be able to upload to my
Geocities account, but I'd like you to try my stuff before then,
because Thursday is the last day of classes (final exam is next
Tuesday), and if I upload something Thursday and it doesn't work I'll
never again have a chance to fix it.