Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #12730
| From | hipa <hipa.invalid@telenet.be> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: multiple dynamic text fields |
| Date | 2012-03-14 21:56 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <jjr45i$3rc$1@speranza.aioe.org> (permalink) |
| References | (5 earlier) <kisll7hog3lbuv6l7tb2l2ovp9oeivdj5q@4ax.com> <jjias1$aiv$1@speranza.aioe.org> <f4612afd-0c05-42ae-b66c-ba8f797ec901@v22g2000yqm.googlegroups.com> <jjo9g6$9of$1@speranza.aioe.org> <6325cb13-a1c2-447d-8ee8-710e481d4c0d@k29g2000yqc.googlegroups.com> |
Op Tue, 13 Mar 2012 15:36:23 -0700, schreef David Mark:
> On Mar 13, 4:08 pm, hipa <hipa.inva...@telenet.be> wrote:
>> Op Mon, 12 Mar 2012 20:16:17 -0700, schreef David Mark:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > On Mar 11, 9:55 am, hipa <hipa.inva...@telenet.be> wrote:
>> >> Op Sat, 10 Mar 2012 17:19:46 +1100, schreef Jeff North:
>>
>> >> > On Fri, 9 Mar 2012 18:46:34 +0000 (UTC), in comp.lang.javascript
>> >> > hipa <hipa.inva...@telenet.be>
>> >> > <jjdj6a$5e...@speranza.aioe.org> wrote:
>>
>> >> >>| Op Fri, 09 Mar 2012 17:38:23 +1100, schreef Jeff North: | | > In
>> >> >>your getuser.php file remove all the fluff that is before <?php
>> >> >>and |
>> >> >>> after ?>
>> >> >>| >
>> >> >>| > See if that helps.
>> >> >>|
>> >> >>| Still the same.
>>
>> >> > The only think left is there might be an error in the scriptpg.js
>> >> > file which is causing the non-execution of all the scripts on the
>> >> > page.
>>
>> >> I found the problem.
>>
>> > A problem.
>>
>> >> I tested it while adding text fields true javascript, that also
>> >> didn't work. That got me thinking.
>>
>> > There is no such thing as "true Javascript". If you want to
>> > pigeonhole scripts, use good/bad qualifiers (e.g. jQuery contains bad
>> > Javascript).
>>
>> Can you explain this one?
>>
>> >> Everytime I add a text field I need to append .autocomplete. When
>> >> the autocomplete gets set up when the page loads it will not work on
>> >> a text field that is dynamically added. So this is what I do.
>>
>> >> $("#addButton").click(function () {
>>
>> > document.getElementById('addButton').onclick = function() {
>>
>> Nothing happens when I click the button.
>
> Sorry, I assumed you were further along. You have to piece it all
> together:
>
> document.getElementById('addButton').onclick = function() {
> // Put the rest in here
> };
>
Yes I know that, I looked over the closing parentheses at the end. Works
now, thanks!
>
>> > Feel free to write a wrapper for gEBI if you are worried about typing
>> > (shouldn't be). Will just slow things down, but not nearly to the
>> > extent that jQuery does. It's one function call vs. hundreds and
>> > function calls are expensive.
>>
>> How is that?
>
> Because jQuery is very poorly written. I recently posted some examples
> of this on the JSPerf site, pitting one-liner cross-browser functions
> vs. My Library (a four-year-old library) vs. jQuery. Unbelievably,
> jQuery was consistently 10-100 times slower at basic tasks. Attaching
> listeners was particularly slow (not to mention awkward). Not long
> after, they copied my concise on/off methods, but I doubt that syntactic
> sugar improved their performance any. :(
>
> http://jsperf.com/browse/david-mark
> http://jsperf.com/adding-and-removing-listeners-part-2
>
I'll take a look at this one, but have the feeling that you are far more
advanced than me :-)
>> And why is jQuery so bad? I find the autocomplete function pretty handy
>> :-)
>
> I don't believe that's a jQuery function. Alone, jQuery does little more
> than queries and "event normalization" (quotes indicate there's no
> "normal" for events like change). Hell, they don't even allow for
> setting the - this - object without calling an additional "proxy"
> function. :(
>
>
>> >> $('#article' + counter + '').autocomplete('datapg.php?
>> >> mode=sqlarticle', {width: 200, max: 10});
>>
>> > You'd be better off with no widget at all as anything built atop
>> > jQuery is highly suspect (it's too slow, not cross-browser and has a
>> > terrible DOM abstraction layer). If that's unacceptable, hand this
>> > part off to somebody else (preferably not a jQuery enthusiast).
>>
>> Oh you explained it :-)
>> How would someone else do it. I could off course also just cut the
>> jQuery part.
>
> Well, if you have thousands of rows that need to populate a dropdown of
> some sort, you will need something along the lines of an
> autocomplete/suggest. Somebody more familiar with DOM scripting
> (particularly keyboard handling) should be able to bang one out in a day
> or two.
That sounds logical, when thousands of rows need to populate a dropdown.
I kept this in mind, my db isn't very big. It can/will grow, but not to
the extend of thousands and thousands of records.
> A canned widget for jQuery is going to be hampered by jQuery and is
> likely to include lots of unneeded features as those projects aim to
> appeal to as many users as possible. This is because of ego and a myth
> that the presence of lots of users ensures a bug-free script (all those
> eyes and all). :)
>
>
>>
>>
>> >> counter++;
>>
>> > That works. :)
>>
>> Thanks for the reply!
>
> NP.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-04 13:00 +0000
Re: multiple dynamic text fields Jeff North <jnorthau@yahoo.com.au> - 2012-03-05 14:33 +1100
Re: multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-08 18:14 +0000
Re: multiple dynamic text fields Jeff North <jnorthau@yahoo.com.au> - 2012-03-09 17:38 +1100
Re: multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-09 18:46 +0000
Re: multiple dynamic text fields Jeff North <jnorthau@yahoo.com.au> - 2012-03-10 17:19 +1100
Re: multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-11 13:55 +0000
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-12 20:16 -0700
Re: multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-13 20:08 +0000
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 15:36 -0700
Re: multiple dynamic text fields Andrew Poulos <ap_prog@hotmail.com> - 2012-03-14 10:51 +1100
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 18:12 -0700
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 18:55 -0700
Re: multiple dynamic text fields Andrew Poulos <ap_prog@hotmail.com> - 2012-03-14 15:05 +1100
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 21:38 -0700
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 21:56 -0700
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 22:49 -0700
Re: multiple dynamic text fields Andrew Poulos <ap_prog@hotmail.com> - 2012-03-14 17:05 +1100
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 00:23 -0700
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 22:06 -0700
Re: multiple dynamic text fields Andrew Poulos <ap_prog@hotmail.com> - 2012-03-14 17:07 +1100
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 00:28 -0700
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 22:11 -0700
Re: multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-14 21:56 +0000
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 14:58 -0700
Re: multiple dynamic text fields hipa <hipa.invalid@telenet.be> - 2012-03-15 06:27 +0000
Re: multiple dynamic text fields David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 23:46 -0700
csiph-web