[jQuery] Re: Jquery cant manipulate inline TinyMCE. Why?

2007-08-16 Thread Olive

Mário,

As I far as I remember this is because your element having the ID
"MyIdOnInlineDOM" is duplicated when loading the inline page ant thus
$j('#MyIdOnInlineDOM') fails to reach your element.

HTH,

Olive



[jQuery] Re: Creating DOM elements on the fly

2007-08-16 Thread Karl Rudd

In the examples I gave the new element is "saved" to the variable
inputBox. So to add it to the DOM you will do something like what Erik
wrote, that is:

inputBox.appendTo('#myForm');

The above appends it (that is, adds it as the last element) to an
element with id="myForm".

There are other options such as "prependTo", "insertBefore" and
"insertAfter". More details on these here:
http://docs.jquery.com/DOM/Manipulation

Karl Rudd

On 8/17/07, Pops <[EMAIL PROTECTED]> wrote:
>
> On Aug 17, 2:10 am, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> > It's already built in. For your example:
> >
> >   var inputBox = $('').attr("type", "text").attr("id", "someText");
> >
>
> Karl,
>
> Question,  I've still learning jQuery, so please forgive me as I am
> not 100% sure if I will poise the question correctly.
>
> When you do something like above, is the element already in DOM or
> just saved in a variable "inputBox"?  ready to be added (i.e.
> appended) to "DOM" at some later point?
>
> For example, if that is the case, what is the next step to add it to
> DOM?
>
> Something like Erik showed?
>
> $(inputBox).appendTo('#myForm');
>
> Thanks Karl.
>
> --
> HLS
>
>
>


[jQuery] Re: Creating DOM elements on the fly

2007-08-16 Thread Pops

On Aug 17, 2:10 am, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> It's already built in. For your example:
>
>   var inputBox = $('').attr("type", "text").attr("id", "someText");
>

Karl,

Question,  I've still learning jQuery, so please forgive me as I am
not 100% sure if I will poise the question correctly.

When you do something like above, is the element already in DOM or
just saved in a variable "inputBox"?  ready to be added (i.e.
appended) to "DOM" at some later point?

For example, if that is the case, what is the next step to add it to
DOM?

Something like Erik showed?

$(inputBox).appendTo('#myForm');

Thanks Karl.

--
HLS




[jQuery] Re: Creating DOM elements on the fly

2007-08-16 Thread Anurag

Feel like I hit a jackpot.

Thanks!

On Aug 17, 1:11 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> The jQuery function $() can parse HTML, as can the various DOM
> functions (append, prepend, appendTo, etc):
>
> $('').appendTo('#myForm');
>
> --Erik
>
> On 8/16/07, Anurag <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I am a jQuery beginner. I am working on an application for which I
> > need to create DOM elements on the fly. Previously I was using
> > document.createElement() and document.createTextNode() but that's not
> > concise and looks odd along with jQuery code.
>
> > So I wrote a tiny 3 line plugin jquery.new.js. It's more of a hit and
> > trial outcome.
>
> > jQuery.new = function(element) {
> > return $(document.createElement(element));
> > }
>
> > I wrapped the new element that was created with the jQuery object so I
> > can chain functions. For example:
> > var inputBox = $.new("input").attr("type", "text").attr("id",
> > "someText");
>
> > Is there a better way to do this? Or does jQuery already have this
> > functionality inbuilt?



[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread R. Rajesh Jeba Anbiah

On Aug 16, 7:16 pm, Stephan Beal <[EMAIL PROTECTED]> wrote:
> We've all attempted several different ways of highlighting navigation
> links which point to the current page. Often times we mark the page
> via our PHP by adding a class (e.g. "currentPage") to the navigation
> link which points to the current page, or some such. Here's a slightly
> different approach...
   

  FWIW, we have been using  Figure 4.20 technique for a longtime and then
switched back to "currentPage" class technique for it's simplicity.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/



[jQuery] |OT| Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-16 Thread R. Rajesh Jeba Anbiah

On Aug 16, 11:57 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> > > > $('#foo')[0]
> > > >Will throw error if there is no match, IIRC.
> > > No, it won't. It is not an error to fetch a nonexistent
> > > array element
> > Thanks for a nice explanation. I'm sorry for jumping
> > without reading it properly.
>
> Glad to help - but no apology needed! You should see some of the bloopers
> I've posted myself... :-)

Thanks for a new word "blooper" (learning English in jQuery
list:-))

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/



[jQuery] Re: Creating DOM elements on the fly

2007-08-16 Thread Erik Beeson

The jQuery function $() can parse HTML, as can the various DOM
functions (append, prepend, appendTo, etc):

$('').appendTo('#myForm');

--Erik


On 8/16/07, Anurag <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am a jQuery beginner. I am working on an application for which I
> need to create DOM elements on the fly. Previously I was using
> document.createElement() and document.createTextNode() but that's not
> concise and looks odd along with jQuery code.
>
> So I wrote a tiny 3 line plugin jquery.new.js. It's more of a hit and
> trial outcome.
>
> jQuery.new = function(element) {
> return $(document.createElement(element));
> }
>
> I wrapped the new element that was created with the jQuery object so I
> can chain functions. For example:
> var inputBox = $.new("input").attr("type", "text").attr("id",
> "someText");
>
> Is there a better way to do this? Or does jQuery already have this
> functionality inbuilt?
>
>


[jQuery] pngfix and css background images problem

2007-08-16 Thread rortelli

Hi all,
check the background of this page on FF and in IE:
http://www.ortelli.net/temp/woo/

The footer background works well in IE:  it's a background image, not
repeated.
For the header and the main content the background is vertically
repeated and the transparency/background is not applied...

Very strange behaviour... any idea?

You can download the full package here:
http://www.ortelli.net/temp/woo/woo.zip

Thanks in advance :P



[jQuery] Re: Creating DOM elements on the fly

2007-08-16 Thread Karl Rudd

It's already built in. For your example:

  var inputBox = $('').attr("type", "text").attr("id", "someText");

Or even:

  var inputBox = $('');

Karl Rudd

On 8/17/07, Anurag <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am a jQuery beginner. I am working on an application for which I
> need to create DOM elements on the fly. Previously I was using
> document.createElement() and document.createTextNode() but that's not
> concise and looks odd along with jQuery code.
>
> So I wrote a tiny 3 line plugin jquery.new.js. It's more of a hit and
> trial outcome.
>
> jQuery.new = function(element) {
> return $(document.createElement(element));
> }
>
> I wrapped the new element that was created with the jQuery object so I
> can chain functions. For example:
> var inputBox = $.new("input").attr("type", "text").attr("id",
> "someText");
>
> Is there a better way to do this? Or does jQuery already have this
> functionality inbuilt?
>
>


[jQuery] Creating DOM elements on the fly

2007-08-16 Thread Anurag

Hi,

I am a jQuery beginner. I am working on an application for which I
need to create DOM elements on the fly. Previously I was using
document.createElement() and document.createTextNode() but that's not
concise and looks odd along with jQuery code.

So I wrote a tiny 3 line plugin jquery.new.js. It's more of a hit and
trial outcome.

jQuery.new = function(element) {
return $(document.createElement(element));
}

I wrapped the new element that was created with the jQuery object so I
can chain functions. For example:
var inputBox = $.new("input").attr("type", "text").attr("id",
"someText");

Is there a better way to do this? Or does jQuery already have this
functionality inbuilt?



[jQuery] Re: AJAX error in IE with jQuery 1.1.3

2007-08-16 Thread [EMAIL PROTECTED]

Pleae paste your codes.

On 8月17日, 上午3时05分, "Estev o Lucas" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to know if somebody already had problems with IE when using the
> method of ajax with jQuery 1.1.3. The generated error was "object does not
> support this property or the method" and "access denied" and what was the
> solution?
>
> a hug
> Estev o Lucas



[jQuery] Broken link

2007-08-16 Thread Neil

Trivial, but the dev mailing list link at http://dev.jquery.com/wiki
appears broken.  Cheers.



[jQuery] Re: how does jQuery's timeout used?

2007-08-16 Thread Erik Beeson

I guess the timeout just means it will stop trying to complete the
request. I've never actually tried to use it. To get an alert like you
want, you might try using your own timer (untested):

var ajax_timeout;
$.ajax({
  ...,
  beforeSend: function() {
ajax_timeout = setTimeout(function() {
  alert('Request is taking a long time.');
}, 5000);
  },
  success: function() {
if(ajax_timeout) {
  clearTimeout(ajax_timeout);
}
  }
});

--Erik


On 8/16/07, niner <[EMAIL PROTECTED]> wrote:
>
> i would like to handle the timeout situation with jQuery but could not
> find a lot of information on that. i know you can specify
>
> timeout:5000
>
> as the ajax parameter. but what happens when it times out? i tried it
> and it does not do anything. what i want is a simple alert() to show
> when it times out in 5 seconds. how can i accomplish that?
>
> thanks.
>
>


[jQuery] Re: form ID is messed up if an element in the form is named "id"

2007-08-16 Thread Erik Beeson

Right. That's how JavaScript works, and it's by design. When you have:





And you do:

var formDOM = $('#form_id')[0];

Then formDOM.id will be "form_id" and formDOM.childID will be the DOM
node for the input. But if you call one of the children "id", then
formDOM.id will replace the form's id with the DOM node for the child.

This isn't a bug with jQuery, it's how JavaScript works.

--Erik


On 8/16/07, teken894 <[EMAIL PROTECTED]> wrote:
>
> 
>   value="my name is ID" />
> 
>
> $('form');
>
> I expect would get form#form_id.form_class
>
> but this is the result: form#[object HTMLInputElement].form_class
>
>
> I'm using the firebug (firefox) console, and the object referenced
> above links to the input class
>
>
> Because of this, I can't name an element "id", and also be able to
> select a form by ID using $("[EMAIL PROTECTED]");
>
>
> There are many workarounds, but doesn't this functionality seems to be
> a bug?
>
>


[jQuery] Re: What does "Unobtrusive Javascript" mean?

2007-08-16 Thread Pops

Howa,

Thank for the information.I like this graded support chart in this
article.   Good example of someone applying software engineering
principles to Web development.

I guess the "good" thing is that the industry is maturing. Inevitably
there will be efforts to consolidate, to provide meaning and to give
guidance because truth be told, it is a "Freaking Mess" out there.

Theses are all reasons why for many years people went with one
vendor.  The "web" broke that, but if you think about, we are going
back to that one vendor or narrowing down the resouces that you use.
It happens to all, you, me, etc, to everything we do, to every
product, to every web site, to every team or lone wolf programmer out
there.

I did read a blog yesterday, and I probably misunderstood him but I
was taken aside by what he said because he had a damn good argument
about something that I can relate to and have come across many times
in many of my product development over the years.

Many products come to a point where you have to make a decision where
you totally revamp, start fresh, where "progressive enhancement"  may
not be a good idea.  I would venturre that the older the product is,
the more true this is.While one might think that a migration or
phased design approach is a good idea to reach progressive
enchancement, it can actually make things worst in cost of
development, even adds complexity and the add to the development of
"Spaghetti Code."

Some have the luxury to do new things without contraints, some can not
afford that luxury and others can only afford to go slow at it, and by
afford I don't mean just cost, but you have customers that you can't
break the software and functionality on them.

For us, we are in a blend of this. We have a very dated system, yet
still have functionality and ideas that many are going to.  For the
web side,  this web 2.0 hangout for me is that effort to see how much
revamping we have to do.  Can we migrate smoothly?  Can we add more
Web 1.5 or 2.0 while keeping backward compatibility?   How much of the
server-side template processing will change, how much will be move to
the client?  The jQuery discovery has helped tremendously in this
effort.

Anyway, I appreciate all the input and yes, even an old dog can learn
new tricks or rather "commands." 

Thanks

--
HLS

On Aug 16, 10:38 pm, howa <[EMAIL PROTECTED]> wrote:
> http://developer.yahoo.com/yui/articles/gbs/
>
> Progressive Enhancement vs. Graceful Degradation
> The concepts of graceful degradation and progressive enhancement are
> often applied to describe browser support strategies. Indeed, they are
> closely related approaches to the engineering of "fault tolerance".
>
> These two concepts influence decision-making about browser support.
> Because they reflect different priorities, they frame the support
> discussion differently. Graceful degradation prioritizes presentation,
> and permits less widely-used browsers to receive less (and give less
> to the user). Progressive enhancement puts content at the center, and
> allows most browsers to receive more (and show more to the user).
> While close in meaning, progressive enhancement is a healthier and
> more forward-looking approach. Progressive enhancement is a core
> concept of Graded Browser Support.
>
> So to my understanding,
>
> Unobtrusive Javascript  ~ Graceful Degradation
>
> not really a good thing and not the same as Progressive Enhancement
>
> On 8月16日, 下午10時13分, Pops <[EMAIL PROTECTED]> wrote:
>
> > I"ve seen this term referred to a few times, especially here:
>
> >http://simonwillison.net/2007/Aug/15/jquery/
>
> > What does Unobtrusive Javascript mean?
>
> > I am getting the idea that jQuery offers a way to bypass a user
> > turning off JavaScript?
>
> > How does jQuery do this?
>
> > Thanks



[jQuery] Re: Superfish - huge issue with IE6

2007-08-16 Thread Joel Birch
On 8/17/07, muskokee <[EMAIL PROTECTED]> wrote:
>
>
> If you would like a url I would be happy to post one - just my dev
> site.
>
> Thanks a lot for any help you can offer.
>
> Sheri


Hi Sheri,

If you could post that url I'll try to have a look when I get the chance. My
brain can't parse that raw CSS into a working model unfortunately - but
wouldn't it be cool if it could! ;)

Joel Birch.


[jQuery] Re: IE6 ActiveX bleed not working jQuery 1.1.3.1 jqModal r10

2007-08-16 Thread Duncan

super star - thankyou!

On 8/17/07, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Duncan,
>
> Take a look here:
>
> http://dev.iceburg.net/jquery/jqModal/jqModal.css
>
> If you don't have these lines in your own stylesheet, or if you don't
> include his, it won't work:
>
> /* Background iframe styling for IE6. Prevents ActiveX bleed-through
> ( form elements, etc.) */
> * iframe.jqm {position:absolute;top:0;left:0;z-index:-1;
>  width: expression(this.parentNode.offsetWidth+'px');
>  height: expression(this.parentNode.offsetHeight+'px');
> }
>
>
> Hope that helps.
>
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
>
>
> On Aug 16, 2007, at 12:18 AM, Duncan wrote:
>
>
> Just in case this attachment didnt come thru I have put it up here
> http://www.sixfive.co.uk/jquery/modal.html
>
> No change either :-( it still doesnt seem to work.
>
> On 8/16/07, Duncan <[EMAIL PROTECTED]> wrote:
> I have a problem with IE6, jqModal r10 and jQuery 1.1.3.1.
>
> I cant get the Activex bleed / iframe for hiding the form elements to
> work properly in my version of IE6 with my code (attached). I spent
> close to 4 hours yesterday pulling apart my page to find that even at
> the lowest level with my version of the examples on the jqModal page
> it doesn't work. IE7 and FF are both fine on windows.
>
> However, (and here is what is really getting up my nose) when I run
> http://dev.iceburg.net/jquery/jqModal/ examples 1,2,3a,3b
> over the
> "Test for Internet Explorer" select box it works fine in IE6.
>
> Can someone unzip this and confirm my findings please? If I am indeed
> right/wrong (I would be surprised if I wasn't doing something daft)
> then does someone have some info on how I could fix it up?
>
> --
> Duncan I Loxton
> [EMAIL PROTECTED]
>
>
>
>
>
> --
> Duncan I Loxton
> [EMAIL PROTECTED]
>


-- 
Duncan I Loxton
[EMAIL PROTECTED]


[jQuery] how does jQuery's timeout used?

2007-08-16 Thread niner

i would like to handle the timeout situation with jQuery but could not
find a lot of information on that. i know you can specify

timeout:5000

as the ajax parameter. but what happens when it times out? i tried it
and it does not do anything. what i want is a simple alert() to show
when it times out in 5 seconds. how can i accomplish that?

thanks.



[jQuery] Re: select menu replacement plugin ?

2007-08-16 Thread RLFitch


Try http://lasso.pro/selectCombo/

Ransom Fitch


On Aug 16, 5:46 am, "Alexandre Plennevaux" <[EMAIL PROTECTED]>
wrote:
> hello friends,
>
>  i remember once someone posted a very nice select menu "skinner" plugin, 
> allowing to completely control the aspect of a dropdown menu. I've looked 
> through both plugin pages, but could not find it.
>
> Anybody knows about it?
>
> Thank you!
>
> Alexandre
>
> Alexandre Plennevaux - LAb[au] asbl.vzw / MediaRuimte
>
> Ce message Envoi est certifié sans virus connu.
> Analyse effectuée par AVG.
> Version: 7.5.483 / Base de données virus: 269.11.19/953 - Date: 14/08/2007 
> 17:19



[jQuery] form ID is messed up if an element in the form is named "id"

2007-08-16 Thread teken894


 


$('form');

I expect would get form#form_id.form_class

but this is the result: form#[object HTMLInputElement].form_class


I'm using the firebug (firefox) console, and the object referenced
above links to the input class


Because of this, I can't name an element "id", and also be able to
select a form by ID using $("[EMAIL PROTECTED]");


There are many workarounds, but doesn't this functionality seems to be
a bug?



[jQuery] Superfish - huge issue with IE6

2007-08-16 Thread muskokee

Hi Joel,

I am attempting to integrate superfish with my css menu.  IE6 looks
like a nightmare though!

I use different css for my menu than you have provided in the example
- I use visibility rather than tucking the ul levels up and away from
view.

When I turn the menu "on" (in my php script) so that Superfish is
activated, I remove the "visibility" portion and add your css (-999em)
so that they are compatible.

All of this works like a charm in real browsers, but IE6 creates a
complete mess of it.

Here is the css that is used when superfish is activated:


.wd_menu {padding:0; margin:0;}

.wd_menu li {float:left;position:relative;text-align:center;list-style-
type:none;}

.wd_menu a, .wd_menu a:visited {
display:block;
font-size:12px;
text-decoration:none;
color:#fff;
width:auto;
height:35px;
line-height:35px;
padding:0px 10px;
}
.wd_menu ul a span {}

.wd_menu li a.toplink:hover {color:#C0C0C0;background:#000;}
.wd_menu li:hover a.toplink {color:#C0C0C0;background:#000;}

/*removing the float, containing the items, assiging a border*/
.wd_menu li ul {height:auto;float:none;padding:0; margin:0;border:1px
solid #C9C9C9;}
.wd_menu ul li{text-align:left;}
.wd_menu ul a, .wd_menu ul a:visited {background:#f5f5f5; color:#000;
height:auto; line-height:14px; padding-top:5px; padding-bottom:
5px;width:100px;}
.wd_menu ul a:hover {background:#c0c0c0;}

.wd_menu ul a.drop, .wd_menu ul a.drop:visited {
background:#f5f5f5 url('arrow.png') right center no-repeat;
}
.wd_menu ul a.drop:hover{
background:#c0c0c0 url('arrow_hover.png') right center no-repeat;
}

.wd_menu li ul {
top:-999em;
position:absolute;
width:120px;
}

/*level 1*/
.wd_menu li:hover ul, ul.wd_menu li.sfHover ul {left:-1px;top:35px;}
.wd_menu li:hover li ul,.wd_menu li.sfHover li ul { top:-999em;}

/*level 2*/
.wd_menu li li:hover ul, ul.wd_menu li li.sfHover ul  {left:
120px;top:-1px;}
.wd_menu li li:hover li ul,.wd_menu li li.sfHover li ul {   top:-999em;}

/*level 3*/
.wd_menu li li li:hover ul, ul.wd_menu li li li.sfHover ul {left:
120px;top:-1px;}
.wd_menu li li li:hover li ul,.wd_menu li li li.sfHover li ul {
top:-999em;}

/*level 4*/
.wd_menu li li li li:hover ul, ul.wd_menu li li li li.sfHover ul {left:
120px;top:-1px;}
.wd_menu li li li li:hover li ul,.wd_menu li li li li.sfHover li ul {
top:-999em;}

/*level 5*/
.wd_menu li li li li li:hover ul, ul.wd_menu li li li li li.sfHover ul
{left:120px;top:-1px;}
.wd_menu li li li li li:hover li ul,.wd_menu li li li li li.sfHover li
ul {top:-999em;}

.superfish li:hover ul,/*level 1*/
.superfish li li:hover ul,/*level 2*/
.superfish li li li:hover ul,/*level 3*/
.superfish li li li li:hover ul,/*level 4*/
.superfish li li li li li:hover ul  /*level 5*/ {
top:-999em;
}

I am using just a regular call (i had the bgiframe in place but
removed it in case of some conflict - no difference!)


$(document).ready(function(){
$("ul.wd_menu").superfish({
hoverClass  : "sfHover",
currentClass: "overideThisToUse", /*new to v1.2a*/
delay   : 500,
animation   : {opacity:"show",height:"show"},
speed   : "normal"
});
});


If you would like a url I would be happy to post one - just my dev
site.

Thanks a lot for any help you can offer.

Sheri



[jQuery] Totally new to this...

2007-08-16 Thread Shaft


Totally new to this and code ignorant but I did try to build a template
webpage with the functions I want to have, so 
http://www.qbox.gr/test_asxeto/sitetest.html here  it is... (I did use 2
different/irrelavent scripts but I think that I could add in terms of
content and fx and lose on KBytes just by using one framework). 

Since these are my baby steps in jQuery I did gave it a 
http://www.qbox.gr/test_asxeto/jq_test/dragJq.html try  but stumbled again
in programming... 

Basicaly I would like to know if my first experiment is 100% achivable
through jQuery and if so, if I can't manage to set it on my own - where/who
can help me... (gone through the tutorial but I'm a "give me an example"
sort of guy - then I build on what I know and ask for more :-D)

-- 
View this message in context: 
http://www.nabble.com/Totally-new-to-this...-tf4282838s15494.html#a12191645
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread John Resig

Great work Mitch - if someone wants to beat me to you, you should move
this over to the wiki. I'll try to take a stab at it, if I can
remember.

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:
>
> I think this is a very stimulating topic - the responses have given me
> a lot of insights to the frameworks of which jQuery belongs.
>
> I see there are some big issues here that kind of scare me, the one
> that stood out to me is the claim that jQurey is not for beginners who
> don't know the DOM, CSS and JS.
>
> I would contend that it is precisely the beginner that jQuery appeals
> to.
>
> Using myself as a test case - I came in knowing a little bit about JS,
> a bit more about CSS and pretty much nothing about DOM..
>
> I had tried to use JS and CSS to do some fancy interface work and
> really got stuck in the complexities of JS. Then I found JQ and the
> world rocked for me. Suddenly I could do amazing things with my GUIs.
> Sure I had holes in my knowledge bank, and its shown in this mailing
> list, but I think you will admit this is a pretty impressive interface
> for a beginner to make:
>
> http://www.whatbird.com/wwwroot/Components/Complete_Search_Tab.html
>
> I have tons to learn but what a great and fun way to get started!
>
> I do think there is one hole in the JQ web site and that is there are
> not enough real life examples.
>
> To that end I am putting together jQuery Cheat Sheet (TM) (C) How To.
>
> I plan to make this available for everyone to contibute to. These two
> How Tos are examples of the format I am proposing to begin with. If
> anyone has any suggestions would love to hear them. If you have some
> suggestions for How Tos let me know and I will try and create them. I
> was thinking of making this into some kind of wiki like system where
> it would allow poeple to create How Tos that ended up in this standard
> format when formatted.
>
> http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_not.html
>
> http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_attr.html
>
> The JQ web site and other sites do a great job on explaining the API
> (even if most of the examples dont show up correclty in IE7) - whats
> missing is the practical side of the package. Real world non verbose
> examples of how to use the important features presented in a non
> trival but lucid manner, with the key concepts listed for indexing as
> well as the discussion is key to these working.
>
> Mitch
>
>


[jQuery] Re: Question about event.StopPropagation()

2007-08-16 Thread Michael Geary

> > if (event.target.id != 'match') 

> Thank you for the syntax correctoin. But how does jQuery know 
> that 'match' is an ID and not an ordinary variable.

It's neither. 'match' is a string.

event is a variable. event.target is a property of the event variable, and
event.target.id is a property of event.target.

> I have the handler set up but it seems to match any div that 
> is clicked including the #match ID which I want it to ignore. Grrr.
> 
> So I am wondering is there some kind of process I could 
> follow on Firebug that would help me see where things are going wrong?

I would add this statement where you want to look around (e.g. at the first
line of your click event function):

   debugger;

Firebug will stop there and you can look at variables and stuff. For
example, you can type event.target.id into the Watch window and it will show
you the value of that property.

I wonder if it should be this.id instead of event.target.id? See what is in
them both...

-Mike



[jQuery] Re: Question about event.StopPropagation()

2007-08-16 Thread Mitch

Thank you for the syntax correctoin. But how does jQuery know that
'match' is an ID and not an ordinary variable.

I have the handler set up but it seems to match any div that is
clicked including the #match ID which I want it to ignore. Grrr.

So I am wondering is there some kind of process I could follow on
Firebug that would help me see where things are going wrong?

I have been putting alert("here") into this handler, like this

   $("div").click(function(event) {
if (event.target.id != 'match') {
alert("here")
$("#text800birds").css( { background: "#EE",
color: "#FF"} );
}
});

And what I see is 7 alerts appearing no matter where I click.

That really throws me. And I dont know what to do now to find out
where things are messing up.

Again the purpose of all this is to simulate focus and unfocus on a
DIV. I can get it to work in a small example but in real life, nada.

Mitch

On Aug 16, 7:16 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> I think you mean:
>
> if (event.target.id != 'match')
>
> Karl Rudd
>
> On 8/17/07, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I think this will work:
>
> > if (event.target.id <> 'match')
>
> > -- Josh
>
> > - Original Message -
> > From: "Mitch" <[EMAIL PROTECTED]>
> > To: "jQuery (English)" 
> > Sent: Thursday, August 16, 2007 6:32 PM
> > Subject: [jQuery] Question about event.StopPropagation()
>
> > > I am trying to get event bubbling to work right and have this snippet
>
> > > $("div").click(function(event) {
> > > if (event.target == this) {
> > > $("#text800birds").css( { background: "#EE", color:
> > > "#FF"} );
> > > }
> > > });
>
> > > I would like to change this part
>
> > > if (event.target == this)
>
> > > to
>
> > > if (event.target <> #match)
>
> > > so that it wont pass the event if the div is #match.
>
> > > Can you tell me the proper syntax?
>
> > > Mitch- Hide quoted text -
>
> - Show quoted text -



[jQuery] Re: What does "Unobtrusive Javascript" mean?

2007-08-16 Thread howa

http://developer.yahoo.com/yui/articles/gbs/

Progressive Enhancement vs. Graceful Degradation
The concepts of graceful degradation and progressive enhancement are
often applied to describe browser support strategies. Indeed, they are
closely related approaches to the engineering of "fault tolerance".

These two concepts influence decision-making about browser support.
Because they reflect different priorities, they frame the support
discussion differently. Graceful degradation prioritizes presentation,
and permits less widely-used browsers to receive less (and give less
to the user). Progressive enhancement puts content at the center, and
allows most browsers to receive more (and show more to the user).
While close in meaning, progressive enhancement is a healthier and
more forward-looking approach. Progressive enhancement is a core
concept of Graded Browser Support.

So to my understanding,

Unobtrusive Javascript  ~ Graceful Degradation

not really a good thing and not the same as Progressive Enhancement



On 8月16日, 下午10時13分, Pops <[EMAIL PROTECTED]> wrote:
> I"ve seen this term referred to a few times, especially here:
>
> http://simonwillison.net/2007/Aug/15/jquery/
>
> What does Unobtrusive Javascript mean?
>
> I am getting the idea that jQuery offers a way to bypass a user
> turning off JavaScript?
>
> How does jQuery do this?
>
> Thanks



[jQuery] Re: Question about event.StopPropagation()

2007-08-16 Thread Michael Geary

> I am trying to get event bubbling to work right and have this snippet
> 
>   $("div").click(function(event) {
>   if (event.target == this) {
>   $("#text800birds").css( { background: "#EE", color:
"#FF"} );
>   }
>   });
> 
> I would like to change this part
> 
> if (event.target == this)
> 
> to
> 
> if (event.target <> #match)
> 
> so that it wont pass the event if the div is #match.

Mitch, I think you want:

   if( event.target.id != 'match' )

Does that sound right?

-Mike



[jQuery] Re: Question about event.StopPropagation()

2007-08-16 Thread Karl Rudd

I think you mean:

if (event.target.id != 'match')

Karl Rudd

On 8/17/07, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
> I think this will work:
>
> if (event.target.id <> 'match')
>
> -- Josh
>
> - Original Message -
> From: "Mitch" <[EMAIL PROTECTED]>
> To: "jQuery (English)" 
> Sent: Thursday, August 16, 2007 6:32 PM
> Subject: [jQuery] Question about event.StopPropagation()
>
>
> >
> > I am trying to get event bubbling to work right and have this snippet
> >
> > $("div").click(function(event) {
> > if (event.target == this) {
> > $("#text800birds").css( { background: "#EE", color:
> > "#FF"} );
> > }
> > });
> >
> > I would like to change this part
> >
> > if (event.target == this)
> >
> > to
> >
> > if (event.target <> #match)
> >
> > so that it wont pass the event if the div is #match.
> >
> > Can you tell me the proper syntax?
> >
> > Mitch
> >
>


[jQuery] Re: Question about event.StopPropagation()

2007-08-16 Thread Josh Nathanson


I think this will work:

if (event.target.id <> 'match')

-- Josh

- Original Message - 
From: "Mitch" <[EMAIL PROTECTED]>

To: "jQuery (English)" 
Sent: Thursday, August 16, 2007 6:32 PM
Subject: [jQuery] Question about event.StopPropagation()




I am trying to get event bubbling to work right and have this snippet

$("div").click(function(event) {
if (event.target == this) {
$("#text800birds").css( { background: "#EE", color:
"#FF"} );
}
});

I would like to change this part

if (event.target == this)

to

if (event.target <> #match)

so that it wont pass the event if the div is #match.

Can you tell me the proper syntax?

Mitch



[jQuery] Re: question about attr()

2007-08-16 Thread Estevão Lucas
Retrieves the font-weight style of the first paragraph. All style properties
with a dash (like 'font-weight'), you have to write it in camelCase. In
other words: Every time you have a '-' in a property, remove it and replace
the next character with an uppercase representation of itself. Eg.
fontWeight, fontSize, fontFamily, borderWidth, borderStyle,
borderBottomWidth etc.

http://manalang.com/jquery/docs/index.html#css-name
http://projects.cyberlot.net/trac/jqpie/wiki/CamelCase

2007/8/16, Klaus Hartl <[EMAIL PROTECTED]>:
>
>
> Guapo wrote:
> > i want to make all tds have a top vertical align, so i write the
> > following code:
> >
> > $("td").attr("valign","top");
>
> Why not:
>
> td {
> vertical-align: top;
> }
>
>
>
> --Klaus
>
>
>


-- 
Abraços
Estevão Lucas


[jQuery] Re: question about attr()

2007-08-16 Thread Guapo

i don't use the vertical-align property, cuz i saw this webpage(http://
www.westciv.com/style_master/academy/browser_support/text.html), it
seems that this property is not supported by lots of browsers.

On Aug 17, 9:07 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Guapo wrote:
> > i want to make all tds have a top vertical align, so i write the
> > following code:
>
> > $("td").attr("valign","top");
>
> Why not:
>
> td {
> vertical-align: top;
>
> }
>
> --Klaus



[jQuery] Question about event.StopPropagation()

2007-08-16 Thread Mitch

I am trying to get event bubbling to work right and have this snippet

$("div").click(function(event) {
if (event.target == this) {
$("#text800birds").css( { background: "#EE", color:
"#FF"} );
}
});

I would like to change this part

if (event.target == this)

to

if (event.target <> #match)

so that it wont pass the event if the div is #match.

Can you tell me the proper syntax?

Mitch



[jQuery] Re: question about attr()

2007-08-16 Thread Klaus Hartl

Guapo wrote:
> i want to make all tds have a top vertical align, so i write the
> following code:
> 
> $("td").attr("valign","top");

Why not:

td {
vertical-align: top;
}



--Klaus




[jQuery] Re: question about attr()

2007-08-16 Thread Benjamin Sterling
I personally can't explain it, but that seems to be the way with a lot of
two work attributes.  textAlign, fontSize.

On 8/16/07, Guapo <[EMAIL PROTECTED]> wrote:
>
>
> i want to make all tds have a top vertical align, so i write the
> following code:
>
> $("td").attr("valign","top");
>
> but it failed. and i found if i change the letter a in "valign" to
> uppercase, it works well. code as follows:
>
> $("td").attr("vAlign","top");
>
> anyone can explain it?
> test on window xp sp2, ie7. firefox works well all the time.
>
>


-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] question about attr()

2007-08-16 Thread Guapo

i want to make all tds have a top vertical align, so i write the
following code:

$("td").attr("valign","top");

but it failed. and i found if i change the letter a in "valign" to
uppercase, it works well. code as follows:

$("td").attr("vAlign","top");

anyone can explain it?
test on window xp sp2, ie7. firefox works well all the time.



[jQuery] [OT] A Good Cause: AIR (Accessibility Internet Rally)

2007-08-16 Thread Kenneth
I am reposting this from March, as this year's events are coming up really
soon. Please read! :)

I know many of you here share my desire to produce accessible websites, so
what more can we do though, besides that which we practice in our current
roles? Well, for those of you who would like to put your design ||
development skills to good use by helping a non-profit organization (NPO),
you should check out AIR, hosted by Knowbility:

http://knowbility.org/air/ - AIR: Accessibility Internet Rally

>From the site, here's the rundown of how it works:

1. Form a web design team of up to four professionals and register your team
with an AIR programs in your area.
2. Choose a training dates and sign-up to receive valuable accessibility
training and access to free online accessibility testing software.
Participants MUST attend the basic training. All registered team members
also have the option to attend advanced accessibility training, which
includes how to use CSS, javascript and other advanced technologies for
maximum accessibility.
3. Attend the matching kickoff party and meet your nonprofit "client."
4. Use the lead time to plan the site with your nonprofit partner.
5. Attend the Rally Day, collect your T-shirt and goody bag and build your
entry web site for your nonprofit partner.
6. Come to the awards dinner and celebrate the good work of everyone and
recognize the winners...which might be you!

I'm not sure about the other cities, but I know AIR:Austin takes place in
the fall. Also, there are other modes of participation, such as volunteering
to help run the event, or program sponsorship.

Also from the site, here's a list of 10 reasons why you should participate:

   1. Your whole team gets the bonding experience of learning together how
and why to make web sites accessible to people with disabilities (and PDAs
and cell phones, and...)
   2. All the coolest people have participated - frog design, Catapult
Systems, MediaTruck, Bazzirk, IBM, Dell, Team Navanax, Nion, many many more.
   3. Networking - get up close and personal with your peers in the industry
and some of the very artists who keep Austin weird.
   4. Access to new accessible design tools - and the folks who make them.
   5. AIR judges are experts and become your friends.
   6. Progress party, kickoff party, wrap party, awards party - BIG FUN!
   7. A copy of the definitive accessibility book - Maximum Accessibility -
is given to each team.
   8. Your work featured in all AIR-Austin publicity.
   9. Do good for a nonprofit arts, environment, or social service
organization.
  10. You could win!


[jQuery] Re: One callback for two ajax requests

2007-08-16 Thread Felix Geisendörfer
This just cried for an elegant solution, and I'm in 
anything-but-client-work-mood again : ). So here it comes:


Usage:
---
var Stack = new Callstack();
$.getJSON("jsonA.js", {}, Stack.add('requestA'));
$.getJSON("jsonB.js", {}, Stack.add('requestB'));

Stack.onComplete = function(stack) {
   console.log('All request are completed, see:', stack);
   console.log('Response from requestA:', stack.requestA.arguments[0]);
}
---

Code you need to use the above:
---
var Callstack = function() {}
$.extend(Callstack.prototype, {
   stack: {_length: 0}
   , add: function(name, callback) {
   if ($.isFunction(name)) {
   callback = name;
   }
   if (arguments[1] && typeof arguments[1] == 'string') {
   name == arguments[1];
   }
   if (name == '_length') {
   throw 'Callstack::add - Forbidden stack item name "_length"!';
   }
   if (!name) {
   name = this.stack._length;
   }
  
   var item = {

   arguments: []
   , callback: callback
   , completed: false
   };
  
   this.stack[name] = item;

   this.stack._length++;
  
   var self = this;

   return function() {
   self.handle(item, arguments);
   }
   }
   , update: function() {
   var completed = true;
   $.each(this.stack, function(p) {
   if (p != '_length') {
   completed = completed && this.completed;
   }
   });
  
   if (completed == true) {

   delete this.stack['_length'];
   this.onComplete(this.stack);
   }
   }
   , handle: function(item, args) {
   var r;
   if ($.isFunction(item.callback)) {
   r = callback.apply(item.callback, args);
   if (r === false) {
   return r;
   }
   }
  
   item.arguments = args;

   item.completed = true;
   this.update();
   return r;
   }
   , onComplete: function() {
   alert('Stack done executing!');
   }
   , reset: function() {
   this.stack = {};
   }
});
---

I also threw in some good stuff, for example you do not have to 
explicitly name you stack items, it will use auto-incrementing values 
automatically if you don't. Also: You can pass a callback to the 
Stack.add() function that acts as a gatekeeper for determining if the 
stack item has executed successfully. If that function returns falls 
then the stack item will not be thought of as completed and the item can 
be triggered again using Callstack.handle().


One could also base a little plugin on this that will only trigger a 
function if all elements in the current selection have triggered a 
certain event:


Sample usage:
---
$(function() {
   $('a').stack('click', function(stack) {
   console.log('All links in this document where clicked once! 
See:', stack);

   }, function() {
   // Cancel link default event
   return false;
   });
});
---

Plugin code:
---
$.fn.stack = function(event, onComplete, fn) {
   var Stack = new Callstack();
   this.each(function() {
   var stackFn = Stack.add();
   $(this)[event](function() {
   var r;
   if ($.isFunction(fn)) {
   r = fn.apply(this, arguments);
   }
  
   stackFn.apply(this, arguments);

   return r;
   });
   });
   Stack.onComplete = onComplete;
}
---

Hmm, I guess I should have and eventually will make a blog post about 
this. Meanwhile I hope you or somebody else finds it useful : ).

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Michael Geary wrote:
Good ideas, Thiago. The second one - nested AJAX calls 
- will definitely work, and it is probably the simplest way to do this:

   $.getJSON("url1", {}, function( json1 ) {
  $.getJSON("url2", {}, function( json2 ) {
 // do something with json1 and json2
  });
   });
That does serialize the two AJAX/JSON calls instead of firing them 
both off at once, though. (The second request is made when the first 
one finishes.)
 
If you want to fire the two AJAX calls together (especially a good 
idea if they are coming from different servers), then you'd want 
something like your first idea. There is one

[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Mitch

I think this is a very stimulating topic - the responses have given me
a lot of insights to the frameworks of which jQuery belongs.

I see there are some big issues here that kind of scare me, the one
that stood out to me is the claim that jQurey is not for beginners who
don't know the DOM, CSS and JS.

I would contend that it is precisely the beginner that jQuery appeals
to.

Using myself as a test case - I came in knowing a little bit about JS,
a bit more about CSS and pretty much nothing about DOM..

I had tried to use JS and CSS to do some fancy interface work and
really got stuck in the complexities of JS. Then I found JQ and the
world rocked for me. Suddenly I could do amazing things with my GUIs.
Sure I had holes in my knowledge bank, and its shown in this mailing
list, but I think you will admit this is a pretty impressive interface
for a beginner to make:

http://www.whatbird.com/wwwroot/Components/Complete_Search_Tab.html

I have tons to learn but what a great and fun way to get started!

I do think there is one hole in the JQ web site and that is there are
not enough real life examples.

To that end I am putting together jQuery Cheat Sheet (TM) (C) How To.

I plan to make this available for everyone to contibute to. These two
How Tos are examples of the format I am proposing to begin with. If
anyone has any suggestions would love to hear them. If you have some
suggestions for How Tos let me know and I will try and create them. I
was thinking of making this into some kind of wiki like system where
it would allow poeple to create How Tos that ended up in this standard
format when formatted.

http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_not.html

http://www.whatbird.com/wwwroot/Components/jQuery_How_Do_I_attr.html

The JQ web site and other sites do a great job on explaining the API
(even if most of the examples dont show up correclty in IE7) - whats
missing is the practical side of the package. Real world non verbose
examples of how to use the important features presented in a non
trival but lucid manner, with the key concepts listed for indexing as
well as the discussion is key to these working.

Mitch



[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread Karl Swedberg


On Aug 16, 2007, at 3:05 PM, Stephan Beal wrote:



On Aug 16, 9:03 pm, Stephan Beal <[EMAIL PROTECTED]> wrote:

and your above point, i'd love to see it. Maybe a plugin with options
for ignoring/respecting GET parameters?


And while you're writing that plugin (hint, hint ;), another point to
address is the common practice of linking some element of the site
header back to the home page. e.g. clicking the site logo takes you to
'/'. You don't want that link marked like this. That's really where
the benefit of restricting your selector to your navigation menu comes
in, i think.



yeah, I think I'd like to have something like that for a plugin,  
too.. I'll try to whip something up, but I'm out of town for a few  
days, so I won't be able to get to it until next week sometime.


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com





[jQuery] Re: What does "Unobtrusive Javascript" mean?

2007-08-16 Thread cdomigan

I would agree with Michael Geary. My understanding of Unobtrusive
Javascript is keeping a clean separation of content, presentation and
behaviours.



[jQuery] Re: Cycle Plugin update

2007-08-16 Thread Mike Alsup

> A+ Mr. Alsup!
>
> Joel Birch.
>
> Yes, thanks so much for these files, Mike!
>
> (A+)++ Mr. Alsup!
>
>
> --Karl

Thanks, guys.  Glad you found them useful!


[jQuery] Re: One callback for two ajax requests

2007-08-16 Thread Michael Geary
Good ideas, Thiago. The second one - nested AJAX calls - will definitely
work, and it is probably the simplest way to do this:
   $.getJSON("url1", {}, function( json1 ) {
  $.getJSON("url2", {}, function( json2 ) {
 // do something with json1 and json2
  });
   });
That does serialize the two AJAX/JSON calls instead of firing them both off
at once, though. (The second request is made when the first one finishes.)
 
If you want to fire the two AJAX calls together (especially a good idea if
they are coming from different servers), then you'd want something like your
first idea. There is one bug in that code - it will lose the first JSON
response, whichever one comes back first. So you would need to add a bit
more code to keep track of the two separate JSON objects.
 
There's a similar problem in the Google Mapplet API, where every Maps API
information request function such as map.getCenter() runs asynchronously
with a callback, much like an AJAX call. You might write mapplet code like
this:
map.getSizeAsync( function( size ) {
map.getBoundsAsync( function( bounds ) {
map.getCenterAsync( function( center ) {
// do something with size, bounds, and center
});
});
});
I wrote a utility function that reduces the code to:
GAsync( map, 'getSize', 'getBounds', 'getCenter',
function( size, bounds, center ) {
// do something with size, bounds, and center
});
and it runs the three requests in parallel.
 
As you can see, that's essentially the same problem. It should be easy to
adapt this GAsync() code into a jQuery plugin to manage multiple AJAX/JSON
requests. I may look at it if I get a little time. The code might look
something like this:
   $.getMultiJSON( "url1", {}, "url2", {},
  function( json1, json2 ) {
 // do something with json1 and json2
  });
For a simple case like this it's probably overkill though - with just two
JSON responses to keep track of, there are several ways you could easily do
it. Or just use the nested callbacks if it doesn't matter that the calls are
serialized.
 
-Mike



  _  

From: Thiago Ferreira

just a thought...code will be executed after the second call..

var oneCall = false;

function fn(json){
if(!oneCall){
   oneCall = true;
   return;
 }
 //code here
}

$.getJSON("url1", {}, fn);
$.getJSON("url2", {}, fn);


or you could put the second ajax call inside the function of the first one
or the other way around...


On 8/16/07, Jones <[EMAIL PROTECTED]> wrote: 


Hello,

the following code provides one callback per ajax request:

$.getJSON("url1", {}, function(json) {
do something...
});
$.getJSON("url2", {}, function(json) {
do something...
});

The problem is, that I need to call a function when both ajax requests
are finished.

Has anybody an idea?


Another question: Does anybody know a german jQuery group or something 
similar?

Jones






[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread weepy

It's fair to say that the documentation is a little thin on the
ground. I've been writing jQuery for a long while and I'd never even
heard of the if() or eq() functions, let alone lt() and gt(). Having
said that - what is there is generally very well written and and
covers alot. It is also very concise which is both good and bad.


On Aug 16, 11:43 pm, David Duymelinck <[EMAIL PROTECTED]> wrote:
> On Aug 16, 10:27 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
>
> > As a non-programmer, (HTML/CSS only) I understand lt() and gt() mainly
> > because of < and >.
> > I think those are very easy.  The place I get confused a little is when you
> > can say $("p:gt(4)") and $("p").gt(4) and get the same thing.  Why both?  I
> > suppose the answer is "because some people like it one way and some the
> > otht ter".
>
> I believe John posted in another thread the methods are gone in future
> releases and the selectors stay. So no more confusion for you :)
>
>
>
> > Glen
>
> > On 8/16/07, Rey Bango <[EMAIL PROTECTED]> wrote:
>
> > > Amazon.
>
> > > Rey
>
> > > Andy Matthews wrote:
> > > > Karl...
>
> > > > Where would be the best place for my company to purchase your book so
> > > > that you will get the maximum benefit?
>
> > > > 
> > > > *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> > > > *On Behalf Of *Karl Swedberg
> > > > *Sent:* Thursday, August 16, 2007 2:15 PM
> > > > *To:* jquery-en@googlegroups.com
> > > > *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > > special-case uses for both function calls and method names
>
> > > > Andy,
>
> > > > I realize these are contrived examples, but if you're interested in
> > > > seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> > > > be used for, here are a few links that might be helpful:
>
> > >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> > >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> > > >http://book.learningjquery.com/3810_02_code/selectors.html
> > > >http://book.learningjquery.com/3810_03_code/traversing.html
>
> > > > --Karl
> > > > _
> > > > Karl Swedberg
> > > >www.englishrules.com
> > > >www.learningjquery.com
>
> > > > On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
>
> > > >> John...
>
> > > >> I should have added on to my OP. Better examples are really what is
> > > >> needed,
> > > >> not changes to the language. Let me read through and see possible RW
> > > >> examples of eq() or is() and let me say "hey I did that very thing last
> > > >> week, but with 10 more lines of code)".
>
> > > >> andy
>
> > > >> -Original Message-
> > > >> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > > >> Behalf Of John Resig
> > > >> Sent: Thursday, August 16, 2007 1:48 PM
> > > >> To: jquery-en@googlegroups.com
> > > >> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > special-case
> > > >> uses for both function calls and method names
>
> > > >> Sure, that makes sense - and it's obviously difficult. I think the
> > > burden
> > > >> may lie on us to write better examples - although, it's hard to think
> > > of
> > > >> ones that aren't complex that also aren't contrived.
>
> > > >> At this point, I look for fringe cases in jQuery where, simply, a
> > > >> plugin is
> > > >> unable to duplicate functionality (or where a plugin would be hugely
> > > >> bloated, where the result in core would be quite simple, instead).
>
> > > >> That being said, I'm still advancing the library with some fun methods
> > > >> like
> > > >> .andSelf() whose uses won't become commonly apparent until far down the
> > > >> line.
>
> > > >> --John
>
> > > >> On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> > > >>> John...
>
> > > >>> To be fair...it's very easy to learn the basics of jQuery, but it's
> > > >>> quite a lot of work and time to learn the really cool stuff. I've
> > > >>> never used eq() or
> > > >>> if() and those other because I simply don't understand what they do.
> > > >>> I'm sure some of them could improve my code dramatically but I don't
> > > >>> even know WHEN I might use them, so I don't know when to look for
> > > >>> them. Does that makes sense?
>
> > > >>> andy
>
> > > >>> -Original Message-
> > > >>> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> > > >>> On Behalf Of John Resig
> > > >>> Sent: Thursday, August 16, 2007 12:53 PM
> > > >>> To: jquery-en@googlegroups.com
> > > >>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > >>> special-case uses for both function calls and method names
>
> > > >>> I don't understand this argument at all. So this guy is proposing that
> > > >>> we change all the jQuery methods to:
>
> > > >>> $Array([array of elems])
> > > >>> $Selector("str")
> > > >>> $HTML("html")
> > > >>> $Element(DOMElement)
>
> > > >>> and:
>
> > > >>> .appendEleme

[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread David Duymelinck



On Aug 16, 10:27 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> As a non-programmer, (HTML/CSS only) I understand lt() and gt() mainly
> because of < and >.
> I think those are very easy.  The place I get confused a little is when you
> can say $("p:gt(4)") and $("p").gt(4) and get the same thing.  Why both?  I
> suppose the answer is "because some people like it one way and some the
> other".
>

I believe John posted in another thread the methods are gone in future
releases and the selectors stay. So no more confusion for you :)

>
> Glen
>
> On 8/16/07, Rey Bango <[EMAIL PROTECTED]> wrote:
>
>
>
> > Amazon.
>
> > Rey
>
> > Andy Matthews wrote:
> > > Karl...
>
> > > Where would be the best place for my company to purchase your book so
> > > that you will get the maximum benefit?
>
> > > 
> > > *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> > > *On Behalf Of *Karl Swedberg
> > > *Sent:* Thursday, August 16, 2007 2:15 PM
> > > *To:* jquery-en@googlegroups.com
> > > *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > > special-case uses for both function calls and method names
>
> > > Andy,
>
> > > I realize these are contrived examples, but if you're interested in
> > > seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> > > be used for, here are a few links that might be helpful:
>
> >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> >http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...
>
> > >http://book.learningjquery.com/3810_02_code/selectors.html
> > >http://book.learningjquery.com/3810_03_code/traversing.html
>
> > > --Karl
> > > _
> > > Karl Swedberg
> > >www.englishrules.com
> > >www.learningjquery.com
>
> > > On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
>
> > >> John...
>
> > >> I should have added on to my OP. Better examples are really what is
> > >> needed,
> > >> not changes to the language. Let me read through and see possible RW
> > >> examples of eq() or is() and let me say "hey I did that very thing last
> > >> week, but with 10 more lines of code)".
>
> > >> andy
>
> > >> -Original Message-
> > >> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > >> Behalf Of John Resig
> > >> Sent: Thursday, August 16, 2007 1:48 PM
> > >> To: jquery-en@googlegroups.com
> > >> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > special-case
> > >> uses for both function calls and method names
>
> > >> Sure, that makes sense - and it's obviously difficult. I think the
> > burden
> > >> may lie on us to write better examples - although, it's hard to think
> > of
> > >> ones that aren't complex that also aren't contrived.
>
> > >> At this point, I look for fringe cases in jQuery where, simply, a
> > >> plugin is
> > >> unable to duplicate functionality (or where a plugin would be hugely
> > >> bloated, where the result in core would be quite simple, instead).
>
> > >> That being said, I'm still advancing the library with some fun methods
> > >> like
> > >> .andSelf() whose uses won't become commonly apparent until far down the
> > >> line.
>
> > >> --John
>
> > >> On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> > >>> John...
>
> > >>> To be fair...it's very easy to learn the basics of jQuery, but it's
> > >>> quite a lot of work and time to learn the really cool stuff. I've
> > >>> never used eq() or
> > >>> if() and those other because I simply don't understand what they do.
> > >>> I'm sure some of them could improve my code dramatically but I don't
> > >>> even know WHEN I might use them, so I don't know when to look for
> > >>> them. Does that makes sense?
>
> > >>> andy
>
> > >>> -Original Message-
> > >>> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> > >>> On Behalf Of John Resig
> > >>> Sent: Thursday, August 16, 2007 12:53 PM
> > >>> To: jquery-en@googlegroups.com
> > >>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > >>> special-case uses for both function calls and method names
>
> > >>> I don't understand this argument at all. So this guy is proposing that
> > >>> we change all the jQuery methods to:
>
> > >>> $Array([array of elems])
> > >>> $Selector("str")
> > >>> $HTML("html")
> > >>> $Element(DOMElement)
>
> > >>> and:
>
> > >>> .appendElement(DOMElement)
> > >>> .appendHTML("html")
> > >>> .appendArray([array of elems])
>
> > >>> what on earth does that gain you? What's the purpose of using a
> > >>> language that can overload arguments and not actually using that
> > >>> feature? What's the advantage of increasing the size of your API
> > 4-fold?
>
> > >>> Incredibly weak argument, obviously someone who's never used the
> > library.
>
> >  Some method names make no
> >  immediate sense, like .one or .eq, and you can't immediately tell if
> >  a method acts on the first element in the collection or al

[jQuery] Re: new Plugin every: jQuery-oriented setTimeout and setInterval

2007-08-16 Thread Blair Mitchelmore

http://jquery.offput.ca/js/jquery.timers.js

-blair

On Aug 15, 9:23 pm, oliver <[EMAIL PROTECTED]> wrote:
> blair, these are really nice: the labels give excellent granularity,
> and I like the "x times" feature of the interval.
>
> but... where is the code?
>
> oliver
>
> On Aug 13, 3:09 pm, Blair Mitchelmore <[EMAIL PROTECTED]>
> wrote:
>
> > So I actually wrote this plugin almost six months ago, but a few weeks
> > ago I fleshed it out for use at work. The main external change was a
> > change in the order of the arguments to simplify the code. And the
> > main internal change was moving the structure of the timer tracking
> > code to more closely mimic jQuery's internal event module. There
> > wasn't anything wrong with the way it was written before, but this
> > way, the code will appear more friendly for people trying to hack it
> > in the future who are already familiar with hacking jQuery.
>
> > Anyways, the main point of this code is concise definitions of
> > interval-ed events. For a practical example:
>
> > $("input").keypress(function() {
> > $(this).stop("autocomplete").once(250,"autocomplete",function() {
> > // provide a list of values to autocomplete with
>
> > });
> > });
>
> > For another practical, though slightly more trivial, example:
>
> > $('p.clock').every(1000, function() {
> > this.innerHTML = // The time right now.
>
> > });
>
> > The example will "do something" after someone has typed something but
> > only if no keys have been pressed for 250 milliseconds. This allows
> > for dynamic type searching without complicated timing and clearing of
> > timeouts in your code. The second example is a simple clock. The
> > implementation may vary, but the principle is the same. One additional
> > feature is the concept of labels. Labels allow you to define certain
> > events to be in a certain namespace which can be more finely
> > controlled. In this way, the above autocomplete example could operate
> > on the same element while another timer sequence is occuring and
> > because they have different labels, they could be stopped and
> > controlled independent of each other without any complicated global
> > variable nonsense.
>
> > The level of control of stopping events employs labels. Calling $
> > (this).stop() cancels any and all interval and timeout events attached
> > to that element. $(this).stop('label') will stop any and all events
> > with the label 'label' and $(this).stop('label',fn) will only stop a
> > certain event if it is of that label name and calls the provided
> > function. This allows for both broad and fine-grained event control.
>
> > So, as per usual, I've left the documentation fairly sparse and this
> > post will probably have to suffice until I stop being lazy.
>
> > The functions I've added to jQuery are once, every, and stop.
>
> > once takes three arguments: timeout, label, and function. label is
> > optional and will become a string representation of the timeout if not
> > specified. It will be called once in timeout milliseconds.
>
> > every takes four arguments: timeout, label, function, and times. label
> > is again options and defaults to the timeout value. times is also
> > optional and becomes unbounded if unspecified. times is used to limit
> > the number of times an event occurs.
>
> > stop takes two arguments: label, and function. Both are optional and
> > if neither is provided, all events on that DOM element are stopped. If
> > the label is provided without a function all events with that label
> > are stopped. Conversely, if a function is provided but no label, all
> > the events calling that function, regardless of label, are stopped.
> > Finally, if both are provided, they are both used to filter down to
> > stop that event.
>
> > The few times I've used these methods, my timer based methods have
> > become invariably more readable and more compact. Enjoy, if you must.
>
> > -blair



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Brandon Aaron
Knowing how to do it without jQuery makes me appreciate jQuery that much
more.

--
Brandon Aaron

On 8/16/07, Jonathan Sharp <[EMAIL PROTECTED]> wrote:
>
> On 8/16/07, Stephan Beal <[EMAIL PROTECTED]> wrote:
> >
> > On Aug 16, 7:39 pm, Mitch <[EMAIL PROTECTED]> wrote:
> > *snip*
> >  Simon Willison apparently has a
> > similar hang-up about jQuery. And, like i am in my hate-hate
> > relationship with Python, he's in the minority.
>
>
> Minor detail, it wasn't Simon Willson who made that comment, it as Thor
> Larholm (http://larholm.com/about-2/)
>
> I think one aspect of Thor's argument can be proved true with a grain of
> salt and that is learning jQuery isn't a replacement for learning JS/DOM for
> SOME people.
>
> Two different situations to take into account:
> 1) Average j(an|o)e want's to spice up h(er|is) page and add a cool tabbed
> interface, a jQuery minute(TM) later and they're done
> 2) Application developer is building an enterprise solution/product and
> utilizing jQuery. jQuery greatly speeds up development but underlying
> knowledge of JS/DOM is of the utmost importance.
>
> Having come from a strong JS background prior to jQuery, jQuery doesn't
> replace my thought process in regards to the DOM, it enhances it taking
> development time from hours of tedius coding to a jQuery minute(TM). The
> knowledge of the "pure form" is (I'll go as far as to say) required. So I
> can see his argument for not having those he's mentoring learn it, but that
> doesn't mean he shouldn't use it. This can go back to the argument in CS
> majors of students complaining that they have to learn memory
> management/heaps/stacks/registeres/etc when Java doesn't use any of them.
> The thing that ends up distinguishing good from great programmers is their
> underlying knowledge of the abstraction layers they're using. Thus we're
> right back at Simon Wilson's argument for learning the underlying black box.
>
>
> -js
>
> http://jQueryMinute.com (my host is having some network problems...)
>


[jQuery] Re: columnize large text ...

2007-08-16 Thread polyrhythmic

Very interesting, I have seen something similar (now somewhat
outdated) recently at http://13thparallel.com .  However, what turned
me off was a lack of widow-orphan control, the layout nut in me can't
allow widows and orphans.  There are other great features in this
script, do you have any plans to implement widow-orphan control?

It is also very nice that this is not a framework-dependent script,
but I think this would be awesome to write as a streamlined jQuery
function - jQuery will take care of cross-browser quirks on its own
(camelCase, cloning, event binding).  Plus, that way you could
unobtrusively add properties without breaking validation. Hmm... also,
are HTML tags allowed in the text?

I am always looking for dynamic layout options, having text flow
between columns is something layout designers have been using for
years in print, it's about time to have a proper representation on
screen.  Nice work.

Charles
doublerebel.com

On Aug 16, 12:30 pm, duma <[EMAIL PROTECTED]> wrote:
> Patrick,
>
> I've just released a Javascript library that allows you to have your text
> split into columns!
>
> Check it out here:
>
> http://pinkblack.org/text-columns/
>
> You simply include the library in your document, and then do something like
> the following:
>
> 
>   [My voluminous text goes here!]
> 
>
> Now, your text will be split into columns that are, at maximum, 200 pixels
> wide.  Also, there will be a 10-pixel gutter between columns.
>
> As your browser window grows and shrinks in width, columns will be added or
> subtracted dynamically.
>
> This library doesn't depend on jQuery -- or any other library, for that
> matter.  It works in IE, Firefox, Opera, and Safari.
>
> Enjoy, and keep creating!!
> Sean
>
> patrickk wrote:
>
> > I´m having a text on my page and I´d like to split that text into 2
> > (or even 3) columns.
> > I´ve seen this before but I can´t remember where ... any suggestions
> > are appreciated.
>
> > thanks,
> > patrick
>
> --
> View this message in 
> context:http://www.nabble.com/columnize-large-text-...-tf3527537s15494.html#a...
> Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread Jörn Zaefferer


Stephan Beal schrieb:

Hi, all!

We've all attempted several different ways of highlighting navigation
links which point to the current page. Often times we mark the page
via our PHP by adding a class (e.g. "currentPage") to the navigation
link which points to the current page, or some such. Here's a slightly
different approach...
  


A similar approach is provided by the current accordion plugin, see the 
second example here: http://jquery.bassistance.de/accordion/


-- Jörn


[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread John Resig

> http://jQueryMinute.com (my host is having some network problems...)

Oooh - new site! I'm excited :)

--John


[jQuery] Re: changing class

2007-08-16 Thread Justin Sepulveda

and even smaller:

$(this).parent().addClass("select").siblings().removeClass("select");



On Aug 16, 2:21 pm, "Sean Catchpole" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Are aware that there are tabs plugins?
>
> To answer your question:
> $(function(){
>   $("#tabs li a").click(function(){
> $("#tabs li").removeClass("select");
> $(this).parent().addClass("select");
>   });
>
> });
>
> ~Sean



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Jonathan Sharp
On 8/16/07, Stephan Beal <[EMAIL PROTECTED]> wrote:
>
> On Aug 16, 7:39 pm, Mitch <[EMAIL PROTECTED]> wrote:
> *snip*
>  Simon Willison apparently has a
> similar hang-up about jQuery. And, like i am in my hate-hate
> relationship with Python, he's in the minority.


Minor detail, it wasn't Simon Willson who made that comment, it as Thor
Larholm (http://larholm.com/about-2/)

I think one aspect of Thor's argument can be proved true with a grain of
salt and that is learning jQuery isn't a replacement for learning JS/DOM for
SOME people.

Two different situations to take into account:
1) Average j(an|o)e want's to spice up h(er|is) page and add a cool tabbed
interface, a jQuery minute(TM) later and they're done
2) Application developer is building an enterprise solution/product and
utilizing jQuery. jQuery greatly speeds up development but underlying
knowledge of JS/DOM is of the utmost importance.

Having come from a strong JS background prior to jQuery, jQuery doesn't
replace my thought process in regards to the DOM, it enhances it taking
development time from hours of tedius coding to a jQuery minute(TM). The
knowledge of the "pure form" is (I'll go as far as to say) required. So I
can see his argument for not having those he's mentoring learn it, but that
doesn't mean he shouldn't use it. This can go back to the argument in CS
majors of students complaining that they have to learn memory
management/heaps/stacks/registeres/etc when Java doesn't use any of them.
The thing that ends up distinguishing good from great programmers is their
underlying knowledge of the abstraction layers they're using. Thus we're
right back at Simon Wilson's argument for learning the underlying black box.

-js

http://jQueryMinute.com (my host is having some network problems...)


[jQuery] Re: One callback for two ajax requests

2007-08-16 Thread Thiago Ferreira
just a thought...code will be executed after the second call..

var oneCall = false;

function fn(json){
if(!oneCall){
   oneCall = true;
   return;
 }
 //code here
}

$.getJSON("url1", {}, fn);
$.getJSON("url2", {}, fn);


or you could put the second ajax call inside the function of the first one
or the other way around...

On 8/16/07, Jones <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> the following code provides one callback per ajax request:
>
> $.getJSON("url1", {}, function(json) {
> do something...
> });
> $.getJSON("url2", {}, function(json) {
> do something...
> });
>
> The problem is, that I need to call a function when both ajax requests
> are finished.
>
> Has anybody an idea?
>
>
> Another question: Does anybody know a german jQuery group or something
> similar?
>
> Jones
>
>


[jQuery] Re: changing class

2007-08-16 Thread Sean Catchpole
Hi,

Are aware that there are tabs plugins?

To answer your question:
$(function(){
  $("#tabs li a").click(function(){
$("#tabs li").removeClass("select");
$(this).parent().addClass("select");
  });
});

~Sean


[jQuery] Re: How to select element id that contains [] chars

2007-08-16 Thread John Resig

http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

On 8/16/07, Stuart <[EMAIL PROTECTED]> wrote:
>
> Yep. That did it. Although I could have sworn I already tried that. I
> probably tried a single slash or something. This is good to know.
> Thanks a bunch!
>
> On Aug 16, 1:26 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> > Try:
> >
> > $('#scheduleHours\\[' + dayNum + '\\]')
> >
> > I think you need 1.1.3 for escaping to work right...
> >
> > --Erik
> >
> > On 8/16/07, Stuart <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I've got a little problem here that would seem simple to sort out but
> > > has been rather stubborn. I'm trying to loop through a bunch of hidden
> > > text fields and grab their value. They look like so;
> >
> > >  > > value="7.5" />
> > >  > > value="7.5" />
> > >  > > value="7.5" />
> >
> > > These are the product of a Java Server Faces datalist (Tomahawk
> > > component) so there is no way to avoid the array-like notation in the
> > > id. I'm just building an array of these values with a for loop:
> >
> > > var schedule = new Array();
> >
> > > for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
> > > schedule[dayNum] = $('#scheduleHours[' + dayNum + ']').val();
> > > }
> >
> > > The problem is that the jQuery selector $('#scheduleHours[' + dayNum +
> > > ']').val() is not matching anything. Could it be possible that the "["
> > > and "]" characters are being interpreted by jQuery as being part of
> > > the attribute selector syntax like so? $("[EMAIL PROTECTED]").val();
> > > I'm taking a guess here that I need to escape the [] chars.
> >
> > > Anyone have an idea?
>
>


[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Glen Lipka
As a non-programmer, (HTML/CSS only) I understand lt() and gt() mainly
because of < and >.
I think those are very easy.  The place I get confused a little is when you
can say $("p:gt(4)") and $("p").gt(4) and get the same thing.  Why both?  I
suppose the answer is "because some people like it one way and some the
other".

One nice thing about jQuery's insistence on small file size is that it
limits the bloat that often comes with other systems.  At first I had a
clock.  Now I have clock-radio-alarm-calendar-cd-player.  The clock was
easier to use before it had all that power.

Anyway, I am babbling.  Wisdom and Vision are hard things, but I believe
jQuery has them both in spades.

Glen

On 8/16/07, Rey Bango <[EMAIL PROTECTED]> wrote:
>
>
> Amazon.
>
> Rey
>
> Andy Matthews wrote:
> > Karl...
> >
> > Where would be the best place for my company to purchase your book so
> > that you will get the maximum benefit?
> >
> > 
> > *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> > *On Behalf Of *Karl Swedberg
> > *Sent:* Thursday, August 16, 2007 2:15 PM
> > *To:* jquery-en@googlegroups.com
> > *Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > special-case uses for both function calls and method names
> >
> > Andy,
> >
> > I realize these are contrived examples, but if you're interested in
> > seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can
> > be used for, here are a few links that might be helpful:
> >
> >
> http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-1
> >
> http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2
> >
> > http://book.learningjquery.com/3810_02_code/selectors.html
> > http://book.learningjquery.com/3810_03_code/traversing.html
> >
> >
> > --Karl
> > _
> > Karl Swedberg
> > www.englishrules.com
> > www.learningjquery.com
> >
> >
> >
> > On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:
> >
> >>
> >> John...
> >>
> >> I should have added on to my OP. Better examples are really what is
> >> needed,
> >> not changes to the language. Let me read through and see possible RW
> >> examples of eq() or is() and let me say "hey I did that very thing last
> >> week, but with 10 more lines of code)".
> >>
> >> andy
> >>
> >> -Original Message-
> >> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> >> Behalf Of John Resig
> >> Sent: Thursday, August 16, 2007 1:48 PM
> >> To: jquery-en@googlegroups.com
> >> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> special-case
> >> uses for both function calls and method names
> >>
> >>
> >> Sure, that makes sense - and it's obviously difficult. I think the
> burden
> >> may lie on us to write better examples - although, it's hard to think
> of
> >> ones that aren't complex that also aren't contrived.
> >>
> >> At this point, I look for fringe cases in jQuery where, simply, a
> >> plugin is
> >> unable to duplicate functionality (or where a plugin would be hugely
> >> bloated, where the result in core would be quite simple, instead).
> >>
> >> That being said, I'm still advancing the library with some fun methods
> >> like
> >> .andSelf() whose uses won't become commonly apparent until far down the
> >> line.
> >>
> >> --John
> >>
> >> On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
> >>>
> >>> John...
> >>>
> >>> To be fair...it's very easy to learn the basics of jQuery, but it's
> >>> quite a lot of work and time to learn the really cool stuff. I've
> >>> never used eq() or
> >>> if() and those other because I simply don't understand what they do.
> >>> I'm sure some of them could improve my code dramatically but I don't
> >>> even know WHEN I might use them, so I don't know when to look for
> >>> them. Does that makes sense?
> >>>
> >>> andy
> >>>
> >>> -Original Message-
> >>> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> >>> On Behalf Of John Resig
> >>> Sent: Thursday, August 16, 2007 12:53 PM
> >>> To: jquery-en@googlegroups.com
> >>> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> >>> special-case uses for both function calls and method names
> >>>
> >>>
> >>> I don't understand this argument at all. So this guy is proposing that
> >>> we change all the jQuery methods to:
> >>>
> >>> $Array([array of elems])
> >>> $Selector("str")
> >>> $HTML("html")
> >>> $Element(DOMElement)
> >>>
> >>> and:
> >>>
> >>> .appendElement(DOMElement)
> >>> .appendHTML("html")
> >>> .appendArray([array of elems])
> >>>
> >>> what on earth does that gain you? What's the purpose of using a
> >>> language that can overload arguments and not actually using that
> >>> feature? What's the advantage of increasing the size of your API
> 4-fold?
> >>>
> >>> Incredibly weak argument, obviously someone who's never used the
> library.
> >>>
>  Some method names make no
>  immediate sense, like .one or .eq, and you can't

[jQuery] Re: changing class

2007-08-16 Thread seedy


Do you need to have a seperate css class for each list item?

If they all visually look the same, I would have only 2 classes, one for the
selected element, and one for all other elements.  If this was the case you
could do something like this:

$('.unselected').click(function(){
   $('.selected').attr('class','unselected');
   $(this).attr('class','selected');
});

Eddie Peloke wrote:
> 
> 
> I have the following code.  Basically, when the home_sel anchor is
> clicked, I want to change the class to "home select" and have all
> other li elements have select removed if they have it turned on...I'm
> having problems getting this to work properly in jQuery.  How can I do
> this?
> 
> Thanks!
> 
> 
> 
>   
># Home 
># Packages 
># Test Drive 
># Sign up 
> 
>   
>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/changing-class-tf4281741s15494.html#a12188647
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: ColdFusion

2007-08-16 Thread Web Specialist
I'm one of...

2007/8/16, Andy Matthews <[EMAIL PROTECTED]>:
>
>
> Andrea...
>
> Please post them. There's actually quite a few ColdFusion developers on
> this
> list and I'm sure that some of them could make use of your custom tag.
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, August 16, 2007 12:53 PM
> To: jQuery (English)
> Subject: [jQuery] ColdFusion
>
>
> Hi,
>
> I am just arrived in this maillist and in Jquery.and it was a bad
> choice
> to wait so long for strating with the amazing jQuery.
> I wrote down a set of custom tag for easy implementation in CF of the
> Klaus
> Hartl Tab Plug-In.
> If someone is interested to that and to exchange CF implementatio of
> jquery
> library please send me a mail.
>
> Bye
>
> Andrea
>
>
>


[jQuery] Re: [ANNOUNCE] tablesorter 2.0 released

2007-08-16 Thread Christian Bach
> Does anyone have an example of how to stripe the data rows? The
> default looks like it should be .odd & .even and I am using the blue
> theme but nothing is getting striped.



You need to pass the widgets option, try this:

$("table").tablesorter({
sortForce: [0,0],
widgets: ['zebra']
});

It seems that we forgot to document the widgets option, there's always
something :)

I will update tablesorter.com the first thing tomorrow, i really need to get
some sleep.

Regards
Christian


[jQuery] Re: How to select element id that contains [] chars

2007-08-16 Thread Stuart

Yep. That did it. Although I could have sworn I already tried that. I
probably tried a single slash or something. This is good to know.
Thanks a bunch!

On Aug 16, 1:26 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> Try:
>
> $('#scheduleHours\\[' + dayNum + '\\]')
>
> I think you need 1.1.3 for escaping to work right...
>
> --Erik
>
> On 8/16/07, Stuart <[EMAIL PROTECTED]> wrote:
>
>
>
> > I've got a little problem here that would seem simple to sort out but
> > has been rather stubborn. I'm trying to loop through a bunch of hidden
> > text fields and grab their value. They look like so;
>
> >  > value="7.5" />
> >  > value="7.5" />
> >  > value="7.5" />
>
> > These are the product of a Java Server Faces datalist (Tomahawk
> > component) so there is no way to avoid the array-like notation in the
> > id. I'm just building an array of these values with a for loop:
>
> > var schedule = new Array();
>
> > for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
> > schedule[dayNum] = $('#scheduleHours[' + dayNum + ']').val();
> > }
>
> > The problem is that the jQuery selector $('#scheduleHours[' + dayNum +
> > ']').val() is not matching anything. Could it be possible that the "["
> > and "]" characters are being interpreted by jQuery as being part of
> > the attribute selector syntax like so? $("[EMAIL PROTECTED]").val();
> > I'm taking a guess here that I need to escape the [] chars.
>
> > Anyone have an idea?



[jQuery] changing class

2007-08-16 Thread bwdev

I have the following code.  Basically, when the home_sel anchor is
clicked, I want to change the class to "home select" and have all
other li elements have select removed if they have it turned on...I'm
having problems getting this to work properly in jQuery.  How can I do
this?

Thanks!




Home
Packages
Test Drive
Sign up






[jQuery] Re: columnize large text ...

2007-08-16 Thread duma


Patrick,

I've just released a Javascript library that allows you to have your text
split into columns!

Check it out here:

http://pinkblack.org/text-columns/

You simply include the library in your document, and then do something like
the following:


  [My voluminous text goes here!]


Now, your text will be split into columns that are, at maximum, 200 pixels
wide.  Also, there will be a 10-pixel gutter between columns.

As your browser window grows and shrinks in width, columns will be added or
subtracted dynamically.

This library doesn't depend on jQuery -- or any other library, for that
matter.  It works in IE, Firefox, Opera, and Safari.

Enjoy, and keep creating!!
Sean


patrickk wrote:
> 
> 
> I´m having a text on my page and I´d like to split that text into 2  
> (or even 3) columns.
> I´ve seen this before but I can´t remember where ... any suggestions  
> are appreciated.
> 
> thanks,
> patrick
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/columnize-large-text-...-tf3527537s15494.html#a12187923
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: [ANNOUNCE] tablesorter 2.0 released

2007-08-16 Thread Dan Vega

Does anyone have an example of how to stripe the data rows? The
default looks like it should be .odd & .even and I am using the blue
theme but nothing is getting striped.

Thanks





JQuery Grid


.even {
#000;
}
.odd {
#fff;
}





$(document).ready(function() {
// call the tablesorter plugin
$("table").tablesorter({
0: {sorter:"text"},
1: {sorter:"text"},
2: {sorter:"integer"},
3: {sorter:"currency"},
4: {sorter:"percent"},
5: {sorter:"date"},
sortForce: [0,0],
widgetZebra: {css: ["even","odd"]}
});
});







First Name
Last Name
Age
Total
Discount
Date




Peter
Parker
28
$9.99
20%
07/06/2006


John
Hood
33
$19.99
25%
11/10/2002


Clark
Kent
18
$15.89
44%
01/12/2003


Bruce
Almighty
45
$153.19
44%
01/18/2001


Bruce
Evans
22
$13.19
11%
01/18/2007








On Aug 16, 3:27 pm, "Christian Bach" <[EMAIL PROTECTED]>
wrote:
> Thanks guys!
>
> I will see to it that i add a short overview to the examples.
>
> /christian



[jQuery] Re: What does "Unobtrusive Javascript" mean?

2007-08-16 Thread Rick Pasotto

On Thu, Aug 16, 2007 at 05:49:47PM -, Pops wrote:
> 
> Word! "I feel ya" and I agree with you. :-)
> 
> But unobstructive javascript?  Why would anyone assume that software
> designs are naturally  obstructive  in the first place?

Perhaps you should read more closely.

unobtrusive != unobstructive

-- 
"Victory goes to the player who makes the next-to-last mistake,"
 said chess master Savielly Grigorievitch Tartakower.
Rick Pasotto[EMAIL PROTECTED]http://www.niof.net


[jQuery] One callback for two ajax requests

2007-08-16 Thread Jones

Hello,

the following code provides one callback per ajax request:

$.getJSON("url1", {}, function(json) {
do something...
});
$.getJSON("url2", {}, function(json) {
do something...
});

The problem is, that I need to call a function when both ajax requests
are finished.

Has anybody an idea?


Another question: Does anybody know a german jQuery group or something
similar?

Jones



[jQuery] Re: Basic JSON help

2007-08-16 Thread polyrhythmic

Jeff,
Firebug and Web Developer extensions for Firefox will become very
useful for you.
There is also a jQuery extension for Firebug debugging:
http://jquery.glyphix.com/
Good instructions on that page.

A JSON (or other Javascript) Object != a multidimensional array.
Javascript objects can be accessed like an array, but are defined
differently.  One of the important differences is that Objects do not
have a .length property by default.  In Mike's example, you can access
the length property of 'models' because models IS an array, defined by
brackets ( [ ] ).
This is more complex than I can properly describe, there is an
excellent writeup at Quirksmode:
http://www.quirksmode.org/js/associative.html

The more you understand about Javascript, the easier jQuery will
become for you.  Though jQuery makes many things simpler and faster,
it is a deep understanding of Javascript that will really open the
power of jQuery to you.  I recommend keeping Javascript reference
guides open in browser tabs, such as
http://www.w3schools.com/ W3C schools for the basics
and http://www.quirksmode.org/ Quirksmode for the weird cases
Google is also pretty good for searching code cases.

Best of luck in your quest!  Hope this is all helpful to you.

Charles
doublerebel.com

On Aug 16, 9:51 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> Like Mike said, you don't need eval() when using $.getJSON().
>
> That console.* stuff is part of a FireFox extension called FireBug that's
> fairly standard for doing development.
>
> --Erik
>
> On 8/16/07, jeff w <[EMAIL PROTECTED]> wrote:
>
>
>
> > Yes, I am using $.getJSON. eval() is a javascript function right? so
> > if I want more info on that, I should look at a javascript reference??
>
> > what is console.debug()? I've seen that in a bunch of posts. I am
> > guessing its a way to output results. Is it a cleaner way of using
> > something like alert(spit out results);?
>
> > Thanks for your patience if my questions are elementary, I'm just
> > trying to build some sort of foundation of basic concepts.
>
> > On Aug 16, 10:51 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> > > I assumed he was using $.getJSON or something similar that takes care of
> > the
> > > eval'ing for you.
>
> > > --Erik
>
> > > On 8/16/07, Michael Geary <[EMAIL PROTECTED]> wrote:
>
> > > > > From: jeff w
>
> > > > > I am new to jQuery, and have started to play with JSON,but I
> > > > > need some info about how I refer to the JSON Object once it
> > > > > is  returned from the server. I know I can loop through the
> > > > > contents of the object, and I can use json.count, but I am
> > > > > really unsure about the correct syntax to target the data
> > > > > that I need. Can anyone provide a link to a tutorial or some
> > > > > other help?
>
> > > > > Here is the JSON object that I need to return from the server:
>
> > > > > {"models": ["MDX SUV", "RDX SUV", "RL Sedan", "TL Sedan", "TSX
> > Sedan"]}
>
> > > > > Thanks for your help.
>
> > > > > 
>
> > > > > since writing this, I have made a guess at what might work. I
> > > > > confirmed that the data is returning as stated above (using
> > > > > Firebug), but when I echo json.count, i get 'undefined'. does
> > > > > that make sense?
>
> > > > I don't see a count property in your JSON data, and you didn't mention
> > > > eval'ing the JSON string (it's just a string until you do something
> > with
> > > > it).
>
> > > > Assuming that you have received a string from your server in a
> > variable
> > > > "json" containing the above JSON text:
>
> > > >json = eval( '(' + json + ')' );
> > > >var models = json.models;
> > > >for( var i = 0, n = models.length;  i < n;  ++i ) {
> > > >   var model = models[i];
> > > >   console.debug( model );
> > > >}
>
> > > > You can even use $.each if you like:
>
> > > >json = eval( '(' + json + ')' );
> > > >$.each( json.models, function( i, model ) {
> > > >   console.debug( model );
> > > >});
>
> > > > -Mike



[jQuery] Re: Quick question...

2007-08-16 Thread polyrhythmic

I agree with Allex, phpQuery is the only thing I can think of, however
I've never had a need for it, let us know how if you try it out.

On Aug 16, 8:37 am, "Smith, Allex" <[EMAIL PROTECTED]> wrote:
> Have you taken a look at this?
>
> I'm not a PHP guy, but I marked this article some time back due to the
> mention of jQuery.
>
> http://ajaxian.com/archives/plaintemplate-phpquery
>
> AllexS
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of MikeR
> Sent: Wednesday, August 15, 2007 4:59 PM
> To: jQuery (English)
> Subject: [jQuery] Quick question...
>
> We all know & love jQuery, but something that I've been wondering for a
> while now... not sure if it's feasible or not, but I'll ask anyway =).
>
> Is there any sort of HTML parser for PHP that's similar to jQuery's
> selectors?
>
> ie: $('div.class').html().. but a PHP version?
>
> Thanks!



[jQuery] Re: Problem with jQEm and scrolling divs on FF

2007-08-16 Thread polyrhythmic

For what its worth, I see the same problem on my Firefox.  Very
interesting

Charles

On Aug 16, 9:31 am, Kelvin Luck <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've just added the ability for jScrollPane to work with jQEm so if a
> user changes the text size in their browser the jScrollPane
> automatically updates itself.
>
> In doing so I think I've come across an issue with jQEm and scrolling
> divs in Firefox (PC). An example is worth a thousand words so check this
> example page to illustrate the problem:
>
> http://kelvinluck.com/assets/jquery/jQEmIssue/jQEmBug.html
>
> Any ideas of what is happening?
>
> Cheers,
>
> Kelvin :)



[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread polyrhythmic

The easiest way to learn RegExs, IMO, is with a realtime RegEx
checker, such as:
http://www.cuneytyilmaz.com/prog/jrx/

I've seen a better one with highlighting but I can't find it in my
bookmarks at the moment.

Charles

On Aug 16, 10:09 am, Stephan Beal <[EMAIL PROTECTED]> wrote:
> On Aug 16, 7:04 pm, Bernd Matzner <[EMAIL PROTECTED]>
> wrote:
>
> > A | B |  > href="http://localhost/index.html";>C | D
>
> Doh, of course i hadn't considered that the navigation links
> themselves having GET options (i was thinking about people passing in
> args from external links). You're right - i think a solution like
> yours is the only real way of handling that case. None of my sites use
> GET parameters in their navigation links, so i'm going to punt on that
> problem. But your approach is the most generic solution, it would
> seem.
>
> > As for the each() function - I'm sure the if clause could be made into
> > a regex, which, unfortunately, is not my forté - that's why I wrote
> > "plain and stupid" ;-)
>
> Regexes are definitely worth learning. Once you know them, you can use
> them in many different programming languages (and even non-programming
> tools) and you'll be SO happy that you know how to use them. They are
> without a doubt one of the pieces of knowledge with the highest
> "return on invested time" of anything i've every learned. Hardly a day
> goes by that i don't use them for some programming task or other.
>
> :)



[jQuery] Re: What does "Unobtrusive Javascript" mean?

2007-08-16 Thread Dan G. Switzer, II

>I'm going to disagree slightly with some of the earlier replies. I think
>"progressive enhancement" and "unobtrusive JavaScript" are two different
>things, and they seem to be getting lumped together to some degree.

And this is why new terms crop up--to describe very specific techniques. 

"Unobtrusive JavaScript" is just one method of adding "progressive
enhancement."

Sorry for my original earlier message, since it probably just added
confusion.

-Dan



[jQuery] Re: How to select element id that contains [] chars

2007-08-16 Thread Dan G. Switzer, II

Stuart,

>for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
>   schedule[dayNum] = $('#scheduleHours[' + dayNum + ']').val();
>}

This is brought up a lot on the list. You need:

for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
schedule[dayNum] = $("[EMAIL PROTECTED]'scheduleHours[" + dayNum +
"]']").val();
}

You selector should look like:

$("[EMAIL PROTECTED]'scheduleHours[0]']")

However, I'd recommend change the "id" of your elements and changing them to
something like:





Then you could use:

for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
schedule[dayNum] = $('#scheduleHours_' + dayNum).val();
}

-Dan



[jQuery] Re: Plugin: frameReady updated. Now with better docs and demos ;)

2007-08-16 Thread Mario Moura
Hi Daemach

Thanks for frameReady is amazing.

I am trying integrate with http://tinymce.moxiecode.com/

To have a common example I will use the image button of

http://wiki.moxiecode.com/examples/tinymce/installation_example_05.php

To avoid problems with other library I did:


jQuery.noConflict(); var $j = jQuery;
$j(document).ready(function() {
$j.frameReady(function(){
$j('#iframetarget').append("pleaseworks");
},"top.mcWindow_0_iframe.mcWindow_0_iframe", { } );
});



To be simple I want pass the word "pleaseworks" to div #iframetarget (I
created into of the file: ../js/tiny_mce/plugins/advimage/image.htm)

So if someone need duplicate just install tinymce, edit image.htm and insert
 after  line 22.

Is the target correct? "top.mcWindow_0_iframe.mcWindow_0_iframe" I tried "
top.mcWindow_0_iframe" too. You can see too each push button change iframes
to mcWindow_1_iframe, mcWindow_2_iframe ...

What is missing?

If your plugin works with tinymce, we could do amazing things into "tinymce
iframes" like Ajax, bring lists, thumbs etc..

Serious will be amazing and probably thousands of developers will look to
your plugin because the big problem with tinymce is how upload files to
server with security.

So we can made ajax upload into a form and pass these urls to tinymce
iframes to fill images urls, media urls with a simple click. Will be more
friendly to the user.

 It is simple, secure and fast but first we need frameReady work there.

May you help me if you have time?

Regards

Mario


2007/4/19, Daemach <[EMAIL PROTECTED]>:
>
>
> I just updated frameReady to support loading script and stylesheet
> files in other frames, including nested, dynamically created iframes
> if necessary.  frameReady loads jQuery in the target frame(s) by
> default, so you can run any jQuery function in the target frame as if
> you were dealing with the local document.   $("p") instead of $("p",
> top.mainFrame.iFrame.document) for example.  You can also load jQuery
> plugins and stylesheets and any functions you want to run will wait
> until those files are loaded, parsed and available before running.
>
> More information and a demo here:  http://ideamill.synaptrixgroup.com/?p=6
>
> If you take the time to look at this, please let me know what you
> think!
>
>


-- 
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000


[jQuery] Re: JSON String problem

2007-08-16 Thread Michael Geary

> yes I know about strings and numeric conversions.  I want to 
> know is there a way to force json to force values to strings. 
>  I have played with the parser but it is a PITA and played 
> with adding " " at the query level but that is too 
> cumbersome.  I can't believe JSon does not have any options 
> or settings that force all values to strings.  Anyone played 
> with this at all?

JSON is just a data format. It doesn't have "options".

JSON is defined to be a subset of the JavaScript object literal format.
Forget JSON for a moment and let's just talk about pure JavaScript code:

   var address = {
  "city": "Augusta",
  "state": "ME",
  "zip": 04330
   };

   alert( address.zip );

In most browsers, that will alert 2264 (the decimal value of the octal
number 04330).

If you let JavaScript see a number with a leading zero, it *will* interpret
it as octal (unless the number contains an 8 or 9 anywhere - in that case it
will be interpreted as decimal after all) - again in most browsers.

Your only solution is to keep JavaScript from seeing that 04330 as a number.
You can do that either by:

1) Quoting the number so it's a string, not a number:

   var address = {
  "city": "Augusta",
  "state": "ME",
  "zip": "04330"
   };

Or 2) using a custom "sort-of-JSON" parser that doesn't use eval() and
handles numeric strings as strings:

   var address = '{ "city": "Augusta", "state": "ME", "zip": 04330 }';
   // Now address is simply a long string, and you can write your own
   // parser for it that treats the components of the string any
   // way you want.

Option 1 is probably the simpler of the two.

-Mike



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Rey Bango


Amazon.

Rey

Andy Matthews wrote:

Karl...
 
Where would be the best place for my company to purchase your book so 
that you will get the maximum benefit?



*From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Karl Swedberg

*Sent:* Thursday, August 16, 2007 2:15 PM
*To:* jquery-en@googlegroups.com
*Subject:* [jQuery] Re: jQuery negatives: dual/triple/quadruple 
special-case uses for both function calls and method names


Andy,

I realize these are contrived examples, but if you're interested in 
seeing what those selectors/traversal methods (e.g. :lt or .lt() ) can 
be used for, here are a few links that might be helpful:


http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-1
http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2

http://book.learningjquery.com/3810_02_code/selectors.html
http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:



John...

I should have added on to my OP. Better examples are really what is 
needed,

not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a 
plugin is

unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods 
like

.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:


John...

To be fair...it's very easy to learn the basics of jQuery, but it's
quite a lot of work and time to learn the really cool stuff. I've
never used eq() or
if() and those other because I simply don't understand what they do.
I'm sure some of them could improve my code dramatically but I don't
even know WHEN I might use them, so I don't know when to look for
them. Does that makes sense?

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.


Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.


These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:


What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/


jQuery is definitely a popular utility function library, but the
sheer amount of dual/triple/quadruple special-case uses for both
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a DOMContentReady
event handler - and probably more. Event handling is separated into
separate methods for each event type. Some method names make no
immediate sense, like .one or .eq, and you can't im

[jQuery] Re: [ANNOUNCE] tablesorter 2.0 released

2007-08-16 Thread Christian Bach
Thanks guys!

I will see to it that i add a short overview to the examples.

/christian


[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Karl Swedberg
oops. thanks for the correction. that's what I get for taking a  
shortcut.



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:19 PM, Andy Matthews wrote:


404 on the first link by the way. Month should be 11, not 12:

http://www.learningjquery.com/2006/11/how-to-get-anything-you-want- 
part-1


From: jquery-en@googlegroups.com [mailto:jquery- 
[EMAIL PROTECTED] On Behalf Of Karl Swedberg

Sent: Thursday, August 16, 2007 2:15 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple  
special-case uses for both function calls and method names


Andy,

I realize these are contrived examples, but if you're interested in  
seeing what those selectors/traversal methods (e.g. :lt or .lt() )  
can be used for, here are a few links that might be helpful:


http://www.learningjquery.com/2006/12/how-to-get-anything-you-want- 
part-1
http://www.learningjquery.com/2006/12/how-to-get-anything-you-want- 
part-2


http://book.learningjquery.com/3810_02_code/selectors.html
http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:



John...

I should have added on to my OP. Better examples are really what  
is needed,

not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing  
last

week, but with 10 more lines of code)".

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery- 
[EMAIL PROTECTED] On

Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple  
special-case

uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the  
burden
may lie on us to write better examples - although, it's hard to  
think of

ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a  
plugin is

unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun  
methods like
.andSelf() whose uses won't become commonly apparent until far  
down the

line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:


John...

To be fair...it's very easy to learn the basics of jQuery, but it's
quite a lot of work and time to learn the really cool stuff. I've
never used eq() or
if() and those other because I simply don't understand what they do.
I'm sure some of them could improve my code dramatically but I don't
even know WHEN I might use them, so I don't know when to look for
them. Does that makes sense?

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing  
that

we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API  
4-fold?


Incredibly weak argument, obviously someone who's never used the  
library.



Some method names make no
immediate sense, like .one or .eq, and you can't immediately  
tell if
a method acts on the first element in the collection or all of  
them.


These arguments are slightly more valid. Although .eq() is going  
away
in 1.2. I really don't know what to say, in this case it was  
simply a

design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:


What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/


jQuery is definitely a popular utility function library, but the
sheer amount of dual/triple/quadruple special-case uses for both
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a  
DOMContentReady

event

[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Andy Matthews
404 on the first link by the way. Month should be 11, not 12:
 
http://www.learningjquery.com/2006/11/how-to-get-anything-you-want-part-1

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Thursday, August 16, 2007 2:15 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Andy, 

I realize these are contrived examples, but if you're interested in seeing
what those selectors/traversal methods (e.g. :lt or .lt() ) can be used for,
here are a few links that might be helpful:

http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-1
http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2

http://book.learningjquery.com/3810_02_code/selectors.html
http://book.learningjquery.com/3810_03_code/traversing.html




--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:



John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:


John...

To be fair...it's very easy to learn the basics of jQuery, but it's 
quite a lot of work and time to learn the really cool stuff. I've 
never used eq() or
if() and those other because I simply don't understand what they do. 
I'm sure some of them could improve my code dramatically but I don't 
even know WHEN I might use them, so I don't know when to look for 
them. Does that makes sense?

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple 
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that 
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a 
language that can overload arguments and not actually using that 
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.


Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if 
a method acts on the first element in the collection or all of them.


These arguments are slightly more valid. Although .eq() is going away 
in 1.2. I really don't know what to say, in this case it was simply a 
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why 
not overload it to actually do something? Why double the size of the 
effective API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:


What do you guys think of this critique of jQuery I found on Simon 
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/


jQuery is definitely a popular utility function library, but the 
sheer amount of dual/triple/quadruple special-case uses for both 
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM 
element, create a DOM element from HTML and assign a DOMContentReady 
event handler - and probably more. Event handling is separated into 
separate methods for each event type. Some method names make no 
immediate sense, like .one or .eq, and you can't immediately tell if 
a method acts on the first element in the collection or all 

[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Andy Matthews
Karl...
 
Where would be the best place for my company to purchase your book so that
you will get the maximum benefit?

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Thursday, August 16, 2007 2:15 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Andy, 

I realize these are contrived examples, but if you're interested in seeing
what those selectors/traversal methods (e.g. :lt or .lt() ) can be used for,
here are a few links that might be helpful:

http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-1
http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2

http://book.learningjquery.com/3810_02_code/selectors.html
http://book.learningjquery.com/3810_03_code/traversing.html




--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:



John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:


John...

To be fair...it's very easy to learn the basics of jQuery, but it's 
quite a lot of work and time to learn the really cool stuff. I've 
never used eq() or
if() and those other because I simply don't understand what they do. 
I'm sure some of them could improve my code dramatically but I don't 
even know WHEN I might use them, so I don't know when to look for 
them. Does that makes sense?

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple 
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that 
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a 
language that can overload arguments and not actually using that 
feature? What's the advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.


Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if 
a method acts on the first element in the collection or all of them.


These arguments are slightly more valid. Although .eq() is going away 
in 1.2. I really don't know what to say, in this case it was simply a 
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why 
not overload it to actually do something? Why double the size of the 
effective API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:


What do you guys think of this critique of jQuery I found on Simon 
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/


jQuery is definitely a popular utility function library, but the 
sheer amount of dual/triple/quadruple special-case uses for both 
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM 
element, create a DOM element from HTML and assign a DOMContentReady 
event handler - and probably more. Event handling is separated into 
separate methods for each event type. Some method names make no 
immediate sense, like .one or .eq, and you can't immediately tell if 
a method acts on the first element in the collection or all of them.

I can't r

[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Karl Swedberg

Andy,

I realize these are contrived examples, but if you're interested in  
seeing what those selectors/traversal methods (e.g. :lt or .lt() )  
can be used for, here are a few links that might be helpful:


http://www.learningjquery.com/2006/12/how-to-get-anything-you-want- 
part-1
http://www.learningjquery.com/2006/12/how-to-get-anything-you-want- 
part-2


http://book.learningjquery.com/3810_02_code/selectors.html
http://book.learningjquery.com/3810_03_code/traversing.html


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 16, 2007, at 3:02 PM, Andy Matthews wrote:



John...

I should have added on to my OP. Better examples are really what is  
needed,

not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing  
last

week, but with 10 more lines of code)".

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery- 
[EMAIL PROTECTED] On

Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple  
special-case

uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the  
burden
may lie on us to write better examples - although, it's hard to  
think of

ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a  
plugin is

unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun  
methods like
.andSelf() whose uses won't become commonly apparent until far down  
the

line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:


John...

To be fair...it's very easy to learn the basics of jQuery, but it's
quite a lot of work and time to learn the really cool stuff. I've
never used eq() or
if() and those other because I simply don't understand what they do.
I'm sure some of them could improve my code dramatically but I don't
even know WHEN I might use them, so I don't know when to look for
them. Does that makes sense?

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
special-case uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing  
that

we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API 4- 
fold?


Incredibly weak argument, obviously someone who's never used the  
library.



Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.


These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:


What do you guys think of this critique of jQuery I found on Simon
Willison's site (which is good reading).

http://simonwillison.net/2007/Aug/15/jquery/


jQuery is definitely a popular utility function library, but the
sheer amount of dual/triple/quadruple special-case uses for both
function calls and method names is an instant turnoff for me.

The jQuery object itself can perform a selector query, embed a DOM
element, create a DOM element from HTML and assign a DOMContentReady
event handler - and probably more. Event handling is separated into
separate methods for each event type. Some method names make no
immediate sense, like .one or .eq, and you can't immediately tell if
a method acts on the first element in the collection or all of them.

I can't recommend jQuery to the developers I am mentoring because it
is in itself a completely separate abstraction, and a muddy one at
that. They will end up having to learn jQuery instead of having to
learn DOM, CSS and JS, and when being considered as a direct
replacement for those it fails both due to complexity and
inconsistency."



Mitch













[jQuery] Re: What does "Unobtrusive Javascript" mean?

2007-08-16 Thread Michael Geary

> From: Pops
> 
> I"ve seen this term referred to a few times, especially here:
> 
> http://simonwillison.net/2007/Aug/15/jquery/
> 
> What does Unobtrusive Javascript mean?

I'm going to disagree slightly with some of the earlier replies. I think
"progressive enhancement" and "unobtrusive JavaScript" are two different
things, and they seem to be getting lumped together to some degree.

Progressive enhancement means writing an HTML page that will work correctly
even if CSS and JavaScript are disabled, and that will still work correctly
- with usability or esthetic improvements - when CSS and/or JavaScript are
available.

Unobtrusive JavaScript means clean markup: avoiding cluttering your tags
with "onclick" and the like.

Obtrusive JavaScript:

click me

Unobtrusive JavaScript:

click me

...and somewhere else...

$('.clicky').click( doClick ).hover( doHover, endHover );

You can have progressive enhancement with either obtrusive or unobtrusive
JavaScript. They are really two separate questions.

Those are my definitions anyway. :-)

> I am getting the idea that jQuery offers a way to bypass a 
> user turning off JavaScript?
> 
> How does jQuery do this?

It doesn't. Seeing as how jQuery *is* JavaScript, if JavaScript is disabled
so is jQuery.

It's just that part of the "jQuery philosophy" is to use progressive
enhancement so that your web page will still work if JavaScript is disabled.
But jQuery is out of the picture at that point.

-Mike



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread John Resig

That'd be excellent - thanks!

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> John...
>
> I should have added on to my OP. Better examples are really what is needed,
> not changes to the language. Let me read through and see possible RW
> examples of eq() or is() and let me say "hey I did that very thing last
> week, but with 10 more lines of code)".
>
> andy
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of John Resig
> Sent: Thursday, August 16, 2007 1:48 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
> uses for both function calls and method names
>
>
> Sure, that makes sense - and it's obviously difficult. I think the burden
> may lie on us to write better examples - although, it's hard to think of
> ones that aren't complex that also aren't contrived.
>
> At this point, I look for fringe cases in jQuery where, simply, a plugin is
> unable to duplicate functionality (or where a plugin would be hugely
> bloated, where the result in core would be quite simple, instead).
>
> That being said, I'm still advancing the library with some fun methods like
> .andSelf() whose uses won't become commonly apparent until far down the
> line.
>
> --John
>
> On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
> >
> > John...
> >
> > To be fair...it's very easy to learn the basics of jQuery, but it's
> > quite a lot of work and time to learn the really cool stuff. I've
> > never used eq() or
> > if() and those other because I simply don't understand what they do.
> > I'm sure some of them could improve my code dramatically but I don't
> > even know WHEN I might use them, so I don't know when to look for
> > them. Does that makes sense?
> >
> > andy
> >
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
> > On Behalf Of John Resig
> > Sent: Thursday, August 16, 2007 12:53 PM
> > To: jquery-en@googlegroups.com
> > Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple
> > special-case uses for both function calls and method names
> >
> >
> > I don't understand this argument at all. So this guy is proposing that
> > we change all the jQuery methods to:
> >
> > $Array([array of elems])
> > $Selector("str")
> > $HTML("html")
> > $Element(DOMElement)
> >
> > and:
> >
> > .appendElement(DOMElement)
> > .appendHTML("html")
> > .appendArray([array of elems])
> >
> > what on earth does that gain you? What's the purpose of using a
> > language that can overload arguments and not actually using that
> > feature? What's the advantage of increasing the size of your API 4-fold?
> >
> > Incredibly weak argument, obviously someone who's never used the library.
> >
> > > Some method names make no
> > > immediate sense, like .one or .eq, and you can't immediately tell if
> > > a method acts on the first element in the collection or all of them.
> >
> > These arguments are slightly more valid. Although .eq() is going away
> > in 1.2. I really don't know what to say, in this case it was simply a
> > design decision. We could've had:
> > .val() (return nothing, do nothing useful)
> > .val("val") (set value)
> > .getVal() (get value)
> > .getVal("val") (return nothing, do nothing useful)
> >
> > But why have a state of a method perform nothing useful at all? Why
> > not overload it to actually do something? Why double the size of the
> > effective API with half-useful functions?
> >
> > --John
> >
> > On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:
> > >
> > > What do you guys think of this critique of jQuery I found on Simon
> > > Willison's site (which is good reading).
> > >
> > > http://simonwillison.net/2007/Aug/15/jquery/
> > >
> > > 
> > > jQuery is definitely a popular utility function library, but the
> > > sheer amount of dual/triple/quadruple special-case uses for both
> > > function calls and method names is an instant turnoff for me.
> > >
> > > The jQuery object itself can perform a selector query, embed a DOM
> > > element, create a DOM element from HTML and assign a DOMContentReady
> > > event handler - and probably more. Event handling is separated into
> > > separate methods for each event type. Some method names make no
> > > immediate sense, like .one or .eq, and you can't immediately tell if
> > > a method acts on the first element in the collection or all of them.
> > >
> > > I can't recommend jQuery to the developers I am mentoring because it
> > > is in itself a completely separate abstraction, and a muddy one at
> > > that. They will end up having to learn jQuery instead of having to
> > > learn DOM, CSS and JS, and when being considered as a direct
> > > replacement for those it fails both due to complexity and
> > > inconsistency."
> > >
> > > 
> > >
> > > Mitch
> > >
> > >
> >
> >
> >
>
>
>


[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread Stephan Beal

On Aug 16, 9:03 pm, Stephan Beal <[EMAIL PROTECTED]> wrote:
> and your above point, i'd love to see it. Maybe a plugin with options
> for ignoring/respecting GET parameters?

And while you're writing that plugin (hint, hint ;), another point to
address is the common practice of linking some element of the site
header back to the home page. e.g. clicking the site logo takes you to
'/'. You don't want that link marked like this. That's really where
the benefit of restricting your selector to your navigation menu comes
in, i think.



[jQuery] AJAX error in IE with jQuery 1.1.3

2007-08-16 Thread Estevão Lucas
Hi,

I would like to know if somebody already had problems with IE when using the
method of ajax with jQuery 1.1.3. The generated error was "object does not
support this property or the method" and "access denied" and what was the
solution?

a hug
Estevão Lucas


[jQuery] Re: Help with show/hide script

2007-08-16 Thread Priest, James (NIH/NIEHS) [C]

> -Original Message-
> From: Wizzud [mailto:[EMAIL PROTECTED] 
> 
> The problem you have is due to the slideDown. Because that takes time
> (whereas the hide() is instantaneous), clicking "Hide TOC" 

After digging around I figured I should switch from toggle to click -
and use an if/else - but wasn't sure how to do it :)  Thanks for the
code snippet!! 

> PS. If your #manual only ever has a class of either bodywide 
> or bodytoc, I
> would suggest that you modify your css such that simply 
> adding/removing the
> bodytoc class achieves the desired style change, rather than switching
> unnecessarily between the 2 classes.

True - I should come up with a 'default' style and then simply switch
'on' the other style... 

At this point I was just trying to make it all work :)

Thanks!
Jim


[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread Stephan Beal

On Aug 16, 8:59 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Most sites I've seen with these GET vars attached have something URLs
> like this:
>
>   index.html?category=2&product=210
>
> So if I'm on that page, the one for product 210 within category 2, I
> don't want to have a link to index.html highlighted. But I think your
> solution will highlight it.

The answer to that is almost certainly "it depends on the site."

> I think I'll play around with this some more tonight.
>
> This is fun. :)

:D

If you come up with a generic approach, which addresses Bernd's points
and your above point, i'd love to see it. Maybe a plugin with options
for ignoring/respecting GET parameters?

> By the way, Stephan, if you're modifying all those css properties,
> you might want to put them in your stylesheet instead as .foo {color:
> #040400;  /* etc. */ } and then do .addClass('foo').

For quick hacks/tinkering i prefer the .css() approach, but i didn't
know about:

> Or at least use  the "map" version of .css(), like this:
> .css({
>'background-color': '#004040',
>'color': '#fff',
...

That's much more convenient. :)




[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Andy Matthews

John...

I should have added on to my OP. Better examples are really what is needed,
not changes to the language. Let me read through and see possible RW
examples of eq() or is() and let me say "hey I did that very thing last
week, but with 10 more lines of code)".

andy 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 1:48 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


Sure, that makes sense - and it's obviously difficult. I think the burden
may lie on us to write better examples - although, it's hard to think of
ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a plugin is
unable to duplicate functionality (or where a plugin would be hugely
bloated, where the result in core would be quite simple, instead).

That being said, I'm still advancing the library with some fun methods like
.andSelf() whose uses won't become commonly apparent until far down the
line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> John...
>
> To be fair...it's very easy to learn the basics of jQuery, but it's 
> quite a lot of work and time to learn the really cool stuff. I've 
> never used eq() or
> if() and those other because I simply don't understand what they do. 
> I'm sure some of them could improve my code dramatically but I don't 
> even know WHEN I might use them, so I don't know when to look for 
> them. Does that makes sense?
>
> andy
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] 
> On Behalf Of John Resig
> Sent: Thursday, August 16, 2007 12:53 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple 
> special-case uses for both function calls and method names
>
>
> I don't understand this argument at all. So this guy is proposing that 
> we change all the jQuery methods to:
>
> $Array([array of elems])
> $Selector("str")
> $HTML("html")
> $Element(DOMElement)
>
> and:
>
> .appendElement(DOMElement)
> .appendHTML("html")
> .appendArray([array of elems])
>
> what on earth does that gain you? What's the purpose of using a 
> language that can overload arguments and not actually using that 
> feature? What's the advantage of increasing the size of your API 4-fold?
>
> Incredibly weak argument, obviously someone who's never used the library.
>
> > Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if 
> > a method acts on the first element in the collection or all of them.
>
> These arguments are slightly more valid. Although .eq() is going away 
> in 1.2. I really don't know what to say, in this case it was simply a 
> design decision. We could've had:
> .val() (return nothing, do nothing useful)
> .val("val") (set value)
> .getVal() (get value)
> .getVal("val") (return nothing, do nothing useful)
>
> But why have a state of a method perform nothing useful at all? Why 
> not overload it to actually do something? Why double the size of the 
> effective API with half-useful functions?
>
> --John
>
> On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:
> >
> > What do you guys think of this critique of jQuery I found on Simon 
> > Willison's site (which is good reading).
> >
> > http://simonwillison.net/2007/Aug/15/jquery/
> >
> > 
> > jQuery is definitely a popular utility function library, but the 
> > sheer amount of dual/triple/quadruple special-case uses for both 
> > function calls and method names is an instant turnoff for me.
> >
> > The jQuery object itself can perform a selector query, embed a DOM 
> > element, create a DOM element from HTML and assign a DOMContentReady 
> > event handler - and probably more. Event handling is separated into 
> > separate methods for each event type. Some method names make no 
> > immediate sense, like .one or .eq, and you can't immediately tell if 
> > a method acts on the first element in the collection or all of them.
> >
> > I can't recommend jQuery to the developers I am mentoring because it 
> > is in itself a completely separate abstraction, and a muddy one at 
> > that. They will end up having to learn jQuery instead of having to 
> > learn DOM, CSS and JS, and when being considered as a direct 
> > replacement for those it fails both due to complexity and 
> > inconsistency."
> >
> > 
> >
> > Mitch
> >
> >
>
>
>




[jQuery] Re: Cycle Plugin update

2007-08-16 Thread Karl Swedberg



On Aug 16, 2007, at 2:28 PM, Joel Birch wrote:

...and I wrote my previous email before looking at the index.html  
file inside the 'plugin' folder. Now I am just over the moon!


I really think this package needs to be featured prominently  
somewhere on jquery.com as it can only encourage developers to  
release even more plugins. I think it really fills a gap - and does  
so very well.


A+ Mr. Alsup!

Joel Birch.


Yes, thanks so much for these files, Mike!

(A+)++ Mr. Alsup!

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com




[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread Karl Swedberg




Bernd Matzner wrote:

 $('a').each(function(){
  if( window.location.href.indexOf( $(this).attr('href') ) >= 0 &&
$(this).attr('href').length > 1 ) {
$(this).css('background-color','#004040')
.css('color','#fff')
.css('font-style', 'italic')
.css('text-decoration', 'none');
  }
});


 and:


I did a quick test case with the following links:

A | B | http://localhost/index.html";>C | D

The Stephan/Karl solution will only highlight link B regardless of
which link I click, whereas my solution highlights A-C when on the
index.html page regardless of the GET vars attached, and it highlights
A-D when D's parameters are matched - that seems right to me.


Good point, Bernd.

Question, though:

What if the current page is index.html?sdsdg=sdg
Would you really want Link A-C to be highlighted?

Most sites I've seen with these GET vars attached have something URLs  
like this:


 index.html?category=2&product=210

So if I'm on that page, the one for product 210 within category 2, I  
don't want to have a link to index.html highlighted. But I think your  
solution will highlight it.


I think I'll play around with this some more tonight.

This is fun. :)

By the way, Stephan, if you're modifying all those css properties,  
you might want to put them in your stylesheet instead as .foo {color:  
#040400;  /* etc. */ } and then do .addClass('foo'). Or at least use  
the "map" version of .css(), like this:


.css({
  'background-color': '#004040',
  'color': '#fff',
  'font-style': 'italic',
  'text-decoration': 'none'
});


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-16 Thread Michael Geary

> > > $('#foo')[0]
> > >Will throw error if there is no match, IIRC.

> > No, it won't. It is not an error to fetch a nonexistent 
> > array element

> Thanks for a nice explanation. I'm sorry for jumping 
> without reading it properly.

Glad to help - but no apology needed! You should see some of the bloopers
I've posted myself... :-)

-Mike



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread John Resig

Sure, that makes sense - and it's obviously difficult. I think the
burden may lie on us to write better examples - although, it's hard to
think of ones that aren't complex that also aren't contrived.

At this point, I look for fringe cases in jQuery where, simply, a
plugin is unable to duplicate functionality (or where a plugin would
be hugely bloated, where the result in core would be quite simple,
instead).

That being said, I'm still advancing the library with some fun methods
like .andSelf() whose uses won't become commonly apparent until far
down the line.

--John

On 8/16/07, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> John...
>
> To be fair...it's very easy to learn the basics of jQuery, but it's quite a
> lot of work and time to learn the really cool stuff. I've never used eq() or
> if() and those other because I simply don't understand what they do. I'm
> sure some of them could improve my code dramatically but I don't even know
> WHEN I might use them, so I don't know when to look for them. Does that
> makes sense?
>
> andy
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of John Resig
> Sent: Thursday, August 16, 2007 12:53 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
> uses for both function calls and method names
>
>
> I don't understand this argument at all. So this guy is proposing that we
> change all the jQuery methods to:
>
> $Array([array of elems])
> $Selector("str")
> $HTML("html")
> $Element(DOMElement)
>
> and:
>
> .appendElement(DOMElement)
> .appendHTML("html")
> .appendArray([array of elems])
>
> what on earth does that gain you? What's the purpose of using a language
> that can overload arguments and not actually using that feature? What's the
> advantage of increasing the size of your API 4-fold?
>
> Incredibly weak argument, obviously someone who's never used the library.
>
> > Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if a
> > method acts on the first element in the collection or all of them.
>
> These arguments are slightly more valid. Although .eq() is going away in
> 1.2. I really don't know what to say, in this case it was simply a design
> decision. We could've had:
> .val() (return nothing, do nothing useful)
> .val("val") (set value)
> .getVal() (get value)
> .getVal("val") (return nothing, do nothing useful)
>
> But why have a state of a method perform nothing useful at all? Why not
> overload it to actually do something? Why double the size of the effective
> API with half-useful functions?
>
> --John
>
> On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:
> >
> > What do you guys think of this critique of jQuery I found on Simon
> > Willison's site (which is good reading).
> >
> > http://simonwillison.net/2007/Aug/15/jquery/
> >
> > 
> > jQuery is definitely a popular utility function library, but the sheer
> > amount of dual/triple/quadruple special-case uses for both function
> > calls and method names is an instant turnoff for me.
> >
> > The jQuery object itself can perform a selector query, embed a DOM
> > element, create a DOM element from HTML and assign a DOMContentReady
> > event handler - and probably more. Event handling is separated into
> > separate methods for each event type. Some method names make no
> > immediate sense, like .one or .eq, and you can't immediately tell if a
> > method acts on the first element in the collection or all of them.
> >
> > I can't recommend jQuery to the developers I am mentoring because it
> > is in itself a completely separate abstraction, and a muddy one at
> > that. They will end up having to learn jQuery instead of having to
> > learn DOM, CSS and JS, and when being considered as a direct
> > replacement for those it fails both due to complexity and
> > inconsistency."
> >
> > 
> >
> > Mitch
> >
> >
>
>
>


[jQuery] Re: Basic JSON help

2007-08-16 Thread Michael Geary

> So, should I treat my JSON object like a Javascript 
> multi-dimensional array?

Seeing as how JavaScript doesn't *have* multi-dimensional arrays, I probably
wouldn't put it exactly that way. :-)

But you definitely have the right idea. JSON is simply a text representation
of JavaScript objects, arrays, or other JavaScript types. In other words,
JSON *is* JavaScript code. So, once you "eval" it and have a reference to
the eval'ed data, treat it exactly as you would any other JavaScript object
or array - whatever the data type is.

Pure JavaScript:

   var foo = { a:1, b:2 };
   alert( foo.a );  // "1"

Or the same thing with quotes:

   var foo = { "a":1, "b":2 };
   alert( foo.a );  // "1"

JSON+JavaScript

   var jsonText = '{ "a":1, "b":2 }';
   // The '(' and ')' are required for syntactic reasons
   var jsonObject = eval( '(' + jsonText + ')' );
   alert( jsonObject.a );  // "1"

Or alternatively - does the same thing:

   var jsonText = '{ "a":1, "b":2 }';
   eval( 'var jsonObject = ' + jsonText );
   alert( jsonObject.a );  // "1"

In the case of $.getJSON, the "eval" has already been done for you, and the
resulting jsonObject is passed to your callback function.

-Mike



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Andy Matthews

John...

To be fair...it's very easy to learn the basics of jQuery, but it's quite a
lot of work and time to learn the really cool stuff. I've never used eq() or
if() and those other because I simply don't understand what they do. I'm
sure some of them could improve my code dramatically but I don't even know
WHEN I might use them, so I don't know when to look for them. Does that
makes sense?

andy 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: Thursday, August 16, 2007 12:53 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jQuery negatives: dual/triple/quadruple special-case
uses for both function calls and method names


I don't understand this argument at all. So this guy is proposing that we
change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a language
that can overload arguments and not actually using that feature? What's the
advantage of increasing the size of your API 4-fold?

Incredibly weak argument, obviously someone who's never used the library.

> Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a 
> method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away in
1.2. I really don't know what to say, in this case it was simply a design
decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why not
overload it to actually do something? Why double the size of the effective
API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:
>
> What do you guys think of this critique of jQuery I found on Simon 
> Willison's site (which is good reading).
>
> http://simonwillison.net/2007/Aug/15/jquery/
>
> 
> jQuery is definitely a popular utility function library, but the sheer 
> amount of dual/triple/quadruple special-case uses for both function 
> calls and method names is an instant turnoff for me.
>
> The jQuery object itself can perform a selector query, embed a DOM 
> element, create a DOM element from HTML and assign a DOMContentReady 
> event handler - and probably more. Event handling is separated into 
> separate methods for each event type. Some method names make no 
> immediate sense, like .one or .eq, and you can't immediately tell if a 
> method acts on the first element in the collection or all of them.
>
> I can't recommend jQuery to the developers I am mentoring because it 
> is in itself a completely separate abstraction, and a muddy one at 
> that. They will end up having to learn jQuery instead of having to 
> learn DOM, CSS and JS, and when being considered as a direct 
> replacement for those it fails both due to complexity and 
> inconsistency."
>
> 
>
> Mitch
>
>




[jQuery] Re: ColdFusion

2007-08-16 Thread Andy Matthews

Andrea...

Please post them. There's actually quite a few ColdFusion developers on this
list and I'm sure that some of them could make use of your custom tag. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Thursday, August 16, 2007 12:53 PM
To: jQuery (English)
Subject: [jQuery] ColdFusion


Hi,

I am just arrived in this maillist and in Jquery.and it was a bad choice
to wait so long for strating with the amazing jQuery.
I wrote down a set of custom tag for easy implementation in CF of the Klaus
Hartl Tab Plug-In.
If someone is interested to that and to exchange CF implementatio of jquery
library please send me a mail.

Bye

Andrea




[jQuery] Re: Cycle Plugin update

2007-08-16 Thread Joel Birch
...and I wrote my previous email before looking at the index.html file
inside the 'plugin' folder. Now I am just over the moon!

I really think this package needs to be featured prominently somewhere on
jquery.com as it can only encourage developers to release even more plugins.
I think it really fills a gap - and does so very well.

A+ Mr. Alsup!

Joel Birch.


[jQuery] Re: How to select element id that contains [] chars

2007-08-16 Thread Erik Beeson

Try:

$('#scheduleHours\\[' + dayNum + '\\]')

I think you need 1.1.3 for escaping to work right...

--Erik


On 8/16/07, Stuart <[EMAIL PROTECTED]> wrote:
>
> I've got a little problem here that would seem simple to sort out but
> has been rather stubborn. I'm trying to loop through a bunch of hidden
> text fields and grab their value. They look like so;
>
>  value="7.5" />
>  value="7.5" />
>  value="7.5" />
>
> These are the product of a Java Server Faces datalist (Tomahawk
> component) so there is no way to avoid the array-like notation in the
> id. I'm just building an array of these values with a for loop:
>
> var schedule = new Array();
>
> for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
> schedule[dayNum] = $('#scheduleHours[' + dayNum + ']').val();
> }
>
> The problem is that the jQuery selector $('#scheduleHours[' + dayNum +
> ']').val() is not matching anything. Could it be possible that the "["
> and "]" characters are being interpreted by jQuery as being part of
> the attribute selector syntax like so? $("[EMAIL PROTECTED]").val();
> I'm taking a guess here that I need to escape the [] chars.
>
> Anyone have an idea?
>
>


[jQuery] How to select element id that contains [] chars

2007-08-16 Thread Stuart

I've got a little problem here that would seem simple to sort out but
has been rather stubborn. I'm trying to loop through a bunch of hidden
text fields and grab their value. They look like so;





These are the product of a Java Server Faces datalist (Tomahawk
component) so there is no way to avoid the array-like notation in the
id. I'm just building an array of these values with a for loop:

var schedule = new Array();

for (var dayNum = 0; dayNum < counts.days; ++dayNum) {
schedule[dayNum] = $('#scheduleHours[' + dayNum + ']').val();
}

The problem is that the jQuery selector $('#scheduleHours[' + dayNum +
']').val() is not matching anything. Could it be possible that the "["
and "]" characters are being interpreted by jQuery as being part of
the attribute selector syntax like so? $("[EMAIL PROTECTED]").val();
I'm taking a guess here that I need to escape the [] chars.

Anyone have an idea?



[jQuery] Re: Problem with jQEm and scrolling divs on FF

2007-08-16 Thread Dave Cardwell

Nothing seems obvious to me. I'm currently working on a new release of
the plug-in that you might have better luck with. It's not polished or
fully tested yet, but try
http://jquery-em.googlecode.com/svn/trunk/jquery.em.js (the
documentation is only available in the source at the moment).

You can follow progress at http://code.google.com/p/jquery-em/. I'd
report future issues there as I often miss things on this list.

On 16/08/07, Kelvin Luck <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've just added the ability for jScrollPane to work with jQEm so if a
> user changes the text size in their browser the jScrollPane
> automatically updates itself.
>
> In doing so I think I've come across an issue with jQEm and scrolling
> divs in Firefox (PC). An example is worth a thousand words so check this
> example page to illustrate the problem:
>
> http://kelvinluck.com/assets/jquery/jQEmIssue/jQEmBug.html
>
> Any ideas of what is happening?
>
> Cheers,
>
> Kelvin :)
>


[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread Stephan Beal

On Aug 16, 7:39 pm, Mitch <[EMAIL PROTECTED]> wrote:
> 
> jQuery is definitely a popular utility function library, but the sheer
> amount of dual/triple/quadruple special-case uses for both function
> calls and method names is an instant turnoff for me.

This also turns me off to some degree. The main problem i have is that
jQuery(...) can take so many different argument types. In fact,
jQuery(function(){...}) as a shortcut for $(document).ready(function()
{...}) bugs me the most.

> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.

i agree that gt(), lt(), eq(), get(), etc, could/should have been more
verbosely named. Shortcuts like lt, gt, etc. may be familiar to people
who use the Unix shell (test 4 -lt 3), but they're simply opaque to
anyone else.

> I can't recommend jQuery to the developers I am mentoring because it
> is in itself a completely separate abstraction

An interesting point - don't recommend jQ IF the point of your work is
teaching JavaScript.

>, and a muddy one at
> that.

Probably over-stated.

> They will end up having to learn jQuery instead of having to
> learn DOM, CSS and JS, and when being considered as a direct
> replacement for those it fails both due to complexity and
> inconsistency."

Again, over-stated.

Summary:

The author has apparently let a couple of relatively minor details get
on his nerves, to the point that he can no longer reconcile his
feelings. i can relate to this - i hate/despise/refuse to use Python
because whitespace is significant in that language (and whitespace
should rarely, if ever, be significant), and its completely naive
approach to implementing package-private data. Technosophically
speaking, i simply cannot excuse those failings of the language, and
refuse to learn it on those grouds. Simon Willison apparently has a
similar hang-up about jQuery. And, like i am in my hate-hate
relationship with Python, he's in the minority.




[jQuery] ColdFusion

2007-08-16 Thread [EMAIL PROTECTED]

Hi,

I am just arrived in this maillist and in Jquery.and it was a bad
choice to wait so long for strating with the amazing jQuery.
I wrote down a set of custom tag for easy implementation in CF of the
Klaus Hartl Tab Plug-In.
If someone is interested to that and to exchange CF implementatio of
jquery library please send me a mail.

Bye

Andrea



[jQuery] Re: stupid dev tricks: marking "current page" links

2007-08-16 Thread Bernd Matzner

> > As for the each() function -

I've given it some more thought, but I can't come up with a more
elegant solution (except perhaps for filter(), but I doubt that it
improves anything performance-wise). That's because we have to check
if the current link is in the current location, not the other way
around. I guess your scenario always applies to a navigation section,
so one could always narrow down the selector to links within the
navigation, which should cut down the number of times each() is run.

$('#nav a').each(function(){
  var u = $(this).attr('href');
  if( window.location.href.indexOf( u ) >= 0 && u.length > 1 ) {
$(this).css('background-color','#004040')
.css('color','#fff')
.css('font-style', 'italic')
.css('text-decoration', 'none');
  }
});

> Regexes are definitely worth learning.

For some reason, they're coming to me slowly, but my good RegexBuddy
helps me in my trial and error pursuits. ;-) At least I've progressed
to be aware of lookahead/lookbehind.

Bernd



[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-16 Thread John Resig

I don't understand this argument at all. So this guy is proposing that
we change all the jQuery methods to:

$Array([array of elems])
$Selector("str")
$HTML("html")
$Element(DOMElement)

and:

.appendElement(DOMElement)
.appendHTML("html")
.appendArray([array of elems])

what on earth does that gain you? What's the purpose of using a
language that can overload arguments and not actually using that
feature? What's the advantage of increasing the size of your API
4-fold?

Incredibly weak argument, obviously someone who's never used the library.

> Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.

These arguments are slightly more valid. Although .eq() is going away
in 1.2. I really don't know what to say, in this case it was simply a
design decision. We could've had:
.val() (return nothing, do nothing useful)
.val("val") (set value)
.getVal() (get value)
.getVal("val") (return nothing, do nothing useful)

But why have a state of a method perform nothing useful at all? Why
not overload it to actually do something? Why double the size of the
effective API with half-useful functions?

--John

On 8/16/07, Mitch <[EMAIL PROTECTED]> wrote:
>
> What do you guys think of this critique of jQuery I found on Simon
> Willison's site (which is good reading).
>
> http://simonwillison.net/2007/Aug/15/jquery/
>
> 
> jQuery is definitely a popular utility function library, but the sheer
> amount of dual/triple/quadruple special-case uses for both function
> calls and method names is an instant turnoff for me.
>
> The jQuery object itself can perform a selector query, embed a DOM
> element, create a DOM element from HTML and assign a DOMContentReady
> event handler - and probably more. Event handling is separated into
> separate methods for each event type. Some method names make no
> immediate sense, like .one or .eq, and you can't immediately tell if a
> method acts on the first element in the collection or all of them.
>
> I can't recommend jQuery to the developers I am mentoring because it
> is in itself a completely separate abstraction, and a muddy one at
> that. They will end up having to learn jQuery instead of having to
> learn DOM, CSS and JS, and when being considered as a direct
> replacement for those it fails both due to complexity and
> inconsistency."
>
> 
>
> Mitch
>
>


  1   2   3   >