The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
Eugene Hourany <ehour... @gmail.com>
Date: Thu, 5 Nov 2009 17:25:30 -0800
Local: Thurs, Nov 5 2009 8:25 pm
Subject: Some basic basic stuff
Hi all,
I'm tearing my hair out trying to figure out why I keep getting a "element is null" error. Here's what my code looks like:
$('firstname').hide();
and I have
<input id="firstname" name="firstname" value="" />
and I get
Error: $("firstname") is null Source File: file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html# Line: 14
I'm doing this locally from my desktop. I'm using prototype 1.6.1.
I also would like to know how to open a json file for reading and parse it.
Thanks!
Eugene
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"T.J. Crowder" <t... @crowdersoftware.com>
Date: Fri, 6 Nov 2009 05:47:02 -0800 (PST)
Local: Fri, Nov 6 2009 8:47 am
Subject: Re: Some basic basic stuff
Hi,
It sounds like you're not succeeding in loading Prototype or something
else you're loading is conflicting with it, I suggest checking your
script tags. The code you've quoted and the HTML you've quoted should
work, provided Prototype is getting loaded.
FWIW,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com
On Nov 6, 1:25 am, Eugene Hourany <ehour... @gmail.com> wrote:
> Hi all,
> I'm tearing my hair out trying to figure out why I keep getting a "element
> is null" error. Here's what my code looks like:
> $('firstname').hide();
> and I have
> <input id="firstname" name="firstname" value="" />
> and I get
> Error: $("firstname") is null
> Source File:
> file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html#
> Line: 14
> I'm doing this locally from my desktop. I'm using prototype 1.6.1.
> I also would like to know how to open a json file for reading and parse it.
> Thanks!
> Eugene
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
bill <will... @TechServSys.com>
Date: Sat, 07 Nov 2009 14:49:46 -0500
Local: Sat, Nov 7 2009 2:49 pm
Subject: Re: [Proto-Scripty] Some basic basic stuff
Eugene Hourany wrote:
> Hi all,
> I'm tearing my hair out trying to figure out why I keep getting a > "element is null" error. Here's what my code looks like:
> $('firstname').hide();
> and I have
> <input id="firstname" name="firstname" value="" />
> and I get
> Error: $("firstname") is null > Source File: > file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html# > Line: 14
> I'm doing this locally from my desktop. I'm using prototype 1.6.1.
do you have the input declaration before the execution of the
"$('firstname').hide();"
If you execute the js before the input is declared, the id will not exist.
bill
-- Bill Drescher william {at} TechServSys {dot} com
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
kstubs <kst... @gmail.com>
Date: Sat, 7 Nov 2009 13:45:13 -0800 (PST)
Local: Sat, Nov 7 2009 4:45 pm
Subject: Re: Some basic basic stuff
Try naming the ID attribute different than the NAME attribute.
On Nov 7, 12:49 pm, bill <will... @TechServSys.com> wrote:
> Eugene Hourany wrote:
> > Hi all,
> > I'm tearing my hair out trying to figure out why I keep getting a
> > "element is null" error. Here's what my code looks like:
> > $('firstname').hide();
> > and I have
> > <input id="firstname" name="firstname" value="" />
> > and I get
> > Error: $("firstname") is null
> > Source File:
> > file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html#
> > Line: 14
> > I'm doing this locally from my desktop. I'm using prototype 1.6.1.
> do you have the input declaration before the execution of the
> "$('firstname').hide();"
> If you execute the js before the input is declared, the id will not exist.
> bill
> --
> Bill Drescher
> william {at} TechServSys {dot} com
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Eugene Hourany <ehour... @gmail.com>
Date: Sun, 8 Nov 2009 23:04:25 -0800
Local: Mon, Nov 9 2009 2:04 am
Subject: Re: [Proto-Scripty] Re: Some basic basic stuff
I never put in a name attribute, that could be part of the problem.
I solved it by putting it in a function that's called by onclick, and it
worked. I was able to reference it the old fashioned JS way, and prototype's
way.
Now all I want to know is how to load and parse a JSON file using the same
method.
Thanks!
Eugene
On Sat, Nov 7, 2009 at 1:45 PM, kstubs <kst
... @gmail.com> wrote:
> Try naming the ID attribute different than the NAME attribute.
> On Nov 7, 12:49 pm, bill <will... @TechServSys.com> wrote:
> > Eugene Hourany wrote:
> > > Hi all,
> > > I'm tearing my hair out trying to figure out why I keep getting a
> > > "element is null" error. Here's what my code looks like:
> > > $('firstname').hide();
> > > and I have
> > > <input id="firstname" name="firstname" value="" />
> > > and I get
> > > Error: $("firstname") is null
> > > Source File:
> > > file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html#
> > > Line: 14
> > > I'm doing this locally from my desktop. I'm using prototype 1.6.1.
> > do you have the input declaration before the execution of the
> > "$('firstname').hide();"
> > If you execute the js before the input is declared, the id will not
> exist.
> > bill
> > --
> > Bill Drescher
> > william {at} TechServSys {dot} com
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Alex McAuley" <webmas... @thecarmarketplace.com>
Date: Mon, 9 Nov 2009 07:35:30 -0000
Local: Mon, Nov 9 2009 2:35 am
Subject: Re: [Proto-Scripty] Re: Some basic basic stuff
Its happening because (as someone pointed out in a previous reply) the DOM node does not exist yet .....
you need to wrap the code in observers...
for example...
Event.observe(window,'load',function() {
$('TheElementToHideObserver').observe('click',function() {
$('firstname').hide();
});
});
//Then your html
<input type="submit" id="TheElementToHideObserver" value="Hide First Name" />
<hr />
<input type="text" name="firstname" id="firstname" />
....
Simple as that
HTH
Alex Mcauley
http://www.thevacancymarket.com
----- Original Message -----
From: Eugene Hourany
To: prototype-scriptaculous@googlegroups.com
Sent: Monday, November 09, 2009 7:04 AM
Subject: [Proto-Scripty] Re: Some basic basic stuff
I never put in a name attribute, that could be part of the problem.
I solved it by putting it in a function that's called by onclick, and it worked. I was able to reference it the old fashioned JS way, and prototype's way.
Now all I want to know is how to load and parse a JSON file using the same method.
Thanks!
Eugene
On Sat, Nov 7, 2009 at 1:45 PM, kstubs <kst... @gmail.com> wrote:
Try naming the ID attribute different than the NAME attribute.
On Nov 7, 12:49 pm, bill <will... @TechServSys.com> wrote:
> Eugene Hourany wrote:
> > Hi all,
> > I'm tearing my hair out trying to figure out why I keep getting a
> > "element is null" error. Here's what my code looks like:
> > $('firstname').hide();
> > and I have
> > <input id="firstname" name="firstname" value="" />
> > and I get
> > Error: $("firstname") is null
> > Source File:
> > file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html#
> > Line: 14
> > I'm doing this locally from my desktop. I'm using prototype 1.6.1.
> do you have the input declaration before the execution of the
> "$('firstname').hide();"
> If you execute the js before the input is declared, the id will not exist.
> bill
> --
> Bill Drescher
> william {at} TechServSys {dot} com
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
ColinFine <colin.f... @pace.com>
Date: Mon, 9 Nov 2009 05:34:41 -0800 (PST)
Local: Mon, Nov 9 2009 8:34 am
Subject: Re: Some basic basic stuff
On Nov 7, 9:45 pm, kstubs <kst... @gmail.com> wrote:
> Try naming the ID attribute different than the NAME attribute.
What difference would that make?
However, what I was going to suggest was checking that your id
'firstname' is unique in the page. Names can be duplicated, but id's
can't.
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
ColinFine <colin.f... @pace.com>
Date: Mon, 9 Nov 2009 05:57:29 -0800 (PST)
Local: Mon, Nov 9 2009 8:57 am
Subject: Re: Some basic basic stuff
On Nov 9, 7:04 am, Eugene Hourany <ehour... @gmail.com> wrote:
> I never put in a name attribute, that could be part of the problem.
No.
> Now all I want to know is how to load and parse a JSON file using the same
> method.
What's a JSON file?
JSON is a text representation of data which is pretty well identical
to Javascript's own notation, so you can parse it with eval().
However, if the JSON is coming from Ajax, it's already available to
you as a parsed object: see http://www.prototypejs.org/api/ajax/response
You must
Sign in before you can post messages.
You do not have the permission required to post.