[jQuery] Re: Is there a jQuery way to sort span-elements?

2009-08-28 Thread Audrey A Lee
sorted alphabetically, by span content: var sorted = $.makeArray($('#names span')).sort(function(a,b){ return ($(a).text() $(b).text()) ? -1 : 1;}); $('#names').html(sorted); On Aug 25, 9:14 pm, Audrey Lee audrey.lee.is...@gmail.com wrote: Hello, Assume I have 3 span-elements: div id

[jQuery] jQuery handling of URL params?

2009-08-22 Thread Audrey A Lee
Hello, Rails has a hash named params which contains information from my current URL. Does jQuery have something like params? Related question: What is the jQuery-way of getting data out of the current URL? -Audrey

[jQuery] handling of click event?

2009-08-21 Thread Audrey A Lee
jQuery People, Suppose I have this syntax: $(a.someLinks).click(function(event){tellme();}); I want tellme() to handle the value of href of the clicked link. What syntax do I put in tellme()? I got this far: function tellme() { // does not work: alert($(this)[0].href); // does not work:

[jQuery] Re: handling of click event?

2009-08-21 Thread Audrey A Lee
(this); }); function tellme(obj) {     alert(this.href); } On Aug 21, 12:53 pm, Audrey A Lee audrey.lee.is...@gmail.com wrote: jQuery People, Suppose I have this syntax: $(a.someLinks).click(function(event){tellme();}); I want tellme() to handle the value of href of the clicked link. What

[jQuery] Re: handling of click event?

2009-08-21 Thread Audrey A Lee
charlie.grie...@gmail.com wrote: $(this).attr('href') http://docs.jquery.com/Attributes On Fri, Aug 21, 2009 at 3:53 PM, Audrey A Lee audrey.lee.is...@gmail.comwrote: jQuery People, Suppose I have this syntax: $(a.someLinks).click(function(event){tellme();}); I want tellme

[jQuery] click-event-handler for dynamically created a-elements?

2009-08-20 Thread Audrey A Lee
Hello, I've been working with jQuery about 20 hours now. I like it. I am looking for a demo of putting an a-element inside a div-element. This seems to work: $(#div99)[0].innerHTML = a id='aInDiv99' href='#'I am in div99/ a; I'd like to handle its click-event. I wrote this: