I just noticed that prototype.js is one of the files in the Ajax.NET
distribution - I'm pretty concerned about this. Does anyone know if this
is the same "prototype. js" that is not well-liked around here?
If so, do you know if Ajax.NET can be used without prototype.js?
--
"The most convoluted explanation that fits all of the made-up facts is
the most likely to be believed by conspiracy theorists. Fitting the
actual facts is optional." 31 3190
Tony said the following on 6/28/2006 2:00 PM: I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype. js" that is not well-liked around here?
All it would take is to compare the file size and the first 10 lines or
so to see if they are the same.
If so, do you know if Ajax.NET can be used without prototype.js?
That would required testing it without prototype to see if it still
"works" or not.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices -
Randy Webb wrote: Tony said the following on 6/28/2006 2:00 PM:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype. js" that is not well-liked around here?
All it would take is to compare the file size and the first 10 lines or so to see if they are the same.
If so, do you know if Ajax.NET can be used without prototype.js?
That would required testing it without prototype to see if it still "works" or not.
Obviously, I was hoping to hear from someone who had already been
through this experience :)
--
"The most convoluted explanation that fits all of the made-up facts is
the most likely to be believed by conspiracy theorists. Fitting the
actual facts is optional."
Tony wrote: the same "prototype. js" that is not well-liked around here?
It's not well-liked? I think it can be really useful, as long as you
know what you're getting into when you use it and code accordingly.
IMHO, saying it's inherently bad is like saying the C++ STL is bad.
Sure, it's not part of the language per se, but if you want to make use
of the functionality it provides then what's the harm?
Just don't expect that any Prototype-independent libraries will still
work (although there are only a few problems that it causes - most
notably with for-in loops, which don't seem to be that widely used, and
in any case should never be used with any pre-assumptions about what
members they will discover).
Am I missing some big "gotcha" that's turned the community against this
library?
Jeremy
Jeremy wrote: Tony wrote:
the same "prototype. js" that is not well-liked around here? It's not well-liked?
Based on a number of posts I've read over the past month or so, yes.
I think it can be really useful, as long as you know what you're getting into when you use it and code accordingly.
Perhaps, but that is a different discussion.
IMHO, saying it's inherently bad is like saying the C++ STL is bad.
I didn't say it was inherently bad. My question (that you didn't quote,
BTW) was if the Ajax.net one was the same one.
Sure, it's not part of the language per se, but if you want to make use of the functionality it provides then what's the harm?
And if I DON'T want to make use of it?
Am I missing some big "gotcha" that's turned the community against this library?
Take a look through this group's recent discussions on the matter, or
see http://www.javascripttoolbox.com/bes...ces/#prototype for a
quick summary.
So, are they the same?
--
"The most convoluted explanation that fits all of the made-up facts is
the most likely to be believed by conspiracy theorists. Fitting the
actual facts is optional."
Jeremy wrote: Just don't expect that any Prototype-independent libraries will still work (although there are only a few problems that it causes - most notably with for-in loops, which don't seem to be that widely used, and in any case should never be used with any pre-assumptions about what members they will discover).
That is quite an assumption.
If I do:
var name = {'first':'bob'} ;
and then cycle through its properties, I expect to see 'first' and only
'first'. Otherwise, using an Object as a "Hash Table" isn't possible.
Am I missing some big "gotcha" that's turned the community against this library? http://www.javascripttoolbox.com/bes...ces/#prototype
--
Matt Kruse http://www.JavascriptToolbox.com http://www.AjaxToolbox.com
Matt Kruse wrote: If I do: var name = {'first':'bob'} ;
and then cycle through its properties, I expect to see 'first' and only 'first'. Otherwise, using an Object as a "Hash Table" isn't possible.
So why not use an Array as a "Hash Table"? Is that not what it's for?
Note: I'm not trying to be a jerk or come off as dense; I'm genuinely
interested. Does the ECMAScript specification require that an object
not have inherent properties, or that these properties not show up in a
for..in loop? The specification is pretty lax on that, and I would
argue that you shouldn't be relying on those assumptions in order for
your program to work.
Incidentally, it seems like this particular problem ought to be fixable
by setting the DontEnum attribute of the methods and properties that
prototype.js adds to Object. But I really have no idea if this is
implemented in user-agents; I'm sure someone would have implemented into
the library if it were feasible. http://www.javascripttoolbox.com/bes...ces/#prototype
An interesting quote from your link:
"If you are writing code which only uses Prototype and nothing else,
then it can make your life simpler in often ingenious ways."
I'm not necessarily trying to argue that it's wise to use prototype.js -
I'm just arguing that the problems it causes are ALSO a symptom of
assumptions made by the people who diss it.
Jeremy
> Take a look through this group's recent discussions on the matter, or see http://www.javascripttoolbox.com/bes...ces/#prototype for a quick summary.
The fact that carelessly throwing in an otherwise useful script
framework might cause problems does not at all mean "the community is
against" it. Most people who use prototype improperly are probably
novices, and thus not active in "the community".
In my use, prototype has been very useful, and I also enjoy using the
effects libraries (e.g. rico) that are built on top of it.
Hi,
Jeremy wrote: So why not use an Array as a "Hash Table"?
JavaScript allows to add properties dynamically to any object type. You
could even use an Image if you want. However, Array and other types have
already defined properties (Array.length, for example), which will
appear when you do a for...in. Additionally, in the case of a
"hashtable" , these properties are unused, and disturb more than they
help. This is why it's better to use Object for a "hashtable" (but then
again, if someone external added properties to the Object prototype,
then you got the same problem, QED)
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Jeremy wrote: Matt Kruse wrote: If I do: var name = {'first':'bob'} ;
and then cycle through its properties, I expect to see 'first' and only 'first'. Otherwise, using an Object as a "Hash Table" isn't possible. So why not use an Array as a "Hash Table"? Is that not what it's for?
Absolutely not. the only thing that allows an Array to be used as a
"Hash Table" is the fact that arrays are instances of the native
ECMAScritp object, so it is their objectness that would be being
employed not their arrayness. Arrays are for referencing elements by
integer index, and automatically tracking the largest index assigned
with the length.
Note: I'm not trying to be a jerk or come off as dense; I'm genuinely interested. Does the ECMAScript specification require that an object not have inherent properties, or that these properties not show up in a for..in loop?
All of the specification defined properties of Arrays and Objects are
marked with the - DontEnum - attribute and for-in is specified as not
enumerating properties marked - DontEnum -.
The specification is pretty lax on that, and I would argue that you shouldn't be relying on those assumptions in order for your program to work.
I don't think the specification is lax in this area (See the last
sentence of paragraph 11 in ECMA 262, 3rd Ed. Section 15). Implementers
are allowed to add properties as extensions, but it would be careless of
them not to mark such extension properties - DontEnum - themselves, and
I don't know of any implementation extensions to Array or Object that do
show up in for-in loops.
Incidentally, it seems like this particular problem ought to be fixable by setting the DontEnum attribute of the methods and properties that prototype.js adds to Object.
You don't design good javascript code by wishing javascript was some
other language. It is quite clear that that the attributes of properties
are not intended for runtime modification (otherwise the - Internal -
attribute would be listed separately as it would not make sense for that
one to be modifiable).
It was a poor design decision in Prototype.js to extend the prototypes
of Object and Array, and its authors cannot excuse themselves with a
desire not be creating the extra objects necessary to extend Array and
Object further down the prototype chain (or by augmentation) as the
library itself continually creates and discards an excessive number of
superfluous objects as it runs.
But I really have no idea if this is implemented in user-agents; I'm sure someone would have implemented into the library if it were feasible.
It is not.
<snip> ... prototype.js - I'm just arguing that the problems it causes are ALSO a symptom of assumptions made by the people who diss it.
Like assuming that the language specification is not explicit about the
enumerability of the properties it defines?
Richard. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: chuck |
last post by:
Hi,
Firstly, I don't know if this is just and isolated thing with the
prototype.js library or
is a problem in general with ajax calls with a '+' character, so i am
posting it here.
I am trying to send input from a form to do a live php boolean
search. so an example
search string is
|
by: Chaprasi |
last post by:
Hi I need help with prototype while doing ajax calls. So this is my JS
which does a ajax calls
var ajax1 = new Ajax.Request (
url,
{
method: 'get',
parameters: params,
onComplete: showResults,
onFailure: showFailure
|
by: marc.fuehnen |
last post by:
hi everybody,
tried the framework and build a little SQL Update, triggered by a JS
function:
<a href="Javascript:updateData()"><img
src="../images/thumbs/thumb_blue.png" border="0" /></a>
<div id="yeah">
|
by: dougwig |
last post by:
I'm trying to handle the scenario where a user's session times out and
and their ajax request triggers a redirection by the webserver (302
error?).
I'm using Prototype 1.4 and the my works great with Firefox,but with
IE6 the onFailure never gets called and the request never completes.
My code:
var ajaxReq = new Ajax.Request( url, {method: 'post', parameters:
|
by: BeeRich |
last post by:
Hi folks.
I built an ajax.updater reply in a website on a Mac, and she works
fine. It's a simple reply, the html supplied is correct, and I also
supply the target DIV as well.
Just wondering why a PC won't show anything.
Cheers
| |
by: BG Mahesh |
last post by:
hi
We are looking for a good Ajax library which has very good support for
iframe. The ones we have considered so far are,
Backbase.com - not happy with the speed
Zapatech.com - it is good but doesn't have support for iframe
openreco.org - it is good but doesn't support iframe
Any pointers is appreciated. We are doing the development on Linux.
|
by: Dautkhanov |
last post by:
Hello !
Does anybody have cutted version of prototype.js with
the AJAX functionality only?
I am a new in prototype.js topic, so I think this task
should be done by other developers.
Maybe protorype.js should be splitted into small pieces
of the js scripts with groupped functionality
|
by: ext237 |
last post by:
Simple ajax call seems to have some issues in Firefox. The "onComplete:" is
called BEFORE the response is returned by the call. Is there a coding issue
or a work around?
var ajax = new Ajax.Request( url, {method: 'post', parameters: params,
onComplete: evalInfo });
function evalInfo( request )
{
// do stuff with request
|
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...
|
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,...
|
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...
| |
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |