Re: [jQuery] Next generation WYSIWYG editor... maybe? am I missing something?

2006-11-15 Thread Jörn Zaefferer
> Ok, it's very simple indeed, and doesn't actually let you edit anything!!
> However, the idea is that you can designate a div as the 'editor' and then
> within this you can drop elements (I would imagine having a drop zone at
> the
> bottom?) for example:
> 
>- p tag
>- h1-h4 etc
>- ul
>- image
>- definition list
>- various other stuff (e.g. a google map)
> 
> Each of these elements would have an associated content editor for it. For
> example an h1 would just have a 1 line text box, a p a text area, an image
> a
> number of controls for src, alt, size etc.
> 
> It's my thought at the moment that I will use ajax to save back updates
> and
> re-ordering so that there is essentially no 'save' process.
> 
> Does anyone have any thoughts on this? Perhaps I'm barking up totally the
> wrong tree.

I like the idea. You could create additional non-trivial elements like code 
(consists of pre/code tags) or more complex "widgets" like tabs, accordion menu.

There are already several plugins available that support inline editing.

For the property editor (eg. for image src, size, alt) a leight modal dialog 
would be great: It could be associated with a double click and is displayed 
somewhere near the element. For numbers (size) and slider widget could be 
used...

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
> In the case of the checkboxes, if you check two boxes and use
> [EMAIL PROTECTED]
> fieldValue will only show the first value. That would need to go into the
> array case like the select-multiple. But, if there is only one box checked
> (or just one box with that name) should it return a simple value or an
> array
> with one value? If it sometimes returns an array and sometimes not, that
> would complicate using the return value.

I'm for returning always an array for checkboxes. That allows you to check for 
the array's length to see if anything was selected, and that works even with 
one checkbox.

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Klaus Hartl
Jörn Zaefferer schrieb:
>> I still think that using a namespace and providing a short cut like $A
>> is the best way to handle this, instead of extending the element or
>> prototype. I think we could even get chaining to work properly if we
>> really wanted too. We could also probably provide a way to extend the
>> prototype if users really wanted it.
> 
> I'd really like to hear other's opinions about this topic. John? Mike? Klaus? 
> If you read this: Say something!
> 
> I think jQuery is a lot about promoting best practice. Find the best approach 
> for a certain aspect and promote that approach, instead of providing every 
> way and as much flexibility as you can think of. The latter used to happen a 
> lot in the java enterprise enviroment and is pretty ugly.
> 
> It's great to have to opportunity to discuss it here at expense :-)

I've read once somewhere (was it Crockford?) that you "should not extend 
a language with its own features". I'm not that strict and think as long 
as we don't touch the object we're fine. Using for/in on an array is bad 
style and yes, I don't think jQuery should take into acount other's bad 
coding style. Making jQuery dummy safe would be an endless process, so - 
agreed - better promote best practice and be helpful on the list if 
questions appear.

It seems to be a trend to use and if required port the new Array 
functions of JavaScript 1.6. I like that if it's done wisely:

if ( !Array.prototype.forEach ) {
   // add sugar
}

That won't overwrite existing implementations. That could also be done 
for other additional functions. Although I already foresee the question: 
"Why, your Array.whatever function does not work as described in the 
documentation" on the list, if some other library uses the same name. 
But at least for the 1.6 methods there should be no clash.

Dustin Diaz did that already here:
http://www.dustindiaz.com/sugar-arrays/

I like the prototype approach more than using a helper method like $A 
etc. and/or the namespace approach, because to me it kind of feels more 
natural using a method on the array object immediatly.

If we don't go that route I'm for the namespace implementation, that 
looks as the cleanest solution to me.

$.array.whatever() is better readable to me than $A...


Hey, very clever to extend the objects itself! Does it make sense to 
have chainability for these methods? I can't see how to use that at the 
moment.


-- Klaus



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Next generation WYSIWYG editor... maybe? am I missing something?

2006-11-15 Thread Brandon Aaron
We use XStandard sometimes.
http://xstandard.com/

--
Brandon Aaron

On 11/15/06, Tom Holder <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I've been getting increasingly frustrated by the flexibility and output from
> all of the WYSIWYG editors available for the web so I want to try and build
> an editor experience for our 2nd generation of CMS that will achieve the
> following:
>
> Integrate in to our sites without requiring CSS tweaks to get it looking
> correct - this means no iframes.
> Produce strict XHTML every time without fail.
> Be simple to use.
> Be quick to load and run.
> Limit scope for the user to mess up their site design.
> I want to try and use JQuery to achieve all of the above (and hopefully a
> bit more). To see the foundation of my editor have a look at:
>
>  http://www.simpleweb-online.co.uk/stage/editor/test.htm
>
> Ok, it's very simple indeed, and doesn't actually let you edit anything!!
> However, the idea is that you can designate a div as the 'editor' and then
> within this you can drop elements (I would imagine having a drop zone at the
> bottom?) for example:
>
> p tag
> h1-h4 etc
> ul
> image
> definition list
> various other stuff (e.g. a google map)Each of these elements would have an
> associated content editor for it. For example an h1 would just have a 1 line
> text box, a p a text area, an image a number of controls for src, alt, size
> etc.
>
> It's my thought at the moment that I will use ajax to save back updates and
> re-ordering so that there is essentially no 'save' process.
>
> Does anyone have any thoughts on this? Perhaps I'm barking up totally the
> wrong tree.
>
> Tom
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread dave.methvin



malsup wrote:
> 
> I've taken a stab at adding fieldValue and fieldSerialize to the form
> plugin.  Please let me know if this impl makes sense.  I also
> refactored ajaxSubmit so that it passes its options arg on to the
> $.ajax method (so any $.ajax options flow right through).
> 
> I've got a test page up here:  http://malsup.com/jquery/form/field.html
> 

The value for the Hidden field is "hiddenValue" and not "secret". :)

In the case of the checkboxes, if you check two boxes and use [EMAIL PROTECTED]
fieldValue will only show the first value. That would need to go into the
array case like the select-multiple. But, if there is only one box checked
(or just one box with that name) should it return a simple value or an array
with one value? If it sometimes returns an array and sometimes not, that
would complicate using the return value.

Selectors that select multiple form elements will only return the first
value for fieldValue, but serialize all the values. That's a more general
case of the checkbox dilemma above. Methods like .attr and .css escaped from
that by only dealing with the first element in the jQuery object, but that
won't work here, at least for some form element types.





-- 
View this message in context: 
http://www.nabble.com/%24.val%28%29-limited-in-functionality--tf2633751.html#a7371092
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Next generation WYSIWYG editor... maybe? am I missing something?

2006-11-15 Thread Stephen Howard
I'm all for entheusiasm, but have you looked at tinyMCE?  What 
shortcomings does it have that you are trying to address?

http://tinymce.moxiecode.com/

- Stephen

Tom Holder wrote:
> Hi everyone,
>
> I've been getting increasingly frustrated by the flexibility and 
> output from all of the WYSIWYG editors available for the web so I want 
> to try and build an editor experience for our 2nd generation of CMS 
> that will achieve the following:
>
> * Integrate in to our sites without requiring CSS tweaks to get it
>   looking correct - this means no iframes.
> * Produce strict XHTML every time without fail.
> * Be simple to use.
> * Be quick to load and run.
> * Limit scope for the user to mess up their site design.
>
> I want to try and use JQuery to achieve all of the above (and 
> hopefully a bit more). To see the foundation of my editor have a look at:
>
> http://www.simpleweb-online.co.uk/stage/editor/test.htm
>
> Ok, it's very simple indeed, and doesn't actually let you edit 
> anything!! However, the idea is that you can designate a div as the 
> 'editor' and then within this you can drop elements (I would imagine 
> having a drop zone at the bottom?) for example:
>
> * p tag
> * h1-h4 etc
> * ul
> * image
> * definition list
> * various other stuff (e.g. a google map)
>
> Each of these elements would have an associated content editor for it. 
> For example an h1 would just have a 1 line text box, a p a text area, 
> an image a number of controls for src, alt, size etc.
>
> It's my thought at the moment that I will use ajax to save back 
> updates and re-ordering so that there is essentially no 'save' process.
>
> Does anyone have any thoughts on this? Perhaps I'm barking up totally 
> the wrong tree.
>
> Tom
> 
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>   

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Next generation WYSIWYG editor... maybe? am I missing something?

2006-11-15 Thread Tom Holder

Hi everyone,

I've been getting increasingly frustrated by the flexibility and output from
all of the WYSIWYG editors available for the web so I want to try and build
an editor experience for our 2nd generation of CMS that will achieve the
following:

  - Integrate in to our sites without requiring CSS tweaks to get it
  looking correct - this means no iframes.
  - Produce strict XHTML every time without fail.
  - Be simple to use.
  - Be quick to load and run.
  - Limit scope for the user to mess up their site design.

I want to try and use JQuery to achieve all of the above (and hopefully a
bit more). To see the foundation of my editor have a look at:

http://www.simpleweb-online.co.uk/stage/editor/test.htm

Ok, it's very simple indeed, and doesn't actually let you edit anything!!
However, the idea is that you can designate a div as the 'editor' and then
within this you can drop elements (I would imagine having a drop zone at the
bottom?) for example:

  - p tag
  - h1-h4 etc
  - ul
  - image
  - definition list
  - various other stuff (e.g. a google map)

Each of these elements would have an associated content editor for it. For
example an h1 would just have a 1 line text box, a p a text area, an image a
number of controls for src, alt, size etc.

It's my thought at the moment that I will use ajax to save back updates and
re-ordering so that there is essentially no 'save' process.

Does anyone have any thoughts on this? Perhaps I'm barking up totally the
wrong tree.

Tom
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


RE: [jQuery] [jQuery-es] Cambiar cosas cuando la página cargue

2006-11-15 Thread Reynier Perez Mira
Hola nuevamente David y Choan:
Por más que leo y miro el código no logro entenderlo pues soy un poco novato 
con jQuery y de Javascript no se mucho, lo he usado un poco en validaciones 
pero con el boom de la Web2.0 veo que se pueden hacer cosas increíbles. ¿Me 
pueden dar un "norte" para guiarme  y ver que hace el código? 
Nota: Lo puse en la página y no vi ningún cambio 
Salu2 y desde ya gracias
--
ReynierPM
5to Ing. Informática
Maestro de poco, aprendiz de mucho
-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de David Arango
Enviado el: miércoles, 15 de noviembre de 2006 2:40 pm
Para: jQuery Discussion.
Asunto: Re: [jQuery] [jQuery-es] Cambiar cosas cuando la página cargue

On 11/15/06, Reynier Perez Mira <[EMAIL PROTECTED]> wrote:
> ¿Qué se supone que haga esta función y donde debo ponerla? La entendí más o
> menos pero algunas cosas no me quedaron claras del todo.

Esa función debes ponerla en un archivo javascript que debes linkar en
tu página web por medio del elemento 

Re: [jQuery] new plugin: window (+DEMO)

2006-11-15 Thread Su
Webunity|Gilles van den Hoven wrote:
> After i've done a lot (+8 weeks!) of work on the window class it's now 
> ready to be released to the public for beta testing. I'm hoping to 
> release this plugin at the same time jQuery 1.1 becomes available, but 
> all bugs have to be squised off course.

Sexy!
This actually looks like exactly what I'll need for a client project 
that's just barely starting up. (Read: Finish, and I'll throw money at 
you *grin*) There's an existing site they're taking their ideas from, 
but it's build using Prototype, which I don't much look forward to 
learning how to deal with.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> > That sounds like a good solution to me. It puts the form code with other
> > form code.
> >
> > I just started using the form plugin today and noticed that it doesn't pass
> > along the error callback in ajaxSubmit. I've changed my local copy but I
> > suspect others might want that as well.
>
> That's a great point, Dave.  Maybe I should just pass along the
> original options object (slightly modified) to the ajax method.


I've taken a stab at adding fieldValue and fieldSerialize to the form
plugin.  Please let me know if this impl makes sense.  I also
refactored ajaxSubmit so that it passes its options arg on to the
$.ajax method (so any $.ajax options flow right through).

I've got a test page up here:  http://malsup.com/jquery/form/field.html

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> That sounds like a good solution to me. It puts the form code with other
> form code.
>
> I just started using the form plugin today and noticed that it doesn't pass
> along the error callback in ajaxSubmit. I've changed my local copy but I
> suspect others might want that as well.

That's a great point, Dave.  Maybe I should just pass along the
original options object (slightly modified) to the ajax method.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> I still think that using a namespace and providing a short cut like $A
> is the best way to handle this, instead of extending the element or
> prototype. I think we could even get chaining to work properly if we
> really wanted too. We could also probably provide a way to extend the
> prototype if users really wanted it.

I'd really like to hear other's opinions about this topic. John? Mike? Klaus? 
If you read this: Say something!

I think jQuery is a lot about promoting best practice. Find the best approach 
for a certain aspect and promote that approach, instead of providing every way 
and as much flexibility as you can think of. The latter used to happen a lot in 
the java enterprise enviroment and is pretty ugly.

It's great to have to opportunity to discuss it here at expense :-)

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] new plugin: window (+DEMO)

2006-11-15 Thread Jörn Zaefferer
> After i've done a lot (+8 weeks!) of work on the window class it's now 
> ready to be released to the public for beta testing. I'm hoping to 
> release this plugin at the same time jQuery 1.1 becomes available, but 
> all bugs have to be squised off course.

Well, whatever may come, you were quite succesful in building a hype around 
your project.

> The plugin makes use of my cssHover plugin ( 
> http://gilles.jquery.com/cssHover/ ) and some of the plugins uit of the 
> interface pack ( http://interface.eyecon.ro/ ). This way, i didn't have 
> to rewrite code again. So thanks Stefan for your work on interface, it 
> made this plugin possible.

You simply have to love the use of the transfer effect! Very cool.

> There is a demo page online at my jQuery site: 
> http://gilles.jquery.com/window/
> 
> Please be advised not yet to use this plugin, since it may contain bugs, 
> even though i have tried to keep it to a minimum. The documentation is 
> in the source code and below in this email.

Most bugs can only be found when people start using stuff...

> Known issues:
> - The iframe hack isn't added yet, because that caused a massive 
> performance drop in MSIE. Doesn't cover select boxes yet.

That performance drop should be the same for Thickbox and alike. Why isn't it 
an issue there?

> - There is currently only one theme available (XP Aqua), but there will 
> be more before i release the plugin so you see how to make your own.

That would be great. The XP Aqua look is not that great: Even if the client 
uses Windows XP, there is no way to tell if he actually uses that theme or 
designs at all.

But it would be very useful to see more examples for themes.

> - Only one callbacks yet: onLoad, suggestions are welcome

Consider using custom events whenever your code doesn't "care" for listeners. 
To decide that: Does the behaviour of your code change when the callback is 
provided? If yes, stick to the callback. If no, bind handlers to custom events 
and either create a new method to trigger that event or just reuse an existing 
event. Though "load" wouldn't be a good idea.

> - Minimize/maximize functionality

Maximize is a little fuzzy with limited maximum size.

> - Windows behaviour: doubleclick titlebar to maximize or restore if 
> minimized

To finetune the behaviour: Set a default pointer for the text inside the 
titlebar (instead of text selection pointer). Dunno if that is even possible, 
but would be nice.

> - Stays in center if you say so, as long as the titlebar wasn't dragged.
> - When maximized, the window remains in view when you scroll the page

That is a little odd. When maximized, I'd think that there is no page to see 
that could be scrolled.

> Other than that, you can set a lot of options:
> - Use transfer effects (explode / implode)

Demo please!

> - Opacity
> - Restricted to parent

Demo!

To quote King Crimson: The more I look at it, the more I like it!

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
This is an interesting topic and you make a good point. I suppose the
question is, are we going to use prototype or not? When I originally
suggested using namespaces I didn't mean to extend the object as well
as use a namespace. I personally don't think it is a good idea for a
library to 'pollute' the global object ... especially if we want to be
compatible with other libraries and be future proof.

I still think that using a namespace and providing a short cut like $A
is the best way to handle this, instead of extending the element or
prototype. I think we could even get chaining to work properly if we
really wanted too. We could also probably provide a way to extend the
prototype if users really wanted it.

--
Brandon Aaron


On 11/15/06, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote:
> > > Won't that cause the same problems when used with for-in loops?
> >
> > Yes, but only on the object itself and for/in shouldn't be used for
> > arrays. I don't believe there should be a conflict.
>
> My words for not using for-in. But if the problem can occur on the object 
> again, I don't really see the win here.
>
> While I can understand that there are libraries using for-in loops on arrays, 
> I see no reason to not extent the String prototype. It saves you a lot of 
> trouble and is pretty and clean.
>
> I think adding this:
> String.prototype.trim = function() { ... }
>
> Is much cleaner then $.trim(...)
>
> Iterating over Strings doesn't make much sense, so there is no problem with 
> for-in loops.
>
> While we are at it: jQuery doesn't promote usage of "bad code". Take the 
> shadowed XMLHttpRequest: If a library uses that for browser checks, it will 
> give a wrong result. It may not occur as often as for-in loops on arrays, but 
> basically it's the same problem.
>
> I have implemented some extensions for String here: 
> http://fuzz.bassistance.de/sandbox/string.js
> It consists of trim, camelize, startsWith (supports offset), endsWith and 
> some isXXX checks like isAlpha, isUpper, isDigit.
>
> --
> Jörn Zaefferer
>
> http://bassistance.de
>
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> > I propose we break these out into their own plugins. Have a
> > plugins/methods/strings, plugins/methods/arrays, etc.
> 
> I also propose that we check to make sure the $A, $S, etc are not
> currently being used and if they are, archive it in _$A, _$S, etc.
> 
> if ( typeof $A != "undefined" )
>   var _$A = $A;
> $A = jQuery.fn.arrays;

I really don't like that at all :/ See my oter reply for some more details...

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> > Won't that cause the same problems when used with for-in loops?
> 
> Yes, but only on the object itself and for/in shouldn't be used for
> arrays. I don't believe there should be a conflict.

My words for not using for-in. But if the problem can occur on the object 
again, I don't really see the win here.

While I can understand that there are libraries using for-in loops on arrays, I 
see no reason to not extent the String prototype. It saves you a lot of trouble 
and is pretty and clean.

I think adding this:
String.prototype.trim = function() { ... }

Is much cleaner then $.trim(...)

Iterating over Strings doesn't make much sense, so there is no problem with 
for-in loops.

While we are at it: jQuery doesn't promote usage of "bad code". Take the 
shadowed XMLHttpRequest: If a library uses that for browser checks, it will 
give a wrong result. It may not occur as often as for-in loops on arrays, but 
basically it's the same problem.

I have implemented some extensions for String here: 
http://fuzz.bassistance.de/sandbox/string.js
It consists of trim, camelize, startsWith (supports offset), endsWith and some 
isXXX checks like isAlpha, isUpper, isDigit.

--
Jörn Zaefferer

http://bassistance.de

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread John Resig
> I could probably do a run through of the code and
> reduce the size of the download by a couple hundred KB, no problem.

couple hundred BYTES! That'd be one heck of an optimization!

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread John Resig
> Personally, 19k is tiny to me compared to the others out there.  Even 25k
> would be tiny still.  However, I think the form handling is something that
> makes sense to rely on a plugin.

My personal goal for jQuery is to have it be smaller in size
(compressed) than Prototype (compressed) and MooTools (compressed).

These are the current numbers:

Prototype:
19239 bytes (1.4.0)
25393 bytes (1.5.0_rc1)

MooTools (with Function, Array, String, Element, Fx, Dom, Ajax,
Window, Fxpack, Fxutils, and Fxtransitions selected):
19128 bytes (rev 83)

jQuery:
19019 bytes (1.0.3)
19098 bytes (SVN)

As you can see, jQuery's size is getting really close to Prototype
1.4.0 and Mootools. I could probably do a run through of the code and
reduce the size of the download by a couple hundred KB, no problem.
Just squeezing beyond that point will require that something be
removed.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] new plugin: window (+DEMO)

2006-11-15 Thread Christopher Jordan




Gilles,

That looks great! I notice that the demo page isn't accounting for the
IE select box bug. Is that just an oversight of the demo page or what?

Cheers,
Chris

Webunity | Gilles van den Hoven wrote:

  Hi guys,

After i've done a lot (+8 weeks!) of work on the window class it's now 
ready to be released to the public for beta testing. I'm hoping to 
release this plugin at the same time jQuery 1.1 becomes available, but 
all bugs have to be squised off course.

The plugin makes use of my cssHover plugin ( 
http://gilles.jquery.com/cssHover/ ) and some of the plugins uit of the 
interface pack ( http://interface.eyecon.ro/ ). This way, i didn't have 
to rewrite code again. So thanks Stefan for your work on interface, it 
made this plugin possible.

There is a demo page online at my jQuery site: 
http://gilles.jquery.com/window/

Please be advised not yet to use this plugin, since it may contain bugs, 
even though i have tried to keep it to a minimum. The documentation is 
in the source code and below in this email.

Known issues:
- Not tested in IE7, Opera and Safari, but IE6 and FFX work
- The iframe hack isn't added yet, because that caused a massive 
performance drop in MSIE. Doesn't cover select boxes yet.
- There is currently only one theme available (XP Aqua), but there will 
be more before i release the plugin so you see how to make your own.
- Only one callbacks yet: onLoad, suggestions are welcome
- Unknown if it leaks in MSIE, if so, please advise where and i'll fix it

A few highlights:
- Fully themable, including active/non active state.
- Multiple dialogs on 1 page, automatic z-indexing
- Modal dialogs
- Minimize/maximize functionality
- Draggable/Resizable
- Windows behaviour: doubleclick titlebar to maximize or restore if 
minimized
- Stays in center if you say so, as long as the titlebar wasn't dragged.
- When maximized, the window remains in view when you scroll the page

Other than that, you can set a lot of options:
- Minimum size
- Maximum size
- Title bar width when minimized
- Use transfer effects (explode / implode)
- Initial state: minimized / normal / maximized
- Opacity
- Restricted to parent

Read the code for more ;)

-- Gilles


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Dave Methvin
> I'd propose something like $().fieldValue() and $().fieldSerialize
> be added to the form plugin.  Both could take an optional
> "successful only" argument indicating if non-successful controls
> should be ignored.  fieldValue() would return the value of the
> first matched element, in array form if necessary.  fieldSerialize
> could build a query string of all matched elements.

That sounds like a good solution to me. It puts the form code with other
form code.

I just started using the form plugin today and noticed that it doesn't pass
along the error callback in ajaxSubmit. I've changed my local copy but I
suspect others might want that as well.

At first I thought the dilemma on semantic order versus performance could be
easily solved by using the form.elements collection, but that collection
doesn't include button or [EMAIL PROTECTED] elements. Darn.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread John Resig
> > Fully agree! Providing a full release for newbies and as reference
> > for documentation on the one hand and a custom build for further
> > needs should be just fine. As soon as you are familiar enough with
> > jQuery tp use the custom build, you won't worry about missing methods
> > referenced in the documentation because you removed them on your own.
>
> I second that.

I third this.

While the main "package" will be a little bit heftier, I think it'll
be much more beneficial (and saner to answer questions, in general).

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] new plugin: window (+DEMO)

2006-11-15 Thread Webunity | Gilles van den Hoven
Hi guys,

After i've done a lot (+8 weeks!) of work on the window class it's now 
ready to be released to the public for beta testing. I'm hoping to 
release this plugin at the same time jQuery 1.1 becomes available, but 
all bugs have to be squised off course.

The plugin makes use of my cssHover plugin ( 
http://gilles.jquery.com/cssHover/ ) and some of the plugins uit of the 
interface pack ( http://interface.eyecon.ro/ ). This way, i didn't have 
to rewrite code again. So thanks Stefan for your work on interface, it 
made this plugin possible.

There is a demo page online at my jQuery site: 
http://gilles.jquery.com/window/

Please be advised not yet to use this plugin, since it may contain bugs, 
even though i have tried to keep it to a minimum. The documentation is 
in the source code and below in this email.

Known issues:
- Not tested in IE7, Opera and Safari, but IE6 and FFX work
- The iframe hack isn't added yet, because that caused a massive 
performance drop in MSIE. Doesn't cover select boxes yet.
- There is currently only one theme available (XP Aqua), but there will 
be more before i release the plugin so you see how to make your own.
- Only one callbacks yet: onLoad, suggestions are welcome
- Unknown if it leaks in MSIE, if so, please advise where and i'll fix it

A few highlights:
- Fully themable, including active/non active state.
- Multiple dialogs on 1 page, automatic z-indexing
- Modal dialogs
- Minimize/maximize functionality
- Draggable/Resizable
- Windows behaviour: doubleclick titlebar to maximize or restore if 
minimized
- Stays in center if you say so, as long as the titlebar wasn't dragged.
- When maximized, the window remains in view when you scroll the page

Other than that, you can set a lot of options:
- Minimum size
- Maximum size
- Title bar width when minimized
- Use transfer effects (explode / implode)
- Initial state: minimized / normal / maximized
- Opacity
- Restricted to parent

Read the code for more ;)

-- Gilles


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
On 11/15/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> I propose we break these out into their own plugins. Have a
> plugins/methods/strings, plugins/methods/arrays, etc.

I also propose that we check to make sure the $A, $S, etc are not
currently being used and if they are, archive it in _$A, _$S, etc.

if ( typeof $A != "undefined" )
var _$A = $A;
$A = jQuery.fn.arrays;

--
Brandon Aaron

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] parsing JSON with $.each

2006-11-15 Thread Kevin Old
For the archives, I was actually able to get what I want.  I didn't
have valid key/value pairs in JSON, was just passing around an array.

I was able to change the append line to this:

$("#names").append("ID: " + this.id + " Name: " + this.name + "
Passwd: " + this.password + " Url: " + this.email_address + "" );

Hope this helps someone,
Kevin

On 11/15/06, Kevin Old <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm parsing some json successfully below, but I'd like to be able
> access the contents of the json object like "this.["id"]" or
> "this.["name"]".
>
> function processData(json) {
> $.each(json, function(i) {
> $("#names").append("ID: " + this[0] + " Name:
> " + this[1] + " Passwd: " + this[2] + " Url: " + this[3] + "" );
> }
> );
> }
>
> Just wondering if anyone knows how to do it that way.
>
> Thanks,
> Kevin
>
> Kevin Old
> [EMAIL PROTECTED]
>


-- 
Kevin Old
[EMAIL PROTECTED]

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] parsing JSON with $.each

2006-11-15 Thread Michael Geary
> From: Kevin Old
> 
> I'm parsing some json successfully below, but I'd like to be 
> able access the contents of the json object like 
> "this.["id"]" or "this.["name"]".
> 
> function processData(json) {
> $.each(json, function(i) {
> $("#names").append("ID: " + this[0] + " Name:
> " + this[1] + " Passwd: " + this[2] + " Url: " + this[3] + "" );
> }
> );
> }
> 
> Just wondering if anyone knows how to do it that way.

Well, you don't really "parse" JSON. By the time you look at it, it's just a
JavaScript object, so you have to access it using whatever JavaScript
corresponds to the way that object is structured.

It sounds like your json object is an array of arrays, e.g.

[
[
"my id",
"my name",
"my password",
"my url"
],
[
"your id",
"your name",
"your password",
"your url"
]
]

Is that correct?

To use it the way you want, it needs to be an array of objects instead:

[
{
"id": "my id",
"name": "my name",
"password": "my password",
"url": "my url"
},
{
"id": "your id",
"name": "your name",
"password": "your password",
"url": "your url"
}
]

Then your code could read:

function processData(json) {
$.each(json, function() {
$("#names").append(
"ID: " + this.id +
" Name: " + this.name +
" Passwd: " + this.password +
" Url: " + this.url +
"" );
});
}

Or, for better performance in most browsers:

function processData(json) {
$.each(json, function() {
$("#names").append( [
"ID:", this.id,
"Name:", this.name,
"Passwd:", this.password,
"Url:", this.url,
""
].join(' ') );
});
}

If you can't change the format of the JSON data you're receiving, but you
still want to use the more convenient this.id instead of this[0], you can
convert it to an array of objects yourself. Let me know if you'd like sample
code for that.

-Mike


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
I propose we break these out into their own plugins. Have a
plugins/methods/strings, plugins/methods/arrays, etc.

--
Brandon Aaron

On 11/15/06, Paul Bakaus <[EMAIL PROTECTED]> wrote:
> :P
>
> by the way, there's a first version in the SVN, in plugins/methods ! Feel
> free to add something.
>
> 2006/11/15, Brandon Aaron <[EMAIL PROTECTED] >:
> >
> > On 11/15/06, Paul Bakaus <[EMAIL PROTECTED] > wrote:
> > > Even chaining does work then.
> >
> >  chaining... :)
> >
> > --
> > Brandon Aaron
> >
> > ___
> > jQuery mailing list
> > discuss@jquery.com
> > http://jquery.com/discuss/
> >
>
>
>
> --
> Paul Bakaus
> Web Developer
> 
> Hildastr. 35
>  79102 Freiburg
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
On 11/15/06, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote:
> Won't that cause the same problems when used with for-in loops?

Yes, but only on the object itself and for/in shouldn't be used for
arrays. I don't believe there should be a conflict.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [jQuery-es] Cambia r cosas cuando la página cargue

2006-11-15 Thread David Arango
On 11/15/06, Reynier Perez Mira <[EMAIL PROTECTED]> wrote:
> ¿Qué se supone que haga esta función y donde debo ponerla? La entendí más o
> menos pero algunas cosas no me quedaron claras del todo.

Esa función debes ponerla en un archivo javascript que debes linkar en
tu página web por medio del elemento 

[jQuery] parsing JSON with $.each

2006-11-15 Thread Kevin Old
Hello everyone,

I'm parsing some json successfully below, but I'd like to be able
access the contents of the json object like "this.["id"]" or
"this.["name"]".

function processData(json) {
$.each(json, function(i) {
$("#names").append("ID: " + this[0] + " Name:
" + this[1] + " Passwd: " + this[2] + " Url: " + this[3] + "" );
}
);
}

Just wondering if anyone knows how to do it that way.

Thanks,
Kevin

Kevin Old
[EMAIL PROTECTED]

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> @Brandon:
> Could you possibly include this in the form plugin Mike?

Yes, I think this makes sense.

> @Jörn:
> I think it would be possible to split form's formToArray function: Extract a 
> formValue
> method(or whatever name you like) that is then used by formToArray but also
> available for other code, say... validation stuff.

I think I'd rather leave formToArray as is.  Matt Grimm put a lot of
great work into optimizing it and making it succinct.  Also, from a
form perspective, it needs to build the values inclusive of the
element name - field level value extraction doesn't need that, and in
the simplest case can simply return a single value.

I'd propose something like $().fieldValue() and $().fieldSerialize be
added to the form plugin.  Both could take an optional "successful
only" argument indicating if non-successful controls should be
ignored.  fieldValue() would return the value of the first matched
element, in array form if necessary.  fieldSerialize could build a
query string of all matched elements.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] cssHover update

2006-11-15 Thread Webunity | Gilles van den Hoven
Hi Guys,

I forgot to add one fix to SVN, its comitted now.

-- Gilles

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Jörn Zaefferer
> What exactly do you mean when you say the handler doesn't know which 
> argument is passed via trigger versus bind? Can you give me an example 
> of this so I can better understand the problem?

I try. I take my tooltip plugin as an example, because I can avoid binding 
stuff to DOM elements.

Currently, the individual tooltip settings are saved as a property on each 
tooltipped element:
.each(function() {
this.tSettings = settings;
})

That is ugly and may leak memory. Therefore I'd change to current bind to pass 
the settings:
.bind(mouseover, handle, settings);

Inside my "handle" function, I could now access the settings, and change this:
handle = function(event) {
if( this.tSettings.delay ) [...]

to:
handle = function(event, settings) {
if( settings.delay ) [...]

So far so good, but now I have an additional requirement: I need to trigger the 
handle event when I want to display the tooltip, eg. to display a message for 
an invalid form element. Because the event's mouse position can't be used to 
position the element, I need to pass an additional argument to indicate the 
position where the tooltip should appear.

Something like this:
$(invalidElement).trigger("mouseover", objectWithPositionInformation);

To rewrite my handler:
handle = function(event, settings, triggerOption) { ...

Now what if the handler is used with another event, and no "settings" is 
passed? How to decide what inside which parameter?

I'd prefer a solution where this question is absolutely clear. One solution 
would be to put that data into the event object:

handle = function(event) {
  // use event.bind to access settings, use event.trigger to access 
triggerOption...

The big drawback: That additional data has to be cleared after the handler was 
executed to prevent memory leaks. But that can pose a problem when the data is 
accessed inside a closure...

I hope that makes the problem clear. Any ideas?

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
> I'm just going to reply to myself ... I'm a little confused by the
> proposal of an .attrs() method and it seems unnecessary and using
> selectors is more than I want to remember or type. Getting ride of
> .val() is fine by me but there *needs* to be a method to serialize a
> single form element. Could you possibly include this in the form
> plugin Mike? Just grabbing the value attribute of form elements will
> not always work on single selects and other form elements. These all
> need to be normalized and made *easy*.

I think it would be possible to split form's formToArray function: Extract a 
formValue method(or whatever name you like) that is then used by formToArray 
but also available for other code, say... validation stuff.

The idea about attrs would give us something like this:
$("select option:selected").attrs("value") - return an array with the value 
attribute of each element

The same as:
var values = [];
$("select option:selected").each(function() {
  values[values.length] = $(this).attr("value");
});

But this could be used with every attribute, not just form elements and values. 
I'm not sure if there is another usecase...

--
Jörn Zaefferer

http://bassistance.de

> 
> --
> Brandon Aaron
> 
> On 11/14/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> > I often times just need to know the value of one form element and
> > sometimes that could be a group of radio buttons, a select, a multiple
> > select or just a regular input. The current $.val() method is limited
> > only to inputs. I was curious if anyone else needed this funtionality
> > and if it should be in a plugin or in the core?
> >
> > --
> > Brandon Aaron
> >
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Why does this code not work?

2006-11-15 Thread jyl
Hopefully you put the jQuery code in the head section between
.. and after 


> Hi, all.
>
> Trying to grasp js and jQuery.why won't this code work?
> (No response on my test page at all to the code.)
>
> JQuery code:
>
> $(document).ready(function() {
>
> $("div.ann").find("p.title").hide().end().find("p.text").click(function()
> {
>  var answer = $(this).next();
>  if (answer.is(':visible')) {
>  answer.slideUp();
>  } else {
>  answer.slideDown();
>  }
>  });
> });
>
> HTML:
>
> 
>
> 
> This is my title.
> 
> 
> This is my text.
> 
>
> 
>
> ???
>
> Thanks,
>
> Rick
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Brandon Aaron
I'm just going to reply to myself ... I'm a little confused by the
proposal of an .attrs() method and it seems unnecessary and using
selectors is more than I want to remember or type. Getting ride of
.val() is fine by me but there *needs* to be a method to serialize a
single form element. Could you possibly include this in the form
plugin Mike? Just grabbing the value attribute of form elements will
not always work on single selects and other form elements. These all
need to be normalized and made *easy*.

--
Brandon Aaron

On 11/14/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> I often times just need to know the value of one form element and
> sometimes that could be a group of radio buttons, a select, a multiple
> select or just a regular input. The current $.val() method is limited
> only to inputs. I was curious if anyone else needed this funtionality
> and if it should be in a plugin or in the core?
>
> --
> Brandon Aaron
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> attr is not an alternative to val.  It flat out won't work in FF for
> textareas, selects or anything w/o a true "value" attribute.

Oops.  My apologies.  I was using a 1.0 version of jQuery for my test.
 Ignore the above.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Blair Mitchelmore
What exactly do you mean when you say the handler doesn't know which 
argument is passed via trigger versus bind? Can you give me an example 
of this so I can better understand the problem?

-blair

Jörn Zaefferer wrote:
>> The way I coded the trigger and handle functions in my system it worked 
>> like this (or at least it should. This is untested but theoretically 
>> sound and the way I intended for it to work).
>>
>> $().click(fn1,arg1,arg2);
>> $().click(fn2,arg3,arg4);
>> // someone clicks there
>> // fn1 runs with arguments [event,arg1,arg2]
>> // fn2 runs with args [event,arg3,arg4]
>> $().trigger('click');
>> // fn1 runs with args [event,arg1,arg2]
>> // fn2 runs with args [event,arg3,arg4]
>> $().trigger('click',arg5,arg6);
>> // fn1 runs with args [event,arg1,arg2,arg5,arg6]
>> // fn2 runs with args [event,arg3,arg4,arg5,arg6]
>>
>> To me this is the least surprising result, would you agree?
>
> No. The general idea of passing arguments via trigger and bind is to 
> modularize code. Think of a big system where you can't rely on closures. Or 
> where you want to pass arguments to a plugin via trigger. The event handler 
> maybe implemented by the user, while the argument to bind are coming from 
> plugin code and may change.
>
> With your implementation, the handler had no idea how to identify which 
> argument was passed via bind and which via trigger, but that is important.
>
> --
> Jörn Zaefferer
>
> http://bassistance.de

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] val() to erase the value

2006-11-15 Thread Karl Swedberg
On Nov 15, 2006, at 11:45 AM, Glen Lipka wrote:When I did this:$("#someInput").val(""); it made it null in FF but in IE it left it alone.How do I use val() to erase the current value?Hi Glen,I just tested this on my server, and it worked on both IE and FF.( http://test.learningjquery.com/dom-traversing.htm )HTML:          JQUERY:$(document).ready(function(){  $('#form_submit').click(function() {    $('#tester').val('');    $('#foo').val('');    return false;  });});Also, Mike Alsup mentioned in another thread that those two val() lines could be done like this instead:    $('#tester')[0].value = "";    $('#foo')[0].value = "";That worked for me, too.Karl___Karl Swedbergwww.englishrules.comwww.learningjquery.com___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> only a few of us who were confused), then maybe you're right about
> abandoning .val(). It doesn't have to leave the code base, but knowing that
> the .attr() is seemingly a better alternative is helpful.

attr is not an alternative to val.  It flat out won't work in FF for
textareas, selects or anything w/o a true "value" attribute.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery support for namespace attributes

2006-11-15 Thread Brandon Aaron
Namespaces are a lot more involved than everyone seems to think.
Support for this should first be made into a plugin and then if the
demand is high enough ... moved to the core.

--
Brandon Aaron

On 11/15/06, Dave Methvin <[EMAIL PROTECTED]> wrote:
> In an expression like this:
>
> myns|[EMAIL PROTECTED]|attr=whatever]
>
> How does myns get associated with the actual XML namespace URI?
> getElementByTagNameNS needs the URI, not the name. I have not needed
> namespaces before so I am not familiar with how that would work.
>
> As for how much code it takes, the only way to know for sure is to write it.
>
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan






Klaus Hartl wrote:

  
I know that it does what it says it does. That's not the point. The 
point is that it only works on the input element. I'm sorry, but I think 
that should be spelled out. Obviously a number of people thought it 
would retrieve the value of the selected option(s) in a select (or 
multiple select) box and that it would retrieve all text between the 
opening and closing textarea tags.

  
  
That's not true and the discussion goes into the wrong direction now: 
The val function works for selects, textareas and inputs:

  

I understand that now Klaus, and you're right. 
But, there were five or more posts to this thread before anyone stood
up and said that the original post was somewhat mistaken, and that
.val() *does* indeed work on selects (single ones anyway) and
textareas. My point since then has been that perhaps the API should
cover this method in better detail. 

Okay, I've been set straight on this method and Dave has supplied some
good information on the merrits of .attr(), so I'm off to lunch! :o)

Cheers,
Chris

  http://stilbuero.de/demo/jquery/val.html.

Wether that is buggy or not in one or the other browser is another 
question. I think the original concern was, that the val() function 
doesn't support values for multiple checked checkbox and selects...


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan




Dave,

Thanks for the detail. If .val() is this confusing (and maybe there are
only a few of us who were confused), then maybe you're right about
abandoning .val(). It doesn't have to leave the code base, but knowing
that the .attr() is seemingly a better alternative is helpful.

Chris

Dave Methvin wrote:

  
I know that it does what it says it does. That's not the point.
The point is that it only works on the input element. 

  
  
No, it will return the "value" attribute for any element. I think it would
have been clearer what was going on if .val() did not exist and people used
.attr("value") instead. 

  
  
I'm sorry, but I think that should be spelled out.
Obviously a number of people thought it would retrieve the
value of the selected option(s) in a select (or multiple select)
box and that it would retrieve all text between the opening
and closing textarea tags.

  
  
Agreed, that's one of my primary motivations for saying all the macro
properties should go. To save a few characters we've created a documention
burden and a much greater chance of misinterpretation. Plus, someone has to
implement all that special-case code if we really want it to work that way.

  
  
What would be wrong with adding those? There's probably a
perfectly good reason, I just don't know what it is. 

  
  
We already have one, albeit with a longer name. Grab the form plugin and
take a look at formToArray. It returns all the useful values out of a form
as name/value pairs. Since .val() is form-related it seems like this would
be the appropriate home for something fancier than .attr("value) usage.

  
  
The API also does not discuss here what this method
returns if the input is a check box or radio button. Does
it return that it is checked (like f.mycheckbox.checked)?

  
  
$("input:checkbox").val() will return the value of the checkbox whether it
is checked or not, since it is the same as
$("input:checkbox").attr("value"). In HTML the value attribute doesn't
change depending on whether the box is checked or not. You'd need to look at
$("input:checkbox").attr("checked") to determine that.

Again, I think this is just one more reason to abandon .val() because it is
much more confusing than .attr("value"); most people understand the concept
of getting the attribute of an element and it's not a jQuery-specific
concept.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Chris W. Parker
On Wednesday, November 15, 2006 9:47 AM "Jörn Zaefferer" <> said:

> Fully agree! Providing a full release for newbies and as reference
> for documentation on the one hand and a custom build for further
> needs should be just fine. As soon as you are familiar enough with
> jQuery tp use the custom build, you won't worry about missing methods
> referenced in the documentation because you removed them on your own.

I second that.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Klaus Hartl

> I know that it does what it says it does. That's not the point. The 
> point is that it only works on the input element. I'm sorry, but I think 
> that should be spelled out. Obviously a number of people thought it 
> would retrieve the value of the selected option(s) in a select (or 
> multiple select) box and that it would retrieve all text between the 
> opening and closing textarea tags.

That's not true and the discussion goes into the wrong direction now: 
The val function works for selects, textareas and inputs:

http://stilbuero.de/demo/jquery/val.html.

Wether that is buggy or not in one or the other browser is another 
question. I think the original concern was, that the val() function 
doesn't support values for multiple checked checkbox and selects...


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
> What about select-multiple?

This, of course, does not work.  val() will return the value of the
first selected option in this case.

Also note that simply adding a value attribute to something like a div
won't work cross-browser.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Enrique Meléndez
Ok , here goes my point of view:

My ideal Jquery first objectives are:

1. Writing Javascript code should be fun (CORE got it! Chainability, ...)
2. Resolve compatibility issues/behaviors with W3C Standards and browsers:
DOM, CSS + selectors, Javascript, XHTML, EVENTS and XMLHTTPRequest. So, for
that exist:
- DOM, 
- CSS [+ Dimensions plugin is included here as expected behavior], 
- EVENTS, 
- and little part of AJAX

but, please, avoiding redundances - just css(), attr(), bind(), etc.. - and
only CSS selectors... (trying to be written in an Standard way)

Above are ('problematic') features implemented in almost all browsers. So
that be part of the "lite" version.

Now new features, not implemented in main browsers at the same level (or at
all), which uses Jquery itself, in an "expanded" version:

1. Special selectors: XPath (working with XML), Customs,... 
2. Effects (animations)
3. Manipulating FORMS
4. Manipulating AJAX
4,5. Manipulating XML (AJAX+XPATH..??)??
5. shortcuts??? for css(), attr(), bind()
6. Plug-ins (in individual modules)

That's all, folks!

Enrique Meléndez Estrada



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan




Mike Alsup wrote:

  
 So this function *could* retrieve the value of the selected option in a
select box?

  
  
Better than *could* - it *does*.

  

Hmm... I was responding to this post:

On 11/14/06, Brandon Aaron <[EMAIL PROTECTED]>
wrote:
> I often times just need to know the value of one form element and
> sometimes that could be a group of radio buttons, a select, a
multiple

> select or just a regular input. The current $.val() method is
limited
> only to inputs. I was curious if anyone else needed this
funtionality
> and if it should be in a plugin or in the core?
>
> --
> Brandon Aaron

So, what about textareas?



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JSON Serializer

2006-11-15 Thread Mark Gibson
Alan Gutierrez wrote:
> The JSON methods here are so useful, I'm wondering why they are not
> part of the distribution? Is it the strange license?
> 
> * Christopher Jordan <[EMAIL PROTECTED]> [2006-11-13 10:54]:
> 
>> Mark Gibson has alreay hacked the json.js into a jQuery plug-in. I'm 
>> using it in my application, right now.
>>
>> Dotan Dimet wrote:
>>> I've got an earlier version of the JSON.org script (copyright 2005)
>>> which has a JSON.stringify()function. You can find it online in various
>>> places, by searching for either that or its "license" terms:
>>> "The Software shall be used for Good, not Evil."

Hi Alan,
My JSON serialize was original adapted from the one at:

http://www.json.org/json.js

which since appears to have been rewritten.

This new version appears to not have a license, copyright, or author,
so I guess it's public domain!

Before releasing my plugin, I was going to review to new code at
json.org to see if it can be used to improve the plugin - I just
haven't got around to it yet.
I notice that the new plugin appear to plonk a .toJSONString() method
on every builtin class, including Object - which isn't good as it
would screw up the use of Object as a key=>value map.

Feel free to grab my stuff, modify it and move it wherever you like.

- Mark Gibson.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Dave Methvin
> I know that it does what it says it does. That's not the point.
> The point is that it only works on the input element. 

No, it will return the "value" attribute for any element. I think it would
have been clearer what was going on if .val() did not exist and people used
.attr("value") instead. 

> I'm sorry, but I think that should be spelled out.
> Obviously a number of people thought it would retrieve the
> value of the selected option(s) in a select (or multiple select)
> box and that it would retrieve all text between the opening
> and closing textarea tags.

Agreed, that's one of my primary motivations for saying all the macro
properties should go. To save a few characters we've created a documention
burden and a much greater chance of misinterpretation. Plus, someone has to
implement all that special-case code if we really want it to work that way.

> What would be wrong with adding those? There's probably a
> perfectly good reason, I just don't know what it is. 

We already have one, albeit with a longer name. Grab the form plugin and
take a look at formToArray. It returns all the useful values out of a form
as name/value pairs. Since .val() is form-related it seems like this would
be the appropriate home for something fancier than .attr("value) usage.

> The API also does not discuss here what this method
> returns if the input is a check box or radio button. Does
> it return that it is checked (like f.mycheckbox.checked)?

$("input:checkbox").val() will return the value of the checkbox whether it
is checked or not, since it is the same as
$("input:checkbox").attr("value"). In HTML the value attribute doesn't
change depending on whether the box is checked or not. You'd need to look at
$("input:checkbox").attr("checked") to determine that.

Again, I think this is just one more reason to abandon .val() because it is
much more confusing than .attr("value"); most people understand the concept
of getting the attribute of an element and it's not a jQuery-specific
concept.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
> >  So this function *could* retrieve the value of the selected option in a
> > select box?
> 
> Better than *could* - it *does*.

What about select-multiple?

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
>  So this function *could* retrieve the value of the selected option in a
> select box?

Better than *could* - it *does*.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jonathan Sharp
On 11/15/06, "Jörn Zaefferer" <[EMAIL PROTECTED]
> wrote:

My conclusion so far: Add attrs(), remove val() and other shortcuts, and allow them via a shortcut function.I agree with this, I think this is the direction to go.-js

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan




Mike Alsup wrote:

  
 I have to admit, I didn't understand that $.val() was limited to only input
elements, and I expected it to get the value of any element.

  
  
val() is confusing because of its hybrid nature.  Only a few elements
support the "value" attribute (input, option, button and param), but
any object *could* have a value property, and some, most notably the
select element, always do.

  

So this function *could* retrieve the value of the selected option in a
select box? If val() is confusing then it's *exact* behavior should be
documented... and I mean more explicitly. Developer's who are moving
from desktop application development to Web / RIA type development, may
latch on to jQuery because of it's relative ease, but may not fully
understand some of the intricacies of the DOM.

Just my two cents I guess.

  And there are cross browser issues of course.  For example, IE
promotes a button's text to be its "value" but FF does not.

Mike
  

Hmm... I didn't know that. I don't develop much for FF.

Chris


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [jQuery-es] Cambiar cosas cuando la p ágina cargue

2006-11-15 Thread Reynier Perez Mira
Title: Re: [jQuery-es] Cambiar cosas cuando la página cargue






Hola Choan:

> Empecemos por definir las variables y ahorrar caracteres. Ese `divs =

> new Array()` me provoca ardor de estómago.

>   var divs = [ "el-id-de-un-div", "el-id-de-otro-div", "etc." ];

> Luego: `$(divs[activediv])` no va a seleccionar ningún elemento, así

> que difícilmente hará nada. Deberías usar

> $("#" + divs[activediv]).show();

Esto me funcionó a la perfección.

> En fin, si veo por donde vas, que no lo tengo muy claro, yo tiraría por aquí:

> HTML:

> 

>   

>       algo que mostrar

>   

>   

>       otra cosa que mostrar

>   

>     

> 

>   

>   

> 

> _javascript_:

> $(document).ready(init);

> $(document).ready(init);

> function init() {

>   // recogemos los elementos en una colección

>   var col = $("#container div.showhide");

>   // guardamos la longitud de la colección

>   var len = col.length;

>   // un numerito al azar

>   var sel = Math.floor(Math.random() * len);

>   // ocultamos todos, nos quedamos solo con uno de ellos, lo mostramos

>   col.hide().eq(sel).show();

>   

>   $("#trigger a").mouseover(function() { // asignamos el manejador

>       $("#container div.showhide").hide(); // ocultamos todos

>       var cur = this.href.split("#")[1]; // recuperamos el hash del enlace

>       $("#" + cur).show(); // mostramos el que toca

>   });

> }

¿Qué se supone que haga esta función y donde debo ponerla? La entendí más o menos pero algunas cosas no me quedaron claras del todo.

Salu2 y esperando respuesta

--

ReynierPM

5to Ing. Informática

Maestro de poco, aprendiz de mucho




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan






Dave Methvin wrote:

   >  The API says that $.val() will:
 > Get the current value of the first matched element.
 
Yes, it is equivalent to $().attr("value") so it gets the value attribute of
the first element.
 
 >  The API says that $.val( string ) will:
 > Set the value of every matched element.

Yes, it will set a "value" attribute for each element, regardless of whether
the doctype indicates the element has a "value" attribute. Generally you'd
only want to use .val() in cases where the element responded to having a
"value" attribute though.
  

I know that it does what it says it does. That's not the point. The
point is that it only works on the input element. I'm sorry, but I
think that should be spelled out. Obviously a number of people thought
it would retrieve the value of the selected option(s) in a select (or
multiple select) box and that it would retrieve all text between the
opening and closing textarea tags. What would be wrong with adding
those? There's probably a perfectly good reason, I just don't know what
it is. At the very least, it would be nice to document the seemingly
common misconception that this method does not handle those cases and
point the reader to the proper method.

  
The only indications in the API that this only works on the
input element is that the examples following both methods
use the input element. There's no other indication, so I
am surprised to find that it only works on this element.

  
  
I think the word "works" means "makes sense" here. What should
$("div").val() return? Right now it would be undefined since usually a div
has no value attribute. I could see an interpretation where it might return
the text nodes inside the div, but $().text() already does that.

  

I don't know what I would have expected $("div").val() to return, but
I, personally, probably wouldn't have thought to use it that way. I
would only have thought to use it on form elements: inputs, textareas,
and selects. The API also does not discuss here what this method
returns if the input is a check box or radio button. Does it return
that it is checked (like f.mycheckbox.checked)?

Chris


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mike Alsup
>  I have to admit, I didn't understand that $.val() was limited to only input
> elements, and I expected it to get the value of any element.

val() is confusing because of its hybrid nature.  Only a few elements
support the "value" attribute (input, option, button and param), but
any object *could* have a value property, and some, most notably the
select element, always do.

And there are cross browser issues of course.  For example, IE
promotes a button's text to be its "value" but FF does not.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Jörn Zaefferer
> I don't see why there can't be both.  
> 
> 'Hey, new to jQuery? Download this, take it for a spin, see what
> everyone is raving about!'
> 
> 'Developers, familiar with jQuery? Fine tune your build however you
> want, just click here...'
> 
> It's all about how we position the system and how we educate new users.

Fully agree! Providing a full release for newbies and as reference for 
documentation on the one hand and a custom build for further needs should be 
just fine. As soon as you are familiar enough with jQuery tp use the custom 
build, you won't worry about missing methods referenced in the documentation 
because you removed them on your own.

--
Jörn Zaefferer

http://bassistance.de

> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, November 14, 2006 9:42 PM
> To: jQuery Discussion.
> Subject: Re: [jQuery] jQuery 1.1 by the end of Nov
> 
> I have to say I absolutely *hate* the "build your own" library thing.
> First, when trying a new library, I don't often know what I need, so I
> end up downloading one set of files (click, click, click) only to
> discover I needed something else (click, click, click, click) then two
> weeks later I want something ELSE (click, click, click, click, click).
> 
> I say, find a standard set of things that should be included in jquery
> (personally, I'd ditch the effects stuff, as they're so minimal it'd be
> better to just pawn those elsewhere) and focus on the expression engine.
> That's jquery's bread and butter.
> 
> One simple download link, and a nice page where developers can find
> plugins.
> 
> -Original Message-
> From: Jason Yeckel <[EMAIL PROTECTED]>
> Sent: Wed, November 15, 2006 12:03 am
> To: jQuery Discussion. 
> Subject: Re: [jQuery] jQuery 1.1 by the end of Nov
> 
> I think over all do a mootools like download / interface jquery lib 
> download were the user can pick and choose components.
> 
> Just to be fair the only reason it has two was to make perl regex users 
> happy :) I do use the perl regex though lol.
> 
> 
> Jason Y
> www.purepressure.com
> 
> 
> dave.methvin wrote:
> > John Resig wrote:
> >   
> >> Right now, the jQuery compressed build is teetering around 18-19KB, I
> >> really want to try and cut this down. Any thoughts on particular
> >> features that should be extracted into a plugin?
> >>
> >> 
> > I know the macros don't account for _that_ much core code but they do
> > complicate the documentation significantly. We have nice short names
> like
> > .attr and .css yet those represent the most-macroed properties. Then
> we end
> > up with (justifiable IMO) situations where valuable names like
> .height() are
> > taken by the .css("height") macro to save five--count 'em--five
> characters.
> > The same goes for the event macros, I think they account for more than
> half
> > the names in the API documentation at this point and they end up
> creating
> > situations like .unload() that are pretty hard to explain.
> >
> > I would like to see jQuery take more of a Perl path than a PHP one,
> using a
> > small number of consistent and powerful concepts plus the ability to
> extend
> > things with plugins. Perl has one simple consistent regexp operator;
> PHP has
> > two completely different regexp engines, each served by a dozen or
> more
> > differently named functions.
> >
> >
> >   
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Alex Cook
I don't see why there can't be both.  

'Hey, new to jQuery? Download this, take it for a spin, see what
everyone is raving about!'

'Developers, familiar with jQuery? Fine tune your build however you
want, just click here...'

It's all about how we position the system and how we educate new users. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 9:42 PM
To: jQuery Discussion.
Subject: Re: [jQuery] jQuery 1.1 by the end of Nov

I have to say I absolutely *hate* the "build your own" library thing.
First, when trying a new library, I don't often know what I need, so I
end up downloading one set of files (click, click, click) only to
discover I needed something else (click, click, click, click) then two
weeks later I want something ELSE (click, click, click, click, click).

I say, find a standard set of things that should be included in jquery
(personally, I'd ditch the effects stuff, as they're so minimal it'd be
better to just pawn those elsewhere) and focus on the expression engine.
That's jquery's bread and butter.

One simple download link, and a nice page where developers can find
plugins.

-Original Message-
From: Jason Yeckel <[EMAIL PROTECTED]>
Sent: Wed, November 15, 2006 12:03 am
To: jQuery Discussion. 
Subject: Re: [jQuery] jQuery 1.1 by the end of Nov

I think over all do a mootools like download / interface jquery lib 
download were the user can pick and choose components.

Just to be fair the only reason it has two was to make perl regex users 
happy :) I do use the perl regex though lol.


Jason Y
www.purepressure.com


dave.methvin wrote:
> John Resig wrote:
>   
>> Right now, the jQuery compressed build is teetering around 18-19KB, I
>> really want to try and cut this down. Any thoughts on particular
>> features that should be extracted into a plugin?
>>
>> 
> I know the macros don't account for _that_ much core code but they do
> complicate the documentation significantly. We have nice short names
like
> .attr and .css yet those represent the most-macroed properties. Then
we end
> up with (justifiable IMO) situations where valuable names like
.height() are
> taken by the .css("height") macro to save five--count 'em--five
characters.
> The same goes for the event macros, I think they account for more than
half
> the names in the API documentation at this point and they end up
creating
> situations like .unload() that are pretty hard to explain.
>
> I would like to see jQuery take more of a Perl path than a PHP one,
using a
> small number of consistent and powerful concepts plus the ability to
extend
> things with plugins. Perl has one simple consistent regexp operator;
PHP has
> two completely different regexp engines, each served by a dozen or
more
> differently named functions.
>
>
>   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Jörn Zaefferer
> Even if it is 10-15 lines, it's still lines I, and most developers,
> will never ever use. jQuery should be for the everyday basics, and the
> plug-ins are there to extend the base.

The expression engine is the most important part about jQuery, and that provide 
more then just a single "right" way to solve things. Someone who was worked a 
lot with XML knows XPath very good, but may have no idea about CSS. By 
supporting both, jQuery could attract a much bigger audience.

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Dave Methvin
 >  The API says that $.val() will:
 > Get the current value of the first matched element.
 
Yes, it is equivalent to $().attr("value") so it gets the value attribute of
the first element.
 
 >  The API says that $.val( string ) will:
 > Set the value of every matched element.

Yes, it will set a "value" attribute for each element, regardless of whether
the doctype indicates the element has a "value" attribute. Generally you'd
only want to use .val() in cases where the element responded to having a
"value" attribute though.

> The only indications in the API that this only works on the
> input element is that the examples following both methods
> use the input element. There's no other indication, so I
> am surprised to find that it only works on this element.

I think the word "works" means "makes sense" here. What should
$("div").val() return? Right now it would be undefined since usually a div
has no value attribute. I could see an interpretation where it might return
the text nodes inside the div, but $().text() already does that.



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery support for namespace attributes

2006-11-15 Thread Dave Methvin
In an expression like this:

myns|[EMAIL PROTECTED]|attr=whatever]

How does myns get associated with the actual XML namespace URI?
getElementByTagNameNS needs the URI, not the name. I have not needed
namespaces before so I am not familiar with how that would work.

As for how much code it takes, the only way to know for sure is to write it.



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Grid and Storing State

2006-11-15 Thread Alan Gutierrez
I'd like to create a Grid for my application.

I've started here...

http://blogometer.com/repository/etude/jQuery/grid/grid.html

...with the first issue being one of sizing the columns. I'm doing
this by applying a class to each column and heading in an HTML table
and then adjusting the rules of the class.

My creational pattern like so...

$("#grid").grid({ dataType: 'html' })

My question is, where do I store state? How do I change my grid in
the future? Where would I keep an object to adjust grid properties?

Should I pursue this sort of syntax to change a column's
sortability?

$("#grid").sortable(3, false)

I'd only want sortable for those elements that were now grids.

Thoughts? The Prototype way to do it is to create an object that
acts as a controller. I'm not sure of the jQuery way.

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
Think New Orleans - http://thinknola.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] StyleSheets

2006-11-15 Thread Alan Gutierrez
* Klaus Hartl <[EMAIL PROTECTED]> [2006-11-15 12:15]:
> Chris W. Parker schrieb:
> > On Wednesday, November 15, 2006 8:07 AM Alan Gutierrez <> said:
> > 
> >> I'm not finding any methods for editing stylesheets.
> >>
> >> I'd like to change a style as it is defined in the document.
> > 
> > That's probably because there are none. You don't (can't?) modify the
> > .css file directly with js. Instead you modify the styles that have
> > already been applied.
> 
> Not exactly. Support for changing and adding styles to existing 
> stylesheets (DOM Level 2 Style) isn't too good though. I think Opera 
> introduced that with v9. Also there are - again - different routes to go 
> for IE and other modern browsers.
> 
> Here's a chart:
> http://www.webdevout.net/browser_support_dom.php#support-domstyle
> 
> More information: http://www.w3.org/TR/DOM-Level-2-Style/
> 
> I think someone on the list made a plugin for this already...

Klaus

Indeed, the support is sketchy. The code I found will parse the text
content of the style element for some browsers.

I'm still banking on it being faster to change the stylesheet when
you are deailing with hundreds of table cells.

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
Think New Orleans - http://thinknola.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] StyleSheets

2006-11-15 Thread Chris W. Parker
On Wednesday, November 15, 2006 9:05 AM Alan Gutierrez <> said:

> You can redefine css rules programatically. I've done so here...
> 
> http://blogometer.com/repository/etude/jQuery/grid/grid.html

Interesting!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Andre Lewis
I think that when newcomers find JQ, their default experience should pretty inclusive, i.e., definitely Ajax and Effects. That way, people won't be frustrated by the "I saw it in the API but can't get it to work" factor, and will be more likely to continue on to discover more jQuery goodness.
How about something like this for the download page. Offer the two ends of the spectrum, and awareness that jQuery scales up and down. I'm making the specifics up, but you get the idea:== Getting Started? ==
Download jQuery Full Version, includes Ajax, Effects, etc . . . Size: 21K. You can always remove components you don't need later to make the _javascript_ smaller!== Need a lightweight, ninja-fast DOM and Events toolkit? ==
Download jQuery Core. Size: 10K== Need something more or less?  ==jQuery scales up and down with your needs. You can selectively add or remove components (Form Serializer, etc.), and leverage a thriving plugin community. Learn more here.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Christopher Jordan




I have to
admit, I didn't understand that $.val() was limited to only input
elements, and I expected it to get the value of any element.

The API says that $.val() will:
    Get the current value of the first matched element.

The API says that $.val( string ) will:
    Set the value of every matched element.

The only indications in the API that this only works on the input
element is that the examples following both methods use the input
element. There's no other indication, so I am surprised to find that it
only works on this element.

Chris

Alex Cook wrote:

  *raises hand*

Yea, that'd be nice... I expected $.val() to return the value of any and
all form elements, and was disappointed to find out otherwise.

-ALEX

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
Behalf Of Brandon Aaron
Sent: Tuesday, November 14, 2006 6:32 PM
To: jQuery Discussion.
Subject: [jQuery] $.val() limited in functionality?

I often times just need to know the value of one form element and
sometimes that could be a group of radio buttons, a select, a multiple
select or just a regular input. The current $.val() method is limited
only to inputs. I was curious if anyone else needed this funtionality
and if it should be in a plugin or in the core?

--
Brandon Aaron

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] StyleSheets

2006-11-15 Thread Brandon Aaron
It is not all that easy to make cross-browser. Here is a snippet I
wrote to do this ...
http://www.nabble.com/Style-sheet-modification-snippet-tf2484859.html#a6928891

--
Brandon Aaron

On 11/15/06, Alan Gutierrez <[EMAIL PROTECTED]> wrote:
> I'm not finding any methods for editing stylesheets.
>
> I'd like to change a style as it is defined in the document.
>
> --
> Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
> Think New Orleans - http://thinknola.com/
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] console for IE question

2006-11-15 Thread bmsterling

Hey,
I am trying to use the console script in IE but it gives me a TypeError
message. 'window.top.deBugWindow.document; is null or not an object

I am using like: 
   console.log("start init()"); 

Is there anything else i need to do to use this?

Any help would be great.
-- 
View this message in context: 
http://www.nabble.com/console-for-IE-question-tf2637512.html#a7361728
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] StyleSheets

2006-11-15 Thread Klaus Hartl
Chris W. Parker schrieb:
> On Wednesday, November 15, 2006 8:07 AM Alan Gutierrez <> said:
> 
>> I'm not finding any methods for editing stylesheets.
>>
>> I'd like to change a style as it is defined in the document.
> 
> That's probably because there are none. You don't (can't?) modify the
> .css file directly with js. Instead you modify the styles that have
> already been applied.

Not exactly. Support for changing and adding styles to existing 
stylesheets (DOM Level 2 Style) isn't too good though. I think Opera 
introduced that with v9. Also there are - again - different routes to go 
for IE and other modern browsers.

Here's a chart:
http://www.webdevout.net/browser_support_dom.php#support-domstyle

More information: http://www.w3.org/TR/DOM-Level-2-Style/

I think someone on the list made a plugin for this already...


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] StyleSheets

2006-11-15 Thread Alan Gutierrez
* Chris W. Parker <[EMAIL PROTECTED]> [2006-11-15 11:56]:
> On Wednesday, November 15, 2006 8:07 AM Alan Gutierrez <> said:
> 
> > I'm not finding any methods for editing stylesheets.
> > 
> > I'd like to change a style as it is defined in the document.
> 
> That's probably because there are none. You don't (can't?) modify the
> .css file directly with js. Instead you modify the styles that have
> already been applied.
> 
> But perhaps there is a better way to solve your problem. Why do you want
> to change the .css file directly? Can you not just create two styles and
> use jQuery to switch between them?

You can redefine css rules programatically. I've done so here...

http://blogometer.com/repository/etude/jQuery/grid/grid.html

It is faster to let the CSS layout engine change the style of every
table cell with a style of 'grid-X-column-4' than to iterate using a
jQuery selector.

I did find a class that alters stylesheets in a x-browser fashion.

http://blogometer.com/repository/etude/jQuery/grid/grid.js

Was hoping for a jQuery plugin.

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
Think New Orleans - http://thinknola.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Alex Cook
*raises hand*

Yea, that'd be nice... I expected $.val() to return the value of any and
all form elements, and was disappointed to find out otherwise.

-ALEX

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Brandon Aaron
Sent: Tuesday, November 14, 2006 6:32 PM
To: jQuery Discussion.
Subject: [jQuery] $.val() limited in functionality?

I often times just need to know the value of one form element and
sometimes that could be a group of radio buttons, a select, a multiple
select or just a regular input. The current $.val() method is limited
only to inputs. I was curious if anyone else needed this funtionality
and if it should be in a plugin or in the core?

--
Brandon Aaron

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] StyleSheets

2006-11-15 Thread Chris W. Parker
On Wednesday, November 15, 2006 8:07 AM Alan Gutierrez <> said:

> I'm not finding any methods for editing stylesheets.
> 
> I'd like to change a style as it is defined in the document.

That's probably because there are none. You don't (can't?) modify the
.css file directly with js. Instead you modify the styles that have
already been applied.

But perhaps there is a better way to solve your problem. Why do you want
to change the .css file directly? Can you not just create two styles and
use jQuery to switch between them?



Chris.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Rik Lomas
Even if it is 10-15 lines, it's still lines I, and most developers,
will never ever use. jQuery should be for the everyday basics, and the
plug-ins are there to extend the base.


On 15/11/06, Brian Miller <[EMAIL PROTECTED]> wrote:
> I'm not suggesting bloat here, Rik.  I think that, at the very least,
> support for $('myns|whatever') is core stuff, and is doable without a lot
> of code.  Since it's about the basic functionality of selection, I think
> that it's one of the few things that *shouldn't* be a plugin.
>
> I won't have time to actually take a crack at it for a few days, but I'd
> appreciate it if someone could demonstrate just how much space such an
> addition would take up.  I can't see it being more than like 10-15 lines
> or so, but I've been wrong before.  :)
>
> - Brian
>
>
> > Without sounding rude, I don't think I would ever use this and I don't
> > think most developers would either. We need jQuery to be small and
> > flexible, not a huge bloated framework like some of the other
> > libraries (that I will leave nameless)... Maybe extending jQuery, or
> > building a plug-in may be the way round this?
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>


-- 
Rik Lomas
http://rikrikrik.com

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] val() to erase the value

2006-11-15 Thread Glen Lipka
When I did this:
$("#someInput").val(""); 
it made it null in FF but in IE it left it alone.

How do I use val() to erase the current value?

Glen
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Glen Lipka
Just a thought:You could put up a survey online asking:1. What should the maximum size of jQuery be with these modules (list current)?  [enter number]2. Which modules do you think could be abstracted out of the core into plugins to save space? [checkboxes]
3. etc.Of course, this info doesn't make it a "vote", it's just good to get a read of the audience.Personally, 19k is tiny to me compared to the others out there.  Even 25k would be tiny still.  However, I think the form handling is something that makes sense to rely on a plugin.
Glen
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Brian Miller
I'm not suggesting bloat here, Rik.  I think that, at the very least,
support for $('myns|whatever') is core stuff, and is doable without a lot
of code.  Since it's about the basic functionality of selection, I think
that it's one of the few things that *shouldn't* be a plugin.

I won't have time to actually take a crack at it for a few days, but I'd
appreciate it if someone could demonstrate just how much space such an
addition would take up.  I can't see it being more than like 10-15 lines
or so, but I've been wrong before.  :)

- Brian


> Without sounding rude, I don't think I would ever use this and I don't
> think most developers would either. We need jQuery to be small and
> flexible, not a huge bloated framework like some of the other
> libraries (that I will leave nameless)... Maybe extending jQuery, or
> building a plug-in may be the way round this?


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Yehuda Katz
Yep. I used my patch to write an additional plugin that allowed:$("div[&height>10]")which allows selectors based on CSS attributes. It'd be really easy to extend jQuery to include any other type of selector, as long as you built the appropriate RegExp parser. And it's only 43 *bytes*
-- YehudaOn 11/15/06, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote:
> > Without sounding rude, I don't think I would ever use this and I don't> > think most developers would either. We need jQuery to be small and> > flexible, not a huge bloated framework like some of the other
> > libraries (that I will leave nameless)... Maybe extending jQuery, or> > building a plug-in may be the way round this?>> Yes, that would be nice. But currently there is no hook to use custom
> selectors (other than `:something`, as>  demonstrates).>> For me it's ok if this feature is not in the core as long as it can be
> used as a plugin.Yehuda Katz proposed a patch for the parser that would allow custom expressions. And it was quite small.--Jörn Zaeffererhttp://bassistance.de
--Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer___
jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/-- Yehuda Katz
Web Developer | Wycats Designs(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Why does this code not work?

2006-11-15 Thread Sam Collett
On 15/11/06, Rick Faircloth <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi, all…
>
> Trying to grasp js and jQuery…why won't this code work?
>
> (No response on my test page at all to the code…)
>
> JQuery code:
>
> $(document).ready(function() {
>
>
> $("div.ann").find("p.title").hide().end().find("p.text").click(function() {
>
>  var answer = $(this).next();
>
>  if (answer.is(':visible')) {
>
>  answer.slideUp();
>
>  } else {
>
>  answer.slideDown();
>
>  }
>
>  });
>
> });
>
> HTML:
>
> 
>
> 
>
> This is my title…
>
> 
>
> 
>
> This is my text…
>
> 
>
> 
>
> ???
>
> Thanks,
>
> Rick

I think you have p.title and p.text mixed up. You are hiding p.title
and applying the click event to p.text (which looks for the next
element, which doesn't exist).

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] StyleSheets

2006-11-15 Thread Alan Gutierrez
I'm not finding any methods for editing stylesheets.

I'd like to change a style as it is defined in the document.

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
Think New Orleans - http://thinknola.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery support for namespace attributes

2006-11-15 Thread Krzysztof FF


Stephen Woodbridge wrote:
> 
> (...)
> Or escape the expression so we know it is explicitly XPath, or provide 
> a separate function that is dedicated to XPath.
> 
> -Steve
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 
Both hands to this solution. Mixing two worlds together leads to
incompatibilities and limitations just because both syntaxes can overlap.

Providing separate function means dividing all core between $([CSS
selector]) and new $X([XPath expression]). I'm afraid it is not applicable.
So we have to turn to escaping XPath expressions so as to distinguish them
from CSS selectors.

To keep compatibility with previous version, unescaped calls can be
discriminated against "CSS" versus "Basic XPath" in current way; however,
those advanced XPath expressions that would collide with CSS syntax (and any
other, even "Basic", just explicitly mentioned as XPath) should be escaped
to force its interpretation.

It can be explicit escaping by special char (within string argument) or
optional parameter telling which syntax to use.

In my opinion, the second solution would be better.

Additional $ signature could be declared as follows:

jQuery $( String expr, Hash options )

with "options" containing CSS/XPath predicate, as well as additional
"context" parameter (see  http://jquery.com/api/#$ docs ), with open room
for future extensions. 

Maybe in jQuery 1.1 such solution could be applied?



-- 
View this message in context: 
http://www.nabble.com/jQuery-support-for-namespace-attributes-tf2636394.html#a7360528
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Jörn Zaefferer
> > Without sounding rude, I don't think I would ever use this and I don't
> > think most developers would either. We need jQuery to be small and
> > flexible, not a huge bloated framework like some of the other
> > libraries (that I will leave nameless)... Maybe extending jQuery, or
> > building a plug-in may be the way round this?
> 
> Yes, that would be nice. But currently there is no hook to use custom
> selectors (other than `:something`, as
>  demonstrates).
> 
> For me it's ok if this feature is not in the core as long as it can be
> used as a plugin.

Yehuda Katz proposed a patch for the parser that would allow custom 
expressions. And it was quite small.

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Jörn Zaefferer
> > Personally, I'm noticing a lot of requests for XML namespace selection
> in
> > the parser.  Can we get that into 1.1?  Apperently, making $('myns:div')
> > would raise holy hell because it would clash with the pseudos, but
> > $('myns|div') might be doable.
> 
> +1 for namespace selection.
> 
> In one of my current projects, we added custom attributes to form
> elements to use them as widgets.
> 
> As jQuery doesn't allow this kind of selection, we were forced to
> invalidate our XHTML. God killed a kitty.
> 
> I wouldn't like to do it again.

No need to harm any more kitten while avoiding namespaces: Take a look at the 
metadata plugin, it promotes valid markup without namespaces.

You are free to choose from three types of metadata: "class" (now default), 
"attr" and "elem".

For example, when using the default "class", you'd write your metadata this way:



Inside the brackets any javascript syntax is valid. By using types attr or 
elem, you can specify the same data in different places: attr uses custom 
(invalid) attributes, elem extra elements (eg. script).

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Mark Gibson
Jörn Zaefferer wrote:
> Currently val() is only a shortcut, but doesn't encapsulate anything useful. 
> It would be nice to have it handling some more stuff.
> 
> I wouldn't like to have it in an external plugin, that makes it difficult to 
> access or find it when you actually need that functionality.
> 
> Some thoughts about the implementation:
> - single select: Nothing to worry about, right?
> - multiple select: Get it's option:selected children and put their values 
> into an array, empty array when nothing is selected
> - radio: Find the input:radio siblings with the same name and get the value 
> from the one that is checked, ??? when nothing is selected
> - checkbox: combination of radio and select: Find input:checkbox siblings 
> that are checked and put their values into an array, empty array when nothing 
> is checked
> - everything else: stick to the simple value

As a start, heres what I use:
(It doesn't cover radio buttons as described above
- as I never needed it)

It returns an array of values if the jquery has several elements,
it maybe more useful to return an object (id/name => value) instead.

$.fn.getValue = function() {
 var o = [];
 this.each(function() {
 switch (this.type) {
 case 'checkbox':
 case 'radio':
 v = this.checked;
 break;
 case 'select-one':
 v = this.selectedIndex >= 0
 ? (this.options[this.selectedIndex].value
 || this.options[this.selectedIndex].text)
 : null;
 break;
 case 'select-multiple':
 v = [];
 for (var i = 0; i < this.options.length; i++) {
 if (this.options[i].selected)
 v.push(this.options[i].value || 
this.options[i].text);
 }
 break;
 case 'button':
 case 'reset':
 case 'submit':
 break;
 default:
 v = this.value;
 }
 o.push(v);
 });
 return o.length > 1 ? o : o[0];
};

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Jörn Zaefferer
> > I'm trying to do what I thought was pretty simple:
> >
> > $("#id").empty();
> >
> > where "#id" is the id of a textarea. I'd like to clear out the text 
> > area when my ajax call returns.
> >
> > What am I doin' wrong?
> bump...
> 
> Can anybody help with this?

Please provide some more information: What markup are you using? Example page?

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Why does this code not work?

2006-11-15 Thread Rick Faircloth
Title: Why does this code not work?






Hi, all…

Trying to grasp js and jQuery…why won’t this code work?

(No response on my test page at all to the code…)

JQuery code:

$(document).ready(function() {

    $("div.ann").find("p.title").hide().end().find("p.text").click(function() {

 var answer = $(this).next();

 if (answer.is(':visible')) {

 answer.slideUp();

 } else {

 answer.slideDown();

 }

 });

});

HTML:

”ann”>

”title”>

This is my title…



lass=”text”>

This is my text…





???

Thanks,

Rick




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Christopher Jordan




Thanks
Erik, I completely missed the fact that you'd responded. **sheepish
grin**
I appreciate the help. :o)

Chris

Erik Beeson wrote:
You don't want empty(), you want to set the value of the
textarea to an empty string. Try (untested):
  
$("#id").val("");
  
empty() is for removing child elements. See the documentation for more
info.
  
  
--Erik
  
  On 11/14/06, Christopher Jordan <[EMAIL PROTECTED]> wrote:
  
Hi folks,

I'm trying to do what I thought was pretty simple:

    $("#id").empty();

where "#id" is the id of a textarea. I'd like to clear out the text
area when my ajax call returns.

What am I doin' wrong?

Thanks,
Chris


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  
  
  
  

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery support for namespace attributes

2006-11-15 Thread Stephen Woodbridge
Klaus Hartl wrote:
> Stephen Woodbridge schrieb:
>> Jörn Zaefferer wrote:
 I understand the CSS selector and have read the other thread but a
 true namespace selection based on xpath syntax doesn't work.  As
 for writing a plug-in, I believe the issue could be corrected with
 a change to a regular expression.  But, reg exps are, by their
 nature, difficult for me to tinker with, and I can't figure out
 which regular expression is used for node and attribute filtering.

 I asked about this back in September and am asking again because I
 believe better xpath support would improve jQuery's handling of xml
 docs as well as xhtml pages.
>>> The problem: Mixing XPath and CSS selectors is very limited. And as
>>> more users of jQuery are familiar with CSS then XPath, there is much
>>> more support for CSS then XPath. To fully support XPath you have to
>>> remove a lot of CSS selectors.
>> Or escape the expression so we know it is explicitly XPath, or provide 
>> a separate function that is dedicated to XPath.
>>
>> -Steve
> 
> This fits into the "What to strip out for 1.1" discussion, I assume. I 
> only use XPath when traversing through XML documents, so maybe XPath 
> support could go into a plugin as well. I think this was discussed before...
> 

Yes agreed, not in 1.1, but definitely needed in future and a plugin 
would be fine for me.

-Steve

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Christopher Jordan




Thanks
Brandon. I'm just an idiot, and didn't see that Erik had already
responded last night, :0/
Anyway, I appreciate the possible alternative solution.

Chris

Brandon Aaron wrote:

  I believe the solution provided should work:

$("#id").val("");

and if it actually doesn't you could try:

$('#id').html('');

--
Brandon Aaron

On 11/15/06, Christopher Jordan <[EMAIL PROTECTED]> wrote:
  
  
 bump...

 Can anybody help with this?

 Thanks,
 Chris :o)

 Christopher Jordan wrote:
 Hi folks,

 I'm trying to do what I thought was pretty simple:

 $("#id").empty();

 where "#id" is the id of a textarea. I'd like to clear out the text area
when my ajax call returns.

 What am I doin' wrong?

 Thanks,
 Chris
 

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/




  
  
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Christopher Jordan




oops. I
must have missed that. Sorry. Thanks Klaus. :)

Klaus Hartl wrote:

  Christopher Jordan schrieb:
  
  
bump...

Can anybody help with this?

Thanks,
Chris :o)

  
  
Erik did already suggested the solution:

$('#id').val('');



-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Brandon Aaron
I believe the solution provided should work:

$("#id").val("");

and if it actually doesn't you could try:

$('#id').html('');

--
Brandon Aaron

On 11/15/06, Christopher Jordan <[EMAIL PROTECTED]> wrote:
>
>  bump...
>
>  Can anybody help with this?
>
>  Thanks,
>  Chris :o)
>
>  Christopher Jordan wrote:
>  Hi folks,
>
>  I'm trying to do what I thought was pretty simple:
>
>  $("#id").empty();
>
>  where "#id" is the id of a textarea. I'd like to clear out the text area
> when my ajax call returns.
>
>  What am I doin' wrong?
>
>  Thanks,
>  Chris
>  
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Mike Alsup
For cross-browser success, use this:

$('#id')[0].value = "";

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery support for namespace attributes

2006-11-15 Thread Klaus Hartl
Stephen Woodbridge schrieb:
> Jörn Zaefferer wrote:
>>> I understand the CSS selector and have read the other thread but a
>>> true namespace selection based on xpath syntax doesn't work.  As
>>> for writing a plug-in, I believe the issue could be corrected with
>>> a change to a regular expression.  But, reg exps are, by their
>>> nature, difficult for me to tinker with, and I can't figure out
>>> which regular expression is used for node and attribute filtering.
>>>
>>> I asked about this back in September and am asking again because I
>>> believe better xpath support would improve jQuery's handling of xml
>>> docs as well as xhtml pages.
>> The problem: Mixing XPath and CSS selectors is very limited. And as
>> more users of jQuery are familiar with CSS then XPath, there is much
>> more support for CSS then XPath. To fully support XPath you have to
>> remove a lot of CSS selectors.
> 
> Or escape the expression so we know it is explicitly XPath, or provide 
> a separate function that is dedicated to XPath.
> 
> -Steve

This fits into the "What to strip out for 1.1" discussion, I assume. I 
only use XPath when traversing through XML documents, so maybe XPath 
support could go into a plugin as well. I think this was discussed before...

-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Klaus Hartl
Christopher Jordan schrieb:
> bump...
> 
> Can anybody help with this?
> 
> Thanks,
> Chris :o)

Erik did already suggested the solution:

$('#id').val('');



-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Choan C. Gálvez
On 11/15/06, Rik Lomas <[EMAIL PROTECTED]> wrote:
> Without sounding rude, I don't think I would ever use this and I don't
> think most developers would either. We need jQuery to be small and
> flexible, not a huge bloated framework like some of the other
> libraries (that I will leave nameless)... Maybe extending jQuery, or
> building a plug-in may be the way round this?

Yes, that would be nice. But currently there is no hook to use custom
selectors (other than `:something`, as
 demonstrates).

For me it's ok if this feature is not in the core as long as it can be
used as a plugin.


> On 15/11/06, Choan C. Gálvez <[EMAIL PROTECTED]> wrote:
> > On 11/15/06, Brian Miller <[EMAIL PROTECTED]> wrote:
> > > Personally, I'm noticing a lot of requests for XML namespace selection in
> > > the parser.  Can we get that into 1.1?  Apperently, making $('myns:div')
> > > would raise holy hell because it would clash with the pseudos, but
> > > $('myns|div') might be doable.
> >
> > +1 for namespace selection.
> >
> > In one of my current projects, we added custom attributes to form
> > elements to use them as widgets.
> >
> > As jQuery doesn't allow this kind of selection, we were forced to
> > invalidate our XHTML. God killed a kitty.
> >
> > I wouldn't like to do it again.
-- 
Choan

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Generic mouseover jode via jQuery?

2006-11-15 Thread Andy Matthews
Gonna try this one last time. I suspect that something might be up with my
company's blocking software as I haven't gotten jQuery emails for the last 3
or 4 days.

-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 2:21 PM
To: [jQuery]
Subject: Generic mouseover jode via jQuery?


Not sure if this went through the first time, so I'm resending.

-

I've got mouseover code I've been using for several years now. It works
really well and is pretty streamlined, although it requires I instantiate
each image (used for preloading). You can see it below. I'm wondering if
anyone has a plugin which duplicates this functionality.

I saw Gilles plugin and it seems like it would work, but I'm not sure if
that preloads, plus the download link is broken.

Anyone?

---
if (document.images) {
/* left nav rollover loading */
home_off = new Image();
home_off.src = "images/nav_home.jpg";
home_on = new Image();
home_on.src = "images/nav_home_o.jpg";

aboutus_off = new Image();
aboutus_off.src = "images/nav_aboutus.jpg";
aboutus_on = new Image();
aboutus_on.src = "images/nav_aboutus_o.jpg";
}

function swap() {
if (document.images) {
for (var i=0; ihttp://jquery.com/discuss/


Re: [jQuery] .empty() not emptying...

2006-11-15 Thread Christopher Jordan




bump...

Can anybody help with this?

Thanks,
Chris :o)

Christopher Jordan wrote:

  
  Hi folks,
  
I'm trying to do what I thought was pretty simple:
  
    $("#id").empty();
  
where "#id" is the id of a textarea. I'd like to clear out the text
area when my ajax call returns.
  
What am I doin' wrong?
  
Thanks,
Chris
  

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
  



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery support for namespace attributes

2006-11-15 Thread Stephen Woodbridge
Jörn Zaefferer wrote:
>> I understand the CSS selector and have read the other thread but a
>> true namespace selection based on xpath syntax doesn't work.  As
>> for writing a plug-in, I believe the issue could be corrected with
>> a change to a regular expression.  But, reg exps are, by their
>> nature, difficult for me to tinker with, and I can't figure out
>> which regular expression is used for node and attribute filtering.
>> 
>> I asked about this back in September and am asking again because I
>> believe better xpath support would improve jQuery's handling of xml
>> docs as well as xhtml pages.
> 
> The problem: Mixing XPath and CSS selectors is very limited. And as
> more users of jQuery are familiar with CSS then XPath, there is much
> more support for CSS then XPath. To fully support XPath you have to
> remove a lot of CSS selectors.

Or escape the expression so we know it is explicitly XPath, or provide 
a separate function that is dedicated to XPath.

-Steve

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Rik Lomas
Without sounding rude, I don't think I would ever use this and I don't
think most developers would either. We need jQuery to be small and
flexible, not a huge bloated framework like some of the other
libraries (that I will leave nameless)... Maybe extending jQuery, or
building a plug-in may be the way round this?


On 15/11/06, Choan C. Gálvez <[EMAIL PROTECTED]> wrote:
> On 11/15/06, Brian Miller <[EMAIL PROTECTED]> wrote:
> > Personally, I'm noticing a lot of requests for XML namespace selection in
> > the parser.  Can we get that into 1.1?  Apperently, making $('myns:div')
> > would raise holy hell because it would clash with the pseudos, but
> > $('myns|div') might be doable.
>
> +1 for namespace selection.
>
> In one of my current projects, we added custom attributes to form
> elements to use them as widgets.
>
> As jQuery doesn't allow this kind of selection, we were forced to
> invalidate our XHTML. God killed a kitty.
>
> I wouldn't like to do it again.
> --
> Choan
> 
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>


-- 
Rik Lomas
http://rikrikrik.com

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $.val() limited in functionality?

2006-11-15 Thread Jörn Zaefferer
Hi Choan!

> > I have this in my validation plugin to check the number of selected
> checkboxes/radios:
> >
> > return $(element).parents('form, body').find('[EMAIL PROTECTED]' + 
> > element.name +
> ']:checked').length;
> 
> I've used something similar which, as I understand, should be a little
> more efficient:
> 
> return $(element.form).find('[EMAIL PROTECTED]' + element.name +
> ']:checked').length;

Indeed, good to know. I'd write it then as this for cases where there is no 
surrounding form:

return $(element.form || document).find('[EMAIL PROTECTED]' + element.name + 
']:checked').length;

At least in FF the form property is null when there is no surrounding form. I 
wonder if this is true for other browsers.

--
Jörn Zaefferer

http://bassistance.de
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Choan C. Gálvez
On 11/15/06, Brian Miller <[EMAIL PROTECTED]> wrote:
> Personally, I'm noticing a lot of requests for XML namespace selection in
> the parser.  Can we get that into 1.1?  Apperently, making $('myns:div')
> would raise holy hell because it would clash with the pseudos, but
> $('myns|div') might be doable.

+1 for namespace selection.

In one of my current projects, we added custom attributes to form
elements to use them as widgets.

As jQuery doesn't allow this kind of selection, we were forced to
invalidate our XHTML. God killed a kitty.

I wouldn't like to do it again.
-- 
Choan


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  1   2   >