Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Strange "Element undefined" problem

Reply
Thread Tools

Strange "Element undefined" problem

 
 
Daniel Breitner
Guest
Posts: n/a
 
      07-24-2009
Hi experts,

I get a strange Error "'Element' is undefined" in IE at
http://bbold.de/exercises/cryptic_cl...hp?exc=voltage
It also does not work in FF; seems same problem, although FF shows no
error at all. The funny (strange) thing is, that the *same* (!) code
is *running* on
http://demo2.wuwei-webservices.de/cr...hp?exc=voltage
Here you can see, what this eLearning exercise should do actually.

Since there it works fine, and on bbold.de not, where I simply wanted
to install a copy, I am out of my abilites. Please help!

Explanation to the line that IE complains about: (652 of page source)
Element.addMethods(WuweiElementExtensions);

WuweiElementExtensions is defined in the lines before, and then I
simply going to attach the functions defined there to the Element
object. This all is based on prototype framework. Why should Element
here be undefined?? (And not at the other domain with the same code?)

Thank you very much!!!
Daniel

*************

Marty - it's perfect! You're just not thinking fourth dimensionally!
[Emmett "Doc" Brown]

If you wish to email me, please use newsreply at wuwei minus webservices dot de
 
Reply With Quote
 
 
 
 
Matthias Reuter
Guest
Posts: n/a
 
      07-24-2009
> The funny (strange) thing is, that the *same* (!) code
> is *running* on


No it's not the same code.

> http://demo2.wuwei-webservices.de/cr...hp?exc=voltage


Here you embed Prototype at the beginning.

> http://bbold.de/exercises/cryptic_cl...hp?exc=voltage


Here you embed your code before Prototype. And it's generally a bad idea
to include scripts inline.

Matt
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      07-24-2009
Matthias Reuter wrote:
> [...] And it's generally a bad idea to include scripts inline.


Nonsense. "Embedding scripts inline" avoids the overhead created by
additional HTTP requests. Of course, it makes maintenance harder, so if
that approach is followed it should be done through a server-side script.

It is generally a bad idea to use Prototype.js, though.

And the OP's markup is not Valid.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
 
Reply With Quote
 
Gregor Kofler
Guest
Posts: n/a
 
      07-24-2009
Daniel Breitner meinte:

[snip]

> This all is based on prototype framework.


Here is the problem.

> Why should Element
> here be undefined?? (And not at the other domain with the same code?)


Not only the code - I assume the markup should be identical, too.

> Thank you very much!!!


You are welcome.

BTW Firebug tells me:

Element.addMethods is not a function
http://bbold.de/exercises/cryptic_cl...hp?exc=voltage
Line 652

Selector is undefined
http://bbold.de/exercises/cryptic_cl...hp?exc=voltage
Line 4099


Gregor


--
http://www.gregorkofler.com
http://web.gregorkofler.com - vxJS, a JS lib in progress
 
Reply With Quote
 
Jorge
Guest
Posts: n/a
 
      07-24-2009
On Jul 24, 2:00*pm, Thomas 'PointedEars' Lahn <(E-Mail Removed)>
wrote:
> Matthias Reuter wrote:
> > [...] And it's generally a bad idea to include scripts inline.

>
> Nonsense. *"Embedding scripts inline" avoids the overhead created by
> additional HTTP requests. (...)


.... and precludes the benefits of caching.

--
Jorge.
 
Reply With Quote
 
Daniel Breitner
Guest
Posts: n/a
 
      07-24-2009
On Fri, 24 Jul 2009 13:52:54 +0200, "Matthias Reuter"
<(E-Mail Removed)> wrote:


uh. thank u. i will check that out soon. if you are right (which i
dont doubt), how could this happen... (question just to myself =)

*************

Marty - it's perfect! You're just not thinking fourth dimensionally!
[Emmett "Doc" Brown]

If you wish to email me, please use newsreply at wuwei minus webservices dot de
 
Reply With Quote
 
Daniel Breitner
Guest
Posts: n/a
 
      07-24-2009
On Fri, 24 Jul 2009 14:00:14 +0200, Thomas 'PointedEars' Lahn
<(E-Mail Removed)> wrote:

| Of course, it makes maintenance harder, so if
|that approach is followed it should be done through a server-side script.
|

which is the case, btw. (Reason for this decision was to avoid
cross-domain problems, iirc. Scripts reside on different domains but
on same machine.)

|It is generally a bad idea to use Prototype.js, though.

Because... ?

Everyone here agrees to PointedEars?



*************

Marty - it's perfect! You're just not thinking fourth dimensionally!
[Emmett "Doc" Brown]

If you wish to email me, please use newsreply at wuwei minus webservices dot de
 
Reply With Quote
 
Gregor Kofler
Guest
Posts: n/a
 
      07-24-2009
Daniel Breitner meinte:
> On Fri, 24 Jul 2009 14:00:14 +0200, Thomas 'PointedEars' Lahn
> <(E-Mail Removed)> wrote:


> |It is generally a bad idea to use Prototype.js, though.
>
> Because... ?


Search this group. Has been discussed more than once.

> Everyone here agrees to PointedEars?


The majority.

> *************
> [snip]


Please use a correct sig separator.

Gregor



--
http://www.gregorkofler.com
http://web.gregorkofler.com - vxJS, a JS lib in progress
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      07-28-2009
Daniel Breitner wrote:
> Thomas 'PointedEars' Lahn wrote:
> | Of course, it makes maintenance harder, so if
> |that approach is followed it should be done through a server-side script.


The `|' character should be reserved for quotations from third-party sources
(like documentation). Use `>' for in-thread quotations.

> which is the case, btw. (Reason for this decision was to avoid
> cross-domain problems, iirc. Scripts reside on different domains but
> on same machine.)


There are no cross-domain problems with script resources, though; you may
include scripts from different domains (as you may include images from
different domains), the SOP does not apply here as it is about documents.

> |It is generally a bad idea to use Prototype.js, though.
>
> Because... ?


See my sig (not so random this time).

> Everyone here agrees to PointedEars?


Probably not everyone, but many.

> *************
>
> Marty - it's perfect! You're just not thinking fourth dimensionally!
> [Emmett "Doc" Brown]


I like that quote (one of my favorites), but I would like it better in a
properly delimited signature (so that it would be recognized as such). Use
dash-dash-space-newline instead of asterisks-newline, and keep your
signature to 4 lines (not counting the delimiter).

> If you wish to email me, please use newsreply at wuwei minus webservices dot de


If you wish to participate in Usenet, learn about the rules that apply here.
Home-improvement-like descriptions on how to reach you are not included.
Use the Reply-To header, but make sure that the From header of your posting
also specifies a mailbox (see RFCs 1036 and 2822).


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$(E-Mail Removed)>
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      07-28-2009
In comp.lang.javascript message <(E-Mail Removed)>, Tue,
28 Jul 2009 08:52:04, Thomas 'PointedEars' Lahn <(E-Mail Removed)>
posted:
>Daniel Breitner wrote:
>> Thomas 'PointedEars' Lahn wrote:
>> | Of course, it makes maintenance harder, so if
>> |that approach is followed it should be done through a server-side script.

>
>The `|' character should be reserved for quotations from third-party sources
>(like documentation). Use `>' for in-thread quotations.


In which current RFC is that use of "|" to be found?


>I like that quote (one of my favorites), but I would like it better in a
>properly delimited signature (so that it would be recognized as such). Use
>dash-dash-space-newline instead of asterisks-newline, and keep your
>signature to 4 lines (not counting the delimiter).


With which current RFC are your sigs compliant?


>> If you wish to email me, please use newsreply at wuwei minus
>>webservices dot de

>
>If you wish to participate in Usenet, learn about the rules that apply here.
> Home-improvement-like descriptions on how to reach you are not included.
>Use the Reply-To header, but make sure that the From header of your posting
>also specifies a mailbox (see RFCs 1036 and 2822).



And also, Daniel, learn to disregard chronic control-freakery; Usenet
attracts certain of the psychologically disturbed.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AVG Email Scanner activating at strange times with strange IP addresses dennispublic@hotmail.com Computer Support 1 08-26-2006 04:27 AM
strange problem John Wireless Networking 4 02-14-2005 05:40 PM
Problem installing modules on redhat 9 - strange connection problem championsleeper Perl Misc 0 01-26-2005 12:19 PM
Strange error! Compiler problem? Or code problem?!!!!!!! Pedro Miguel Carvalho C++ 2 10-25-2004 02:06 PM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments