[jQuery] Re: compare two arrays

2007-08-29 Thread Sean Catchpole
This can be done using mapreduce or other functions, but they are only
supported in Firefox atm.
Writing a double for loop is easy to code and wider supported.

~Sean

On 8/28/07, Potluri [EMAIL PROTECTED] wrote:



 Is there a jquery way to compare two arrays without looping.

 like I have an array1 [a,b,1,2,3]
 and array2 [b,c,d,11 ].

 Is there a way like array1.compare(array2). which returns true if atleast
 one element among the 2 arrays matches.

 Straight answers are appreciated.

 Regards,
 Vijay Potluri
 --
 View this message in context:
 http://www.nabble.com/compare-two-arrays-tf4344387s15494.html#a12376633
 Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: DIV clipping or autofit question

2007-08-29 Thread Klaus Hartl


Feed wrote:

Yes, Firefox does this. I'm not sure if it's a bug or a feature,
though. I don't think Firefox, which is known for it's good standards
compliance, would suffer from such a stupid bug. Or maybe I'm
wrong. :)


Nowhere in the spec (up to CSS 2.1) is defined how to handle wrapping 
long strings without any spaces in it, thus Firefox nor any other modern 
browser does it.


IE has had a propietary feature that lets you declare how to handle such 
a situation (word-wrap and word-break and properties):


http://msdn2.microsoft.com/en-us/library/ms531186.aspx
http://msdn2.microsoft.com/en-us/library/ms535149.aspx

These properties went into the CSS 3 text module:
http://www.w3.org/TR/css3-text/#word-wrap

I don't know if any browser supports that to date. Ha, IE supports CSS 3 
already so to say.


That module is working draft, thus I don't think you can call it a bug 
if a browser does not support it yet.




--Klaus


[jQuery] Re: Performance from 1.1.2 to 1.1.4

2007-08-29 Thread oscar esp

I will try Jeffry. I will keep you informed.

On 28 ago, 19:07, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 Wow.  Well that's not too good.

 Is there any way you could upload a sample of this to a public location?
 This would really be needed for to track down what the issue is.

 JK



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

 Behalf Ofoscaresp
 Sent: Tuesday, August 28, 2007 12:14 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Performance from 1.1.2 to 1.1.4

 Hi Jeffry ,

 I am agree about VS.

 When I execute without VS I get better performance obiuslly however
 1.1.2/1.1.3  is faster thatn 1.1.4:

 -1.1.4 : 2 seconds (from select an item in client after the second
 combo is load in client)
 -1.1.2  1.1.3:  less thant 1 second (from select an item in client
 after the second combo is load in client) .

 On 27 ago, 19:46, Jeffrey Kretz [EMAIL PROTECTED] wrote:
  As a note, any tests I have done in Visual Studio in ANY javascript (not
  just jQuery) are significantly slower in debug mode with VS attached than
 if
  just running it normally.

  This is due to the work the debugger is doing while the code executes.

  I would suggest testing your app on your intranet, but not in debug mode,
  with the script itself calculating the time it takes to execute.

  This would be a more accurate way to see if 1.1.4 is actually slower than
  1.1.2 in your project.

  JK

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

  Behalf Ofoscaresp
  Sent: Monday, August 27, 2007 9:35 AM
  To: jQuery (English)
  Subject: [jQuery] Re: Performance from 1.1.2 to 1.1.4

  I am in debug mode  (visual studio) in execution the diferences are:

  -1.1.4 : 2 seconds (from select an item in client after the second
  combo is load in client)
  -1.1.2  1.1.3:  less thant 1 second (from select an item in client
  after the second combo is load in client)

  Seems that 1.1.2  1.1.3 is faster than 1.1.4

  On 27 ago, 18:09, John Resig [EMAIL PROTECTED] wrote:
   Slow server?

   There's on reason for a 7 second delay of any sort in jQuery.

   Do you have a demo of  this online?

   --John

   On 8/27/07,oscaresp[EMAIL PROTECTED] wrote:

I am doing some test in order to migrate from 1.1.2 to 1.1.4... and I
got some strange result.

I have two combo, when you chose an item in the first I load the
related items in the second one using an ajax call.

With 1.1.2 I spend  1 second to load the second combo...

With 1.1.4 I spend 8 seconds

Any explanation?- Ocultar texto de la cita -

   - Mostrar texto de la cita -- Ocultar texto de la cita -

  - Mostrar texto de la cita -- Ocultar texto de la cita -

 - Mostrar texto de la cita -



[jQuery] Release: Accordion 1.5

2007-08-29 Thread Erin Doak


It's late and maybe I'm wrong but there seems to be an infinite 
recursion error (Firebug says too much recursion) when multiple dd 
tags are used inside a dt tag. Maybe the plugin was never meant to be 
used with this html structure.


Example: http://rmip.com/accordion/
Top example has the problem. Error occurs on clicking a heading.
The bottom doesn't.

jQuery version is 1.1.4.


Erin


[jQuery] Re: DIV clipping or autofit question

2007-08-29 Thread Alexandre Plennevaux

Pop, 

you can also finetune this presentational behavior via css: white-space:
no-wrap / pre / auto

 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Pops
Sent: mardi 28 août 2007 23:39
To: jQuery (English)
Subject: [jQuery] Re: DIV clipping or autofit question


HA!!!  That was it.

The JSON data did not have any spaces. I added a space before each field and
viola,  it is auto-fitted when you resize the window!

Amazing, freaking amazing. :-)

Thanks

--
HLS

On Aug 28, 4:27 pm, seedy [EMAIL PROTECTED] wrote:
 Is the text you are trying to display
 onereallylongstringthatdoesnotcontainanyspaces???

 I believe Firefox has a bug that prevents it from wrapping text that 
 does not have a space in it, I often run into that problem when trying 
 to display URL's in firefox.



 Pops wrote:

  I have a div  id=wcResult container.

  Via $.ajax() the success and failure call back do this:

  $(#wcResult).text(xml.responseText);

  to display the result.

  If success, the server sends JSON formatted data.
  If failure, like uthentication required, HTML is sent.

  For the JSON data,  the div will not clip or autofit the content. It 
  runs off the div border.

  For the HTML, the div will autofit the content very nicely.

  I am not completely sure the reason for this, but I believe its 
  related to HTML :-)

  Comments?

  PS: This is only under FireFox.  IE fits them both.

  --
  HLS

 --
 View this message in
context:http://www.nabble.com/DIV-clipping-or-autofit--question-tf4343725s15
4...
 Sent from the JQuery mailing list archive at Nabble.com.

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.484 / Base de données virus: 269.12.10/977 - Date: 28/08/2007
16:29
 



[jQuery] Re: compare two arrays

2007-08-29 Thread Gordon

Map and reduce iterate over the array as well so the only speedup
you'd gain from using them is the fact that they're natively
implemented and not written in JavaScript themselves. They still
represent functions that loop over arrays.

On Aug 29, 7:12 am, Sean Catchpole [EMAIL PROTECTED] wrote:
 This can be done using mapreduce or other functions, but they are only
 supported in Firefox atm.
 Writing a double for loop is easy to code and wider supported.

 ~Sean

 On 8/28/07, Potluri [EMAIL PROTECTED] wrote:



  Is there a jquery way to compare two arrays without looping.

  like I have an array1 [a,b,1,2,3]
  and array2 [b,c,d,11 ].

  Is there a way like array1.compare(array2). which returns true if atleast
  one element among the 2 arrays matches.

  Straight answers are appreciated.

  Regards,
  Vijay Potluri
  --
  View this message in context:
 http://www.nabble.com/compare-two-arrays-tf4344387s15494.html#a12376633
  Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] How to use Form Plugin and ValidationAide Plugin

2007-08-29 Thread Massimiliano Marini

Hi all,

I'm using Form Plugin without problem, now I need to validate the
fields, in the jQuery's plugin page I've found this plug-in:

http://dnaide.blogspot.com/2007/05/validationaide-easy-as-client-side-form.html

My question is : There's a way to validate the field with this plugin
and when all is ok ajaxForm do his works?

I manage my form with this Form Plugin code:
$(document).ready(function() { 
$('#f1').ajaxForm(function() { 
target: '#response',
success: function() {
$('#response').fadeIn('slow');
}
}); 

--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
It's easier to invent the future than to predict it.  -- Alan Kay


[jQuery] Re: Problem dragging forms

2007-08-29 Thread Richard D. Worth
I don't know the specifics of the easydrag plugin, however, I have seen this
as a common problem in drag-n-drop code/libraries. jQuery UI draggables
(official release coming soon, now in SVN) gives you two options for
handling this case:

1. dragPrevention(string) - You specify a jQuery selector. All matching
child elements will allow normal mouse interaction, not initiating a drag
operation. Ex: dragPrevention: 'a, input, button'

2. handle(string) - Again, a jQuery selector. Dragging can only be initiated
on the matching element(s), allowing normal mouse interaction on the rest of
the element. Ex: handle: 'div.dragHandle'

- Richard

On 8/27/07, polycarp [EMAIL PROTECTED] wrote:


 Hey everybody! I'm new to JQuery and have been searching the net for
 info on the easydrag plugin, but nothing seems to help. My problem is
 pretty simple: how do you put a form into a draggable div?

 Once the div is set to be draggable, you no longer have access to the
 form fields for entry. I've tried triggering easydrag on a mousedown
 of a header within the div, but once it's set, it's set. Is there a
 way to turn features like easydrag on and off? Is there another
 (easier/better) way to accomplish the same task?

 Thanks in advance for any help you can lend. This is a great community
 and I hope to participate more in the future as my understanding
 grows.

 poly




[jQuery] like 'isset'...determining is something exists on the page

2007-08-29 Thread Txt.Vaska


I'm trying to determine if soemthing has been set on the page...and  
if it is do a different action. I have...


if ($('a#f_' + ide).siblings().is('img'))
{
  // do this action
}
else
{
  // do something else
}

Which looks to see if an image exists in

I'm expecting that .is() will return true in some cases but it never  
does.


Am I going about this entirely the wrong way?

Thanks


[jQuery] Re: document ready shortcut and scoping

2007-08-29 Thread DaveG




Michael Geary wrote:

Ah, now I'm following you! I'm slow today.

Heh -- just remember, slow is relative :)


This will work:

   var test;
   jQuery ( function() { test = function() {alert('here')} } );

   // and sometime later in your code, after document.ready fires
   test();  // test is defined at this point...


It works indeed, thanks for the help.

 ~ ~ Dave


[jQuery] How do child selectors work in jQuery?

2007-08-29 Thread Jeroen Coumans

Hi,

See http://lab.jeroencoumans.nl/jquery/child-selector.html
It's my understanding that child selectors only select direct children
of an element. Thus, $('#test  li') should only select direct
descendent li elements of #test, not nested li's. This is
confirmed with a simple CSS rule. So how come, when I attach a click
event to a direct child, it seems to attach itself to all
descendents?

Regards, Jeroen



[jQuery] Re: Release: Accordion 1.5

2007-08-29 Thread Brandon Aaron
Firebug has a tendency to say that every once in a while. Restart Firefox
and see if it still has the error.

--
Brandon Aaron

On 8/29/07, Erin Doak [EMAIL PROTECTED] wrote:


 It's late and maybe I'm wrong but there seems to be an infinite
 recursion error (Firebug says too much recursion) when multiple dd
 tags are used inside a dt tag. Maybe the plugin was never meant to be
 used with this html structure.

 Example: http://rmip.com/accordion/
 Top example has the problem. Error occurs on clicking a heading.
 The bottom doesn't.

 jQuery version is 1.1.4.


 Erin



[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Brandon Aaron
Because you are binding the click event to the a tag, not the li. So what
your saying is get all the a tags within each li (which is all the a tags in
your ul). You just need one more child selector in there between the li and
a to make sure you only select the immediate a tags of the li only ...
instead of all the a tags within the li.

$('#test  li  a').click(...);

--
Brandon Aaron


On 8/29/07, Jeroen Coumans [EMAIL PROTECTED] wrote:


 Hi,

 See http://lab.jeroencoumans.nl/jquery/child-selector.html
 It's my understanding that child selectors only select direct children
 of an element. Thus, $('#test  li') should only select direct
 descendent li elements of #test, not nested li's. This is
 confirmed with a simple CSS rule. So how come, when I attach a click
 event to a direct child, it seems to attach itself to all
 descendents?

 Regards, Jeroen




[jQuery] Re: Toggling the html of an element

2007-08-29 Thread voltron

Cool! Thanks

On Aug 28, 12:38 am, Dan Evans [EMAIL PROTECTED] wrote:
 One reason why the others may not have worked is because .toggle()
 assigns a click handler to an element. It is the same as
 writing .click() except that it takes two functions instead of one and
 it alternates them. So the original way it's written says, When the
 user clicks this thing add a new click handler to it If you clicked
 it multiple times it might start working but it might have bizarre
 results.
 To add onto your most recent post I would recommend you try to do as
 few calls to the DOM as possible so you can probably replace some
 things with $(this) like so:

 script type=text/javascript
 $(document).ready(function(){
   $('#toggleTwo').toggle(function(){
 $(this).html('hide');
 $('#rubricTwo').hide();
 return false;
 }, function(){
 $(this).html('show');
 $('#rubricTwo').show();
 return false;
 });
}); // end document.ready
 /script
 In this case the keyword 'this' (without quotes) refers to the object
 that was clicked that way we don't need to do another
 getElementById(). I think you had it similar to this to begin with, so
 you were closer to being correct than you thought ;)

 - Dan

 On Aug 27, 1:58 pm, voltron [EMAIL PROTECTED] wrote:

  thanks for the heads up Dan! I modified your code and it worked, you
  missed out the part that really hides and shows the element:

  script type=text/javascript
  $(document).ready(function(){
$('#toggleTwo').toggle(function(){
  $('#toggleTwo').html('hide');
$('#rubricTwo').hide();
  return false;
  }, function(){
  $('#rubricTwo').show();
  $('#toggleTwo').html('show');
  return false;
  });
 }); // end document.ready

  I am still curious why the other methods do not work

  On Aug 27, 10:11 pm, Dan Evans [EMAIL PROTECTED] wrote:

   How about instead of putting a .toggle() inside a .click() just use
   a .toggle()? Something like this:
   script type=text/javascript
   $(document).ready(function(){

   $('#toggleTwo').toggle(function(){
   $('#rubricTwo').html('hide');
   return false;
   }, function(){
   $('#rubricTwo').html('show');
   return false;
   });

   }); // end document.ready

   /script

   - Dan

   On Aug 27, 11:23 am, voltron [EMAIL PROTECTED] wrote:

Hi all,

I am toggling an element using A tags, I would like the A tag to
display Show or Hide depending on the state. my proble is, I
cannot get this to work properly:

my code:

script type=text/javascript
$(document).ready(function(){

$('#toggleTwo').click(function(){
$('#rubricTwo').toggle(function(){
   $(this).html = hide;} ,function(){$(this).html =
show;}
);// end toggle
return false;
});
   }); // end document.ready
/script

# == HTML

a href= id=toggleTwohide/a

div id=rubricTwo blah blah/div

Any ideas? Thanks!



[jQuery] Re: Live Query with Draggables

2007-08-29 Thread Theodore Ni
I know exactly what you mean, and it makes perfect sense, and now going back
to Firefox, it works like a charm. Normally that would be enough for me, but
this needs to run in the exploder :-(

Ok, I've gone back and tried to recreate this example, and you are right,
the selector works if I add in an id, such as

$('#containerID form.client').livequery(...);

Why is that? I had hoped to be able to use just $('form.client') [or $('
form.ajax') for some other forms] because it requires some extra work to get
the id of the containing element. I have a custom Window class which creates
new IDs automatically as new windows are made, so it isn't set in stone.

And it seems Draggable doesn't even need to be registered as a plugin since
it probably deletes whatever cloned node it made after the drag is over.

Thanks for the great help. At least I now know what the problem seems to be.

Ted


On 8/28/07, Brandon Aaron [EMAIL PROTECTED] wrote:

 Just use Live Query to bind the submit handler. It will only bind it once
 per a new form element.

 $(' form.client').livequery('submit', function() { alert('boo'); return
 false; });

 Also, try to give the selector more scope, like a parent element with an
 ID.

 $('#containerID form.client ').livequery(...);

 Could you upload an example somewhere that we could see?

 --
 Brandon Aaron

 On 8/28/07, Theodore Ni [EMAIL PROTECTED] wrote:
 
 
  That sounds like it should work, but it isn't doing anything. I think
  there must be something wrong with my fundamental understanding of how
  jQuery or the plugins work.
 
  Suppose I try this:
 
  $(' form.client').livequery(function() {
  //alert('new: ' + $(this).parent().attr('id'));
  $(this).unbind('submit');
  $(this).submit(function() { alert('boo'); return false; });
  }, function() { alert('removed'); });
 
  After dragging, I get no alerts on form submission, and the return
  false is not working either. Oddly, if I comment out the unbind()
  statement, then the functions layer on top of one another, so I get
  progressively more and more alerts after every drag operation.
 
  I was able to directly work with the form's onsubmit, which doesn't
  layer, so this isn't a problem, but I am using the AJAX form plugin as
  well, and that doesn't work very well.
 
  It is worth nothing that the new and remove alerts show up once at the
  beginning of a drag and at the end of one, as you would expect.
 
  Unfortunately, I just don't know enough about either plugin to figure
  out what is going wrong, and I'm not very familiar with Firebug :-(
 
  I'm grateful for any help you guys can give me.
 
  On 8/28/07, Brandon Aaron [EMAIL PROTECTED]  wrote:
   I'm not very familiar with the Interface library but it looks like the
 
   Draggable code clones the element using native DOM methods. Try
  registering
   the Draggable plugin via the registerPlugin method (
   http://brandonaaron.net/docs/livequery/#plugin-developers) like this:
  
   $.livequery.registerPlugin(Draggable);
  
   Now Live Query will know to watch for changes created by the Draggable
  code.
  
   --
   Brandon Aaron
  
   On 8/28/07, Theodore Ni [EMAIL PROTECTED]  wrote:
   
   
Hey guys,
   
I'm having a spot of trouble combining live query with interface
draggables, and I'm afraid I don't have the time to study the
internals of both plugins (I'm in midst of trying to meet a
  deadline),
so I hope you guys can briefly explain how both work.
   
When I am dragging something, does it move the original element or
does it clone it and then move it? For Live Query, how does it
determine when something new is added to the DOM?
   
I ask because I have been having trouble using live query with forms
 
in draggable DHTML windows. I attach functions to the forms on
  submit
using live query (because I put the name of the callback function in
  a
hidden field inside the form), and the forms don't always work after
 
they are dragged.
   
Thanks,
Ted
   
   
  
 
 
  --
  Ted
 




-- 
Ted


[jQuery] Re: jQuery 1.1.4: Faster, More Tests, Ready for 1.2

2007-08-29 Thread henry

1.1.4 breaks Interface, firebug reports:


jQuery.easing[options.easing] is not a function

z.now = jQuery.easing[options.easing](p, n, firstNum, (last-firstNum),
options.duration);

jquery.js line 5214



help? thx.



[jQuery] New plugin: elementReady

2007-08-29 Thread Bennett McElwee

I have written a simple but useful jQuery plugin.
jQuery.elementReady() calls a function during page load as soon as a
specific element is available -- even before the full DOM is loaded.
It's useful if you have unobtrusive JavaScript that you want to apply
to particular page elements immediately, without having to wait for
the whole DOM to load in a large page.

Using the elementReady plugin is very similar to the existing
jQuery.ready() function, except that you must also pass in a string
representing the ID of the element that should have the function call
attached.

The plugin, documentation and more are available at
http://www.thunderguy.com/semicolon/2007/08/14/elementready-jquery-plugin/

This is an early version of the plugin. While it works well for me in
testing (and on this page), it has not been reviewed or exhaustively
tested. I would appreciate your comments on the idea and the
implementation.



[jQuery] AJAX and Http Response Codes

2007-08-29 Thread oravecz

Is there a more raw form of .ajax (or get, .post) that will expose
the XHR method to the success (or error) handler?

I am attempting to convert an application to jQuery that has a
proprietary server module that uses a wide range of HTTP status codes
for certain nuances on the client.

I notice that the XHR is returned when an ajax method is invoked:

var xhr = $.get(uri, options.parameters, options.onSuccess, 'xml');

I suppose I could create a new class that encapsulates the ajax call
and makes the XHR method available as a private variable. If I provide
my own onSuccess handler proxy, I could gain access to the XHR
variable and pass it along. I am hoping that jQuery or a plugin may
have already taken care of this.



[jQuery] Re: jQuery 1.1.4: Faster, More Tests, Ready for 1.2

2007-08-29 Thread digitarald

Pops,

this problem occurred in jQuery because of the heavy usage of
closures, especially in the case of onreadystatechange (as explained
in the article posted in the jQuery ticket). It never occurred for
example in MooTools because the onreadystatechange handler is a class
method and not a closure. The easiest fix, instead of using a
periodical checker which seems kind of weird on the first blush, is to
avoid closures during coding (like in MooTools, as mentioned above,
because of the class/OOP design). Of course every frameworks resets
the handler when the request is completed, that's not the problem. I
hope this describes the problem and the leaks better and explains the
naive code of other developers that does not result in leaks.

Harald

On Aug 28, 7:36 pm, Pops [EMAIL PROTECTED] wrote:
 On Aug 27, 11:31 am, John Resig [EMAIL PROTECTED] wrote:



  YUI, Dojo, and jQuery all use this technique to avoid these leaks.
  It's unavoidable otherwise.

 John,

 I'm curious.  Been catching up of the technical issues and JS/DOM
 framework, and it seems to me that a basic part of the issues is
 related to closures and anonymous functions and how the JS user agents
 deals with it.

 I'm curious if you tried/explored initialize the  XHR.readystatechange
 handler? How about XHR worker thread pools?  or not using a anonymous
 function for the handler but a external function?

 I tried all this for IE and FF and under Windows, I don't see any more
 leaks.

 I used this suggestion for initializing the hander:

 http://www.volkanozcelik.com/cre8/blog/2006/04/another-way-to-prevent...

 var Constants = {
  NULL:function() {}

 };

 usage  xml.onreadystatechange = Constants.NULL;

 --
 HLS



[jQuery] ie6/ie7: slideDown doesn't work on dd that contains a script

2007-08-29 Thread [EMAIL PROTECTED]

strangeness: i have a setup where clicking on a dt causes a sibling dd
to slideDown. this works fine *unless* the dd contains a script tag
(fwiw, the script tag references a script on another server). when i
click on this particular dt, both ie6 and ie7 crash (on different
computers). any ideas?

[please feel free to point out better ways to do the other things i'm
doing too]

$(document).ready(function() {
  var rightCol = $('#right-col');
  $('dl dd',rightCol).hide();

  var rightColItems = $('dt',rightCol);
  rightColItems.each(function() {
$(this).css({ cursor: 'pointer' });
$(this).click(function() {
  if ($(this).next('dd').is(':hidden')) {
$('#right-col dd:visible').each(function() { $
(this).slideUp(); });
$(this).next('dd').slideDown();
  }
});
  });

});



[jQuery] Keyboard Shortcuts (hooking) Plugin

2007-08-29 Thread Tzury

(reposting from plug-in group)
Hi all,

Last night I rewrote (granted permissions by author) the module
shortcut.js (from http://www.openjs.com/scripts/events/keyboard_shortcuts/)
as a jQuery plug-in.

The syntax is simple:
hooking:
$.shortcut.add(shortcut, options, callback);

unhooking
$.shortcut.remove(shortcut);

for example:

$.shortcut.add(Ctrl+a, {propagate: true}, funcRef);

The default options are: {type: 'keydown', propagate: false,
disableInInput: false, target: document}

jQuery.shortcut.add(Ctrl+Shift+2, function(){return;});

jQuery.shortcut.add(Ctrl+2, {target: ':input'}, function(){ // do
something});

Stop hooking?

jQuery.shortcut.remove(Ctrl+2);

Browser Tests So Far:
IE7, FF 2, Opera 9.2

I am planning to add a test suite covers all the functionality in
order to make it easier with the testing.

Help is needed with Testing and Code Review.

You can download a pre alpha version from 
http://code.google.com/p/snippets-4-all/

Thank you for the jQuery,

Tzury Bar Yochay

[EMAIL PROTECTED]
http://evalinux.wordpress.com
facebook.com/profile.php?id=513676303



[jQuery] Re: Live Query with Draggables

2007-08-29 Thread Theodore Ni
Just in case anyone wants to see, this is the test script that I used. Just
change the filenames to whatever you want:


html
head
titleTesting Dragging/title
script type=text/javascript src=jquery.js/script
script type=text/javascript src=jquery.livequery.js/script
script type=text/javascript src=jquery.interface.js/script
script type=text/javascript

$(document).ready(function() {

// I'd think that this would work
$('form.client').livequery('submit', function() {
alert($(this).find('[EMAIL PROTECTED]').attr('value'));
return false;
});

// until I make this draggable
$('#modal').Draggable();

});

/script
/head
body style=background: blue;
div id=modal style=background: green;
  form class=client
div class=headerDrag me!/divbr
input name=val type=text value=My Value
input type=submit value=What is my value?
  /form
/div
/body
/html
On 8/28/07, Theodore Ni [EMAIL PROTECTED] wrote:

 I know exactly what you mean, and it makes perfect sense, and now going
 back to Firefox, it works like a charm. Normally that would be enough for
 me, but this needs to run in the exploder :-(

 Ok, I've gone back and tried to recreate this example, and you are right,
 the selector works if I add in an id, such as

 $('#containerID form.client').livequery(...);

 Why is that? I had hoped to be able to use just $('form.client') [or $('
 form.ajax') for some other forms] because it requires some extra work to
 get the id of the containing element. I have a custom Window class
 which creates new IDs automatically as new windows are made, so it isn't set
 in stone.

 And it seems Draggable doesn't even need to be registered as a plugin
 since it probably deletes whatever cloned node it made after the drag is
 over.

 Thanks for the great help. At least I now know what the problem seems to
 be.

 Ted


  On 8/28/07, Brandon Aaron [EMAIL PROTECTED]  wrote:
 
  Just use Live Query to bind the submit handler. It will only bind it
  once per a new form element.
 
  $(' form.client').livequery('submit', function() { alert('boo'); return
  false; });
 
  Also, try to give the selector more scope, like a parent element with an
  ID.
 
  $('#containerID form.client ').livequery(...);
 
  Could you upload an example somewhere that we could see?
 
  --
  Brandon Aaron
 
  On 8/28/07, Theodore Ni [EMAIL PROTECTED] wrote:
  
  
   That sounds like it should work, but it isn't doing anything. I think
   there must be something wrong with my fundamental understanding of how
  
   jQuery or the plugins work.
  
   Suppose I try this:
  
   $(' form.client').livequery(function() {
   //alert('new: ' + $(this).parent().attr('id'));
   $(this).unbind('submit');
   $(this).submit(function() { alert('boo'); return false; });
   }, function() { alert('removed'); });
  
   After dragging, I get no alerts on form submission, and the return
   false is not working either. Oddly, if I comment out the unbind()
   statement, then the functions layer on top of one another, so I get
   progressively more and more alerts after every drag operation.
  
   I was able to directly work with the form's onsubmit, which doesn't
   layer, so this isn't a problem, but I am using the AJAX form plugin as
  
   well, and that doesn't work very well.
  
   It is worth nothing that the new and remove alerts show up once at the
   beginning of a drag and at the end of one, as you would expect.
  
   Unfortunately, I just don't know enough about either plugin to figure
   out what is going wrong, and I'm not very familiar with Firebug :-(
  
   I'm grateful for any help you guys can give me.
  
   On 8/28/07, Brandon Aaron [EMAIL PROTECTED]  wrote:
I'm not very familiar with the Interface library but it looks like
   the
Draggable code clones the element using native DOM methods. Try
   registering
the Draggable plugin via the registerPlugin method (
http://brandonaaron.net/docs/livequery/#plugin-developers) like
   this:
   
$.livequery.registerPlugin(Draggable);
   
Now Live Query will know to watch for changes created by the
   Draggable code.
   
--
Brandon Aaron
   
On 8/28/07, Theodore Ni [EMAIL PROTECTED]  wrote:


 Hey guys,

 I'm having a spot of trouble combining live query with interface
 draggables, and I'm afraid I don't have the time to study the
 internals of both plugins (I'm in midst of trying to meet a
   deadline),
 so I hope you guys can briefly explain how both work.

 When I am dragging something, does it move the original element or
  
 does it clone it and then move it? For Live Query, how does it
 determine when something new is added to the DOM?

 I ask because I have been having trouble using live query with
   forms
 in draggable DHTML windows. I attach functions to the forms on
   submit
 using live query (because I put the name of the callback function
   in a
 

[jQuery] I can't specify the photos width and height

2007-08-29 Thread Omar101

Hi,
I have created a jCarousel photo gallery using drupal, it takes the
photos dynamically from drupal moduke, its work fine, but i can't
control the photos width and height, it takes it as it is stored in
drupal module what i should do.
furthermore i specified it in my configuration, but it isn't
applied but the scroll property  is  applied right... why?!!!

jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
scroll: 3,
itemwidth : 100,
itemheight : 80
});
});
Thanks for your support,



[jQuery] I can't specify the photos width and height

2007-08-29 Thread Omar101

Hi,
I have created a jCarousel photo gallery using drupal, it takes the
photos dynamically from drupal moduke, its work fine, but i can't
control the photos width and height, it takes it as it is stored in
drupal module what i should do.
furthermore i specified it in my configuration, but it isn't
applied but the scroll property  is  applied right... why?!!!

jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
scroll: 3,
itemwidth : 100,
itemheight : 80
});
});
Thanks for your support,



[jQuery] Re: What's wrong with my syntax?

2007-08-29 Thread Theodore Ni
I believe you need a comma after all but the last function, because they are
name : value pairs in an object.

On 8/28/07, juliandormon [EMAIL PROTECTED] wrote:



 I'm trying to use both afterFileAppend and afterFileRemove. I get an
 syntax
 error in javascript:

 Missing } after property list
 afterFileAppend:function(element,value,master){


 Here's my code:

 $.MultiFile({

afterFileRemove:function(){

 $(#galleryEdits).jScrollPane({showArrows:true,scrollbarWidth:15,
 scrollbarMargin:0, arrowSize: 16});
}

  afterFileAppend:function(element,value,master){
   //alert('File selected:\n'+value + ' ' + element.id  + ' ' +
 master);
if (element.id == 'multi_0_1'){
$(#multiFileWarning).html('You are uploading more
 than one file. If you
 add a title, description, keywords or alt tag, it will be applied to all
 the
 images that are being uploaded. You may choose to leave these blank and
 then
 update the individual file captions in the Edit/Delete/Sort Media
 section.divnbsp;/div');
}


 $(#galleryEdits).jScrollPane({showArrows:true,scrollbarWidth:15,
 scrollbarMargin:0, arrowSize: 16});
}

 });


 Works fine without the afterFileRemove block.

 Much appreciated!
 --
 View this message in context:
 http://www.nabble.com/What%27s-wrong-with-my-syntax--tf4344623s15494.html#a12377448
 Sent from the jQuery Multiple File Upload mailing list archive at
 Nabble.com.




-- 
Ted


[jQuery] slideDown of dd containing a script crashes ie6/ie7: jQuery 1.1.3.1

2007-08-29 Thread [EMAIL PROTECTED]

[apologies if this is a dupe -- i posted this last night and don't see
it on the message board]

i have a piece of code that makes it so when you click on a dt, it
reveals the sibling dd using the slideDown effect. this seems to work
fine except one one dt/dd -- in that case, clicking on the dt crashes
ie6 and ie7 (on separate computers). i've traced the problem to a
script that appears at the end of the dd; this script document.writes
a div of content to the page. this script is from an external source
and can't be modified.

other notes:

- if i replace slideDown with fadeIn, it works fine
- if i remove the script from the dd, it works fine

here is my code. please point out anything else i'm doing wrong too :)

var rightColItems = $('dt',rightCol);
rightColItems.each(function() {
  $(this).css({ cursor: 'pointer' });
  $(this).click(function() {
if ($(this).next('dd').is(':hidden')) {
  $('#right-col dd:visible').each(function() { $
(this).slideUp(); });
  $(this).next('dd').slideDown();
}
  });
});


thanks,
-rebecca



[jQuery] Re: Fading element opacity problem using Interface FX!!!

2007-08-29 Thread henry

I can't imagine this bug still exists in jQuery 1.1.4.

Firefox firebug output:

--
jQuery.easing[options.easing] is not a function
z.now = jQuery.easing[options.easing](p, n, firstNum, (lastNum-
firstNum, options.durations);

jquery.js (line 5214)
--

Help! What should I do now?


On Aug 17, 11:42 am, Joan Piedra [EMAIL PROTECTED] wrote:
 Hey Nazgulled,
 I got the same problem a while ago, dunno how but I did fixed it.
 Maybe you could take a look at the site and see if it can helps 
 you.http://www.justaquit.com/

 Cheers,

 On 8/6/07, Nazgulled [EMAIL PROTECTED] wrote:





  Anyway, I'm not going to use this effect because stupid IE7 and Opera9
  makes the text all jaggy (not anti-aliased) when fading the div
  element... This sucks!!!

  On Aug 7, 1:45 am, Nazgulled [EMAIL PROTECTED] wrote:
   I opted by patching my version, thank you. And yes, I was using jquery
   1.1.3.1. :)

   On Aug 6, 11:50 pm, Aaron Heimlich [EMAIL PROTECTED] wrote:

You're definitely not the first to experience that bug[1]. The good
  news is
that it's been fixed in SVN[2]. The bad news is that the fix happened
  after
jQuery 1.1.3.1 was released, so you have a couple options (I'm
  assuming
you're using 1.1.3.1 here):

A) Revert to jQuery 1.1.2
B) Patch your version jQuery so that it includes the fix[2]

[1] Seehttp://dev.jquery.com/ticket/1396
[2]http://dev.jquery.com/changeset/2423

On 8/6/07, Nazgulled [EMAIL PROTECTED] wrote:

 It doesn't matter... even if I set it to 0 or 0.0, the same thing
 happens. Any reason why and any solution?

 On Aug 6, 9:30 pm, Mitchell Waite [EMAIL PROTECTED] wrote:
  Is hide a legal keyword for opacity?

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

  Behalf Of Nazgulled
  Sent: Monday, August 06, 2007 11:25 AM
  To: jQuery (English)
  Subject: [jQuery] Fading element opacity problem using Interface
  FX!!!

  What's the problem? Why does A work and B doesn't?
  A: $(this).animate({ color: '#ff' }, 200);
  B: $('div#cpblock').animate({opacity: hide}, 3000);

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]://aheimlich.freepgs.com

 --
 Joan Piedra || Frontend webdeveloperhttp://joanpiedra.com/



[jQuery] Re: img src problem in IE6

2007-08-29 Thread mohsin

yes image src is not changing i try to alert the src with this code
alert($('#fp_img').attr(src)); and alert is undefined even in IE7
and firefox...


On Aug 28, 8:36 pm, Richard D. Worth [EMAIL PROTECTED] wrote:
 On 8/28/07, mohsin [EMAIL PROTECTED] wrote:



  $('#fp_menu a').each(function()
  {
  dev_id = querySt(dev_id);
  $(this).click(function()
  {
  new_src =
  http://+this_domain+/development/images/+dev_id+/
  floorplan/+this.id;
  $('#fp_img').attr({ src: new_src });
  });

  });

  in IE6 src is not changing.its work well in firefox and IE7

 If the src attribute value isn't changing, then I don't know what the
 problem may be. However if the src attribute value *is* changing, yet the
 image doesn't seem to update, you may want to take a look at this thread:

 Swapping img src in IE shows 
 blankhttp://groups.google.com/group/jquery-en/browse_thread/thread/f67fe19...

 - Richard



[jQuery] I can't specify the photos width and height

2007-08-29 Thread Omar101

Hi,
I have created a jCarousel photo gallery using drupal, it takes the
photos dynamically from drupal moduke, its work fine, but i can't
control the photos width and height, it takes it as it is stored in
drupal module what i should do.
furthermore i specified it in my configuration, but it isn't
applied but the scroll property  is  applied right... why?!!!

jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
scroll: 3,
itemwidth : 100,
itemheight : 80
});
});
Thanks for your support,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
jQuery (English) group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] slideDown of dd containing a script crashes ie6/ie7: jQuery 1.1.3.1

2007-08-29 Thread Rebecca Murphey

[apologies if this is a dupe -- i've tried posting this twice via the
web interface, and still don't see it.]

i have a piece of code that makes it so when you click on a dt, it
reveals the sibling dd using the slideDown effect. this seems to work
fine except one one dt/dd -- in that case, clicking on the dt crashes
ie6 and ie7 (on separate computers). i've traced the problem to a
script that appears at the end of the dd; this script document.writes
a div of content to the page. this script is from an external source
and can't be modified.

other notes:

- if i replace slideDown with fadeIn, it works fine
- if i remove the script from the dd, it works fine

here is my code. please point out anything else i'm doing wrong too :)
(i know the accordion plugin could work here, but first i need to get
the designer to modify his html a bit.)

var rightColItems = $('dt',rightCol);
rightColItems.each(function() {
  $(this).css({ cursor: 'pointer' });
  $(this).click(function() {
if ($(this).next('dd').is(':hidden')) {
  $('#right-col dd:visible').each(function() { $
(this).slideUp(); });
  $(this).next('dd').slideDown();
}
  });
});


thanks,
-rebecca


[jQuery] Re: jQuery beginer in search of magic...

2007-08-29 Thread Yannick Schall

I must say that as i'm learning javascript and jquery in parallel so  
it's a bit confusing.
I did a bit of javascript before and jQuery is so different that it  
is difficult for me to get in the right mind set.
Well it's not like I'm especially good with javascript either i  
always end up making my life complicated.

anyway, thanks for that, I'll be working with it.

i want to use some xhmlhttprequest to animate the background of the  
rows in my galleries like on my current page:

http://kosmonot.bl1nd.com

then when the image is loaded show the picture with the animation.

BUT

don't tell me anything yet...

  i have to try a bit at first, that's part of the learning process.

I'll come back to you to submit my code to your expertise when i'm done.
which will probably be in 10 time more times that it would take you  
to do it. (and that's probably a minimum)

thanks again Glen




[jQuery] Graceful degradation (Safari 2)

2007-08-29 Thread [EMAIL PROTECTED]

I love jquery, the only issue I have is the non-graceful degradation
of some methods with mainly Safari Ver  2.
I understand this browser is outdated, and perhaps the worst browser
out there, but my colleagues at work still use it.
If some of the features of jquery are not available for safari 1x, why
not make it degrade gracefully?
For instance, I want to show() a division layer, that has set
display:none.
If safari 1x does not support the opacity effects, then why not
degrade to simply changing the container style to display:block,
instead of returning and doing nothing?
I think this would be a great advantage if jquery could do this, i
would like to know why jquery does not support graceful degradation.
Thank you for any comments.



[jQuery] Re: How to add content here?

2007-08-29 Thread Frank Peterson

It was on ajaxian awhile back, i cant find it but go through every
article in the last 2 months and u should find it, please post it if
you find it, i shoudl of bookmarked it :p

http://ajaxian.com/



[jQuery] Re: AJAX and Http Response Codes

2007-08-29 Thread Mike Alsup

You can use a complete handler instead of a success handler:

$.ajax({
url: 'myPage.jsp',
complete: function(xhr, status) {
// the status arg is either success, error or timeout
// status codes can be retrieved from the xhr
alert(xhr.status);
}
};

Mike

On 8/28/07, oravecz [EMAIL PROTECTED] wrote:

 Is there a more raw form of .ajax (or get, .post) that will expose
 the XHR method to the success (or error) handler?

 I am attempting to convert an application to jQuery that has a
 proprietary server module that uses a wide range of HTTP status codes
 for certain nuances on the client.

 I notice that the XHR is returned when an ajax method is invoked:

 var xhr = $.get(uri, options.parameters, options.onSuccess, 'xml');

 I suppose I could create a new class that encapsulates the ajax call
 and makes the XHR method available as a private variable. If I provide
 my own onSuccess handler proxy, I could gain access to the XHR
 variable and pass it along. I am hoping that jQuery or a plugin may
 have already taken care of this.




[jQuery] Re: Live Query with Draggables

2007-08-29 Thread Brandon Aaron
The ID shouldn't be necessary at all ... it just provides some context to
make the selector faster. I'll try out your example soon to see if I can
spot the issue.

--
Brandon Aaron

On 8/28/07, Theodore Ni [EMAIL PROTECTED] wrote:

 I know exactly what you mean, and it makes perfect sense, and now going
 back to Firefox, it works like a charm. Normally that would be enough for
 me, but this needs to run in the exploder :-(

 Ok, I've gone back and tried to recreate this example, and you are right,
 the selector works if I add in an id, such as

 $('#containerID form.client').livequery(...);

 Why is that? I had hoped to be able to use just $('form.client') [or $('
 form.ajax') for some other forms] because it requires some extra work to
 get the id of the containing element. I have a custom Window class
 which creates new IDs automatically as new windows are made, so it isn't set
 in stone.

 And it seems Draggable doesn't even need to be registered as a plugin
 since it probably deletes whatever cloned node it made after the drag is
 over.

 Thanks for the great help. At least I now know what the problem seems to
 be.

 Ted


 On 8/28/07, Brandon Aaron [EMAIL PROTECTED]  wrote:
 
  Just use Live Query to bind the submit handler. It will only bind it
  once per a new form element.
 
  $(' form.client').livequery('submit', function() { alert('boo'); return
  false; });
 
  Also, try to give the selector more scope, like a parent element with an
  ID.
 
  $('#containerID form.client ').livequery(...);
 
  Could you upload an example somewhere that we could see?
 
  --
  Brandon Aaron
 
  On 8/28/07, Theodore Ni [EMAIL PROTECTED] wrote:
  
  
   That sounds like it should work, but it isn't doing anything. I think
   there must be something wrong with my fundamental understanding of how
  
   jQuery or the plugins work.
  
   Suppose I try this:
  
   $(' form.client').livequery(function() {
   //alert('new: ' + $(this).parent().attr('id'));
   $(this).unbind('submit');
   $(this).submit(function() { alert('boo'); return false; });
   }, function() { alert('removed'); });
  
   After dragging, I get no alerts on form submission, and the return
   false is not working either. Oddly, if I comment out the unbind()
   statement, then the functions layer on top of one another, so I get
   progressively more and more alerts after every drag operation.
  
   I was able to directly work with the form's onsubmit, which doesn't
   layer, so this isn't a problem, but I am using the AJAX form plugin as
  
   well, and that doesn't work very well.
  
   It is worth nothing that the new and remove alerts show up once at the
   beginning of a drag and at the end of one, as you would expect.
  
   Unfortunately, I just don't know enough about either plugin to figure
   out what is going wrong, and I'm not very familiar with Firebug :-(
  
   I'm grateful for any help you guys can give me.
  
   On 8/28/07, Brandon Aaron [EMAIL PROTECTED]  wrote:
I'm not very familiar with the Interface library but it looks like
   the
Draggable code clones the element using native DOM methods. Try
   registering
the Draggable plugin via the registerPlugin method (
http://brandonaaron.net/docs/livequery/#plugin-developers) like
   this:
   
$.livequery.registerPlugin(Draggable);
   
Now Live Query will know to watch for changes created by the
   Draggable code.
   
--
Brandon Aaron
   
On 8/28/07, Theodore Ni [EMAIL PROTECTED]  wrote:


 Hey guys,

 I'm having a spot of trouble combining live query with interface
 draggables, and I'm afraid I don't have the time to study the
 internals of both plugins (I'm in midst of trying to meet a
   deadline),
 so I hope you guys can briefly explain how both work.

 When I am dragging something, does it move the original element or
  
 does it clone it and then move it? For Live Query, how does it
 determine when something new is added to the DOM?

 I ask because I have been having trouble using live query with
   forms
 in draggable DHTML windows. I attach functions to the forms on
   submit
 using live query (because I put the name of the callback function
   in a
 hidden field inside the form), and the forms don't always work
   after
 they are dragged.

 Thanks,
 Ted


   
  
  
   --
   Ted
  
 
 


 --
 Ted


[jQuery] Re: AJAX and Http Response Codes

2007-08-29 Thread Andy Matthews

I believe that the .ajax method returns the raw status code.

Check: http://jquery.com/api/

andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of oravecz
Sent: Tuesday, August 28, 2007 9:31 PM
To: jQuery (English)
Subject: [jQuery] AJAX and Http Response Codes


Is there a more raw form of .ajax (or get, .post) that will expose the XHR
method to the success (or error) handler?

I am attempting to convert an application to jQuery that has a proprietary
server module that uses a wide range of HTTP status codes for certain
nuances on the client.

I notice that the XHR is returned when an ajax method is invoked:

var xhr = $.get(uri, options.parameters, options.onSuccess, 'xml');

I suppose I could create a new class that encapsulates the ajax call and
makes the XHR method available as a private variable. If I provide my own
onSuccess handler proxy, I could gain access to the XHR variable and pass it
along. I am hoping that jQuery or a plugin may have already taken care of
this.





[jQuery] Re: New plugin: elementReady

2007-08-29 Thread Benjamin Sterling
Bennett,
That will be a very useful plugin for sure, I am already thinking of where I
can add it to existing code.

Really nice work.

Ben

On 8/29/07, Bennett McElwee [EMAIL PROTECTED] wrote:


 I have written a simple but useful jQuery plugin.
 jQuery.elementReady() calls a function during page load as soon as a
 specific element is available -- even before the full DOM is loaded.
 It's useful if you have unobtrusive JavaScript that you want to apply
 to particular page elements immediately, without having to wait for
 the whole DOM to load in a large page.

 Using the elementReady plugin is very similar to the existing
 jQuery.ready() function, except that you must also pass in a string
 representing the ID of the element that should have the function call
 attached.

 The plugin, documentation and more are available at
 http://www.thunderguy.com/semicolon/2007/08/14/elementready-jquery-plugin/

 This is an early version of the plugin. While it works well for me in
 testing (and on this page), it has not been reviewed or exhaustively
 tested. I would appreciate your comments on the idea and the
 implementation.




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


[jQuery] Re: I can't specify the photos width and height

2007-08-29 Thread Benjamin Sterling
Omar,
Is there a live version we can have a look at?

On 8/29/07, Omar101 [EMAIL PROTECTED] wrote:


 Hi,
 I have created a jCarousel photo gallery using drupal, it takes the
 photos dynamically from drupal moduke, its work fine, but i can't
 control the photos width and height, it takes it as it is stored in
 drupal module what i should do.
 furthermore i specified it in my configuration, but it isn't
 applied but the scroll property  is  applied right... why?!!!

 jQuery(document).ready(function() {
 jQuery('#mycarousel').jcarousel({
 scroll: 3,
 itemwidth : 100,
 itemheight : 80
 });
 });
 Thanks for your support,




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


[jQuery] Re: compare two arrays

2007-08-29 Thread Potluri


I know another easy way to do this with only one loop but not in jquery way.
var arrayA=[1,2,3,4,5]
var arrayB=[1,b,c,1,2]
for(var i=0;iarrayA.length;i++)
{
 if(arrayB.indexOf(arrayA[i]) != -1)
 {
   return true;
 }
  return false;
}

Michael Geary wrote:
 
 
 From: Potluri
 
 Is there a jquery way to compare two arrays without looping.
 
 like I have an array1 [a,b,1,2,3]
 and array2 [b,c,d,11 ].
 
 Is there a way like array1.compare(array2). which returns 
 true if atleast one element among the 2 arrays matches.
 
 Somebody has to loop, whether it's you or jQuery. :-)
 
 I don't know of anything built into jQuery, but if all the array elements
 are numbers or strings, it's easy to write a function that should be
 reasonably fast (certainly much faster for long arrays than the obvious
 nested loop solution):
 
function arrayMatch( a, b ) {
   var o = {};
   for( var i = a.length; --i = 0; )
  o[ a[i] ] = true;
   for( var i = b.length; --i = 0; )
  if( o[ b[i] ] )
 return true;
   return false;
}
 
 It may be possible to pick up some extra speed in the case where one array
 is much longer than the other, by choosing the shorter vs. longer array
 for
 each of the two steps. But it's not certain which would be faster - the
 short array in the first loop, or the short array in the second loop. You
 would have to benchmark it in a variety of browsers to know for sure.
 
 If the arrays may contain other kinds of objects (e.g. if a, b, etc. in
 your
 example are object references and not strings or string variables), then
 you'd have to go back to the nested loops instead of the above code.
 
 Now watch somebody make a fool of me and point to a jQuery function for
 this. :-)
 
 -Mike
 
 
 

-- 
View this message in context: 
http://www.nabble.com/compare-two-arrays-tf4344387s15494.html#a12387938
Sent from the JQuery mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
jQuery (English) group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] .value= / .val()

2007-08-29 Thread Enrico

question:

i have following code: why its not possible to write on this way in
the city.value?

$(#zip_code).blur(function(){

var zip = zip_code= + this.value;
$.get(?route=Adress/zipCityLookup, zip, function(xml){
--$(#city).value= $(city, xml).text();

});
});


When i has following code its possible to write on this way in the
zip_code.value
$(#zip_code).blur(function(){

--this.value=4563;

});


Why i must use the .val() function?

$(#zip_code).blur(function(){

var zip = zip_code= + this.value;
$.get(?route=Adress/zipCityLookup, zip, function(xml){
--$(#city).val($(city, xml).text());

});
});



[jQuery] Re: How to use Form Plugin and ValidationAide Plugin

2007-08-29 Thread Massimiliano Marini

 I manage my form with this Form Plugin code:
 $(document).ready(function() { 
   $('#f1').ajaxForm(function() { 
   target: '#response',
   success: function() {
   $('#response').fadeIn('slow');
   }
 }); 

Maybe it help, the call to the plugin for the form validation is
simply : 
$(#f1).validationAideEnable();

But I don't know if both plugin can work together. Any idea?

--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
It's easier to invent the future than to predict it.  -- Alan Kay


[jQuery] Re: How to add content here?

2007-08-29 Thread Karl Swedberg


On Aug 28, 2007, at 11:12 PM, Sagari wrote:



Greetings,

The task: to add content (HTML) exactly at the place where script
was placed, i.e. how do I get the parent of a

scrirpt type=text/javascript src=scriptsource.js/script

-like tag?

I need to use DOM scripting, not document.write().

Thank you!

Konstantin



Hi Konstantin,

To add HTML content immediately following  that script tag, you  
wouldn't need to know the parent element. Instead, you could try  
something like this:


$('[EMAIL PROTECTED]').after('divYour HTML/div');

That particular example (using a div) would only work if the script  
tag is in the body, though.


To find the parent of that script, you could do this:

$('[EMAIL PROTECTED]').parent();


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




[jQuery] Re: how to add jQ$ to be same as $ ?

2007-08-29 Thread David Duymelinck

You can use the noConfict method for that:

http://docs.jquery.com/API/1.1.2/Core#.24.noConflict.28.29

As of 1.1.4 you can add the jquery functionality to your current library
using the argument true

http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-for-12/


-- David

Max schreef:
 Hello there,
 I want to place jQ$ to be same as $ and/or jQuery.
 just than, I can use jQ$ in case of jQuery when using with other js
 framework and $() is defined.
 who can add this and pack it for me.
 I don't know how the original pack file is to be packed. It is more
 smore at size than what I pack using packer at 
 http://dean.edwards.name/packer/.

 thanx for your help.


   


-- 
David Duymelinck

[EMAIL PROTECTED]



[jQuery] Re: .value= / .val()

2007-08-29 Thread Mike Alsup

 Why i must use the .val() function?

Because value is not a property on the jQuery object.  It is a
property on the DOM element.

// use jQuery val method:
$(#city).val($(city, xml).text());

// use DOM element value property:
$(#city)[0].value = $(city, xml).text();

Mike


[jQuery] Re: removeClass from *any* element

2007-08-29 Thread Scott Sauyet


Erik Beeson wrote:

On 8/28/07, Shelane [EMAIL PROTECTED] wrote:

[ ... ]  I want to be able to globally remove the class from any
and all elements on my page within a specific div tag.  Is there a
wildcard selector or some other way to do this:


$('#mydiv *').removeClass('RedText');


I wonder how that would benchmark against my initial thought of

$(#mydiv .RedText).removeClass(RedText);

Obviously it would depend on how many hits there are in #mydiv.  Just 
curious, although not enough so to actually set up a test.  :-)


  -- Scott



[jQuery] Jcarousel fadeIn and fadeOut

2007-08-29 Thread Mario Moura
Hi Folks

I am impress how jcarousel is easy to setup.
http://sorgalla.com/projects/jcarousel/#Configuration

Congratulations Jan.

If  I am using scroll: 1,

I dont like of scroll effect (right to left) and I prefer use fadeIn and
FadeOut between images.

Is it possible? How?

Regards

-- 
Mário


[jQuery] jQuery and dynamic image album, possible?

2007-08-29 Thread Steve Finkelstein

Well, I'm sure it's possible, but I'm a newb and could use veteran
advice. :-)

I have a form which dynamically finds photos upon each GET of the
page. So the photos in one page refresh might be different from
another depending on actions the user has taken. Here's a sample:

http://stevefink.net/photosamp.png

(yes I know its pictures of jewelry with cars.com/autotrader.com
checkboxes, I don't have as many vehicle photos as jewelry photos in
my archives. :P )

Anyhow, is there any util I can use to display these dynamically
loaded images predefined in a serverside array in a neat jquery album/
plugin of some sort? I'd rather do that than embed the img in anchor
tags with the original size photo (these are thumb nails).

Inline loading of images would be ideal, nothing too fancy!

Thank you all, so much!

- sf



[jQuery] Re: jQuery 1.1.4: Faster, More Tests, Ready for 1.2

2007-08-29 Thread Pops



On Aug 28, 6:17 pm, digitarald [EMAIL PROTECTED] wrote:

 The easiest fix, instead of using a
 periodical checker which seems kind of weird on the first blush, is to
 avoid closures during coding ...

Just for clarfication.

The idea of polling for non-atomic states is a Sync 101 violation.
There are numerous classic examples in the books to illustrate it and
if you don't this long enough, it tends you bite you eventually

The idea of serializing an asychronous capable protocol is not.

This is par for the course - iff you create your own I/O thread
handlers.

So the wierd thing is the justifcation - to cure a bug (related to
JS/User Agent clean up issues).

It would not be a wierd thing is they simply said

  Due to the varying behavior of the XHR protocol, from OS to OS,
from
   browser to browser, we are Single Sourcing a consistent API
   design behavior for jQuery $.ajax() method.

which is a 100% PERFECTLY SOUND JUSTIFICATION.

The problem is that the 13ms doesn't SINGLE SOURCE it anymore. :-)

Change the 13ms to 1ms and now you single source it.   I believe John
acknowledge that much.

But I still think it is wrong to remove the XHR callback behavior.  As
an option, that needs to be added back into jQuery.

Anyway,  I have working on my own plugin for $.ajax() and I proved you
can do it both ways without the leaks.  But I really hate changing 3rd
APIs - it defeats the purpose. :-)

I can perfectly see John's delima here because he lumped and tied in
so many other ideas, that making a change will most like cause
something to be broken.

So far I have not seen it.  but I want to do more testing with some of
the other ajaxSettings.

--
HLS



[jQuery] Re: tablesorter 2.0: problems with multiple rows in thead

2007-08-29 Thread tlphipps

E-mail has been sent.  For others who may be interested, the test page
is at: http://www.garethphipps.com/tablesorttest/index.html

Thanks for looking into this!

On Aug 28, 3:36 pm, Christian Bach [EMAIL PROTECTED]
wrote:
 Hi Travis,

 Would it be possible to send me a test-case of your table, off-list?

 Makes spotting the bug easier for me.

 Regards
 Christian

 2007/8/28, tlphipps [EMAIL PROTECTED]:



  Tablesorter 2.0 rocks!  But I think I've uncovered a bug.

  I have a table with two rows in the thead section, but the
  tablesorter doesn't work on this table.  I've narrowed the issue down
  to the checkCellColSpan() function.  If I bypass that function, then
  everything works correctly.  I've discovered that the arr.push (line
  302) command is never executed if there is more than one tr in the
  thead of the table.  Also, I can't figure out why the call to this
  function at line 268 includes 4 parameters when the function only uses/
  needs 3.  I'm definitely not a javascript guru, so any help or insight
  that you all can provide would be greatly appreciated.

  FWIW, my table does NOT use colspans in the thead, so I don't need
  that function, but if there's an official fix for this I would prefer
  that instead of creating a customized version of the tablesorter for
  my needs.



[jQuery] Release: Accordion 1.5

2007-08-29 Thread Erin Doak
Yes, the error persists after restart. Also in Opera, where I don't 
have a javascript debugger, the menu after the click is no longer 
responsive. This seems to indicate that there is a problem in this 
browser too.


Firebug has a tendency to say that every once in a while. Restart 
Firefox and see if it still has the error.


--
Brandon Aaron

On 8/29/07, Erin Doak 
mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote:



It's late and maybe I'm wrong but there seems to be an infinite
recursion error (Firebug says too much recursion) when multiple dd
tags are used inside a dt tag. Maybe the plugin was never meant to be
used with this html structure.

Example: http://rmip.com/accordion/http://rmip.com/accordion/
Top example has the problem. Error occurs on clicking a heading.
The bottom doesn't.

jQuery version is 1.1.4.


Erin


[jQuery] AJAX GetElementByID problem

2007-08-29 Thread Kevin

Hi All,

I'm trying to use an ajax call to call a 2nd page which uses a
getElementByID to set a div's content on that page.  If I just try to
call the 2nd page, I get a js error that I can't run the
getElementByID because it has no properties.  If I change the 2nd page
to be a callback function and call that via the callback function of
jquery it works fine, so it sounds like an order of operations problem
here.  Is there anyway to allow getElementByIDs without forcing them
in a callback function?

Here is my ajax call:
div id=destDiv1
script language=JavaScript
document.getElementById(destDiv1).innerHTML = div align=\center
\img src=\/ajax/ajax-loader.gif\ alt=\Loading...\ //div;
$.ajax({
url: 'j1.html?a=' + Math.random(),
type: 'GET', dataType: 'html', timeout: 6,
error: function(a,b,c){
document.getElementById(destDiv1).innerHTML = 'Error 
loading
channel' + a + | + b + | + c;
},
success: function(thehtml){
// do something with HTML
document.getElementById(destDiv1).innerHTML = thehtml;
}
});
/script
/div

Now the page to be loaded:

div id=blah1/div
script language=JavaScript
alert(hi);
document.getElementById(blah1).innerHTML = stronghi/strong;
/script

This throws the error: TypeError: document.getElementById(blah1) has
no properties

Any ideas?

Thanks!

-Kevin



[jQuery] FCKEditor (to plugin or not to plugin...) newbie struggling again...

2007-08-29 Thread Quayfee

Hi All,

I'm having issues getting the FCKEditor plugin to work inside content
that is loaded through $('#element').load('mysourceFile.php');

If I use the standard PHP method of including FCKEditor the editors
(there are two on the page) are displayed, however when the form is
submited (using $('myForm').ajaxsubmit(options);) only the original
value that is held in the hidden filed is taken.

If I try to use the FCKEditor jquery plugin, nothing other than a
blank textarea is displayed.

I've tried the plugin in a standard web page and all works fine. I'm
sure I'm missing something basic (as always)
If anyone else has got FCHEditor plugin working within content loaded
in the same way and can offer advice or a solution, that would be a
great help.

Cheers

Keith



[jQuery] Select range of table rows

2007-08-29 Thread Stuart

I'm trying to figure out an efficient way to select a range of table
rows. What I'd like to do is select perhaps rows 11 through 19.

I want to have the selector put the desired rows into the jquery
object instead of grabbing all rows and looping through them to
operate only on the ones I want.

I keep thinking something like this where the .not() sets the range.
It seems almost right but I know its not.
var firstRow = 11, lastRow = 19;

$('#myTable tr').not(':lt(' + firstRow + '), :gt(' + lastRow + ')');

I know it's simple I just haven't hit on it yet.



[jQuery] Re: Validation by Jörn Zaefferer - errorPla cement confusion

2007-08-29 Thread Feed

Jörn, did you get to this issue? Sorry to bother you, but currently I
had to disable validation from my forms because of this bug in IE6,
I really want to use it in my project, it is awesome. Thanks in
advance.

On Aug 27, 4:53 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Jörn Zaefferer schrieb:

  Feed schrieb:
  Ok, there seem to be a bug somewhere look:
  [...]
  Conclusion: IE doesn't seem to understand the second .parent() it
  doesn't select the TR. What can I do to fix this?

  Did you check what IE select in that case?

 Sorry, forget that. I'm gonna check it myself.

 -- Jörn



[jQuery] Re: How to add content here?

2007-08-29 Thread Michael Geary

My favorite way to do this is to take advantage of the fact that the the
script tag is the last one in the document at the time that it's executed.
This works with inline scripts as well as .js files.

Try pasting this code into the body of a test document:

Insert text here: {
script type=text/javascript
(function() {

var script = $('script:last');

$(function() {
$(script).after( 'Hello World' );
});

})();
/script
}

But I'm curious: Why can't you use document.write?

-Mike

 From: Sagari

 The task: to add content (HTML) exactly at the place where
 script was placed, i.e. how do I get the parent of a

 scrirpt type=text/javascript src=scriptsource.js/script

 -like tag?

 I need to use DOM scripting, not document.write().



[jQuery] Re: Select range of table rows

2007-08-29 Thread Benjamin Sterling
Stuart, in 1.1.4 you have the slice() method and you can using it like
$('#myTable tr').slice(firstRow, lastRow); keeping in mind that count starts
with 0.

I am working on a plugin that is using it:
http://benjaminsterling.com/experiments/jsGalScroll/common/js/jqGalScroll.jsline
20 and 30.

On 8/29/07, Stuart [EMAIL PROTECTED] wrote:


 I'm trying to figure out an efficient way to select a range of table
 rows. What I'd like to do is select perhaps rows 11 through 19.

 I want to have the selector put the desired rows into the jquery
 object instead of grabbing all rows and looping through them to
 operate only on the ones I want.

 I keep thinking something like this where the .not() sets the range.
 It seems almost right but I know its not.
 var firstRow = 11, lastRow = 19;

 $('#myTable tr').not(':lt(' + firstRow + '), :gt(' + lastRow + ')');

 I know it's simple I just haven't hit on it yet.




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


[jQuery] Re: Select range of table rows

2007-08-29 Thread Klaus Hartl


Stuart wrote:

I'm trying to figure out an efficient way to select a range of table
rows. What I'd like to do is select perhaps rows 11 through 19.

I want to have the selector put the desired rows into the jquery
object instead of grabbing all rows and looping through them to
operate only on the ones I want.

I keep thinking something like this where the .not() sets the range.
It seems almost right but I know its not.
var firstRow = 11, lastRow = 19;

$('#myTable tr').not(':lt(' + firstRow + '), :gt(' + lastRow + ')');

I know it's simple I just haven't hit on it yet.



Have you tried (pre jQuery 1.1.4.):

$('tr').lt(19).gt(10);

If you're using jQuery 1.1.4 you should use the new slice method:

$('tr').slice(10, 18);

(not sure about the correct numbers right now)



--Klaus


[jQuery] Re: Select range of table rows

2007-08-29 Thread Stuart

Yeah.I think I remember reading about the slice method in the
change log. I am using 1.1.4 so I should be set. The API doesn't list
it yet so thanks for the code snippet.

Thanks Benjamin!

On Aug 29, 11:58 am, Benjamin Sterling
[EMAIL PROTECTED] wrote:
 Stuart, in 1.1.4 you have the slice() method and you can using it like
 $('#myTable tr').slice(firstRow, lastRow); keeping in mind that count starts
 with 0.

 I am working on a plugin that is using 
 it:http://benjaminsterling.com/experiments/jsGalScroll/common/js/jqGalSc...
 20 and 30.

 On 8/29/07, Stuart [EMAIL PROTECTED] wrote:





  I'm trying to figure out an efficient way to select a range of table
  rows. What I'd like to do is select perhaps rows 11 through 19.

  I want to have the selector put the desired rows into the jquery
  object instead of grabbing all rows and looping through them to
  operate only on the ones I want.

  I keep thinking something like this where the .not() sets the range.
  It seems almost right but I know its not.
  var firstRow = 11, lastRow = 19;

  $('#myTable tr').not(':lt(' + firstRow + '), :gt(' + lastRow + ')');

  I know it's simple I just haven't hit on it yet.

 --
 Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com



[jQuery] Re: Select range of table rows

2007-08-29 Thread Benjamin Sterling
Np, glad I can help.


On 8/29/07, Stuart [EMAIL PROTECTED] wrote:


 Yeah.I think I remember reading about the slice method in the
 change log. I am using 1.1.4 so I should be set. The API doesn't list
 it yet so thanks for the code snippet.

 Thanks Benjamin!

 On Aug 29, 11:58 am, Benjamin Sterling
 [EMAIL PROTECTED] wrote:
  Stuart, in 1.1.4 you have the slice() method and you can using it like
  $('#myTable tr').slice(firstRow, lastRow); keeping in mind that count
 starts
  with 0.
 
  I am working on a plugin that is using it:
 http://benjaminsterling.com/experiments/jsGalScroll/common/js/jqGalSc...
  20 and 30.
 
  On 8/29/07, Stuart [EMAIL PROTECTED] wrote:
 
 
 
 
 
   I'm trying to figure out an efficient way to select a range of table
   rows. What I'd like to do is select perhaps rows 11 through 19.
 
   I want to have the selector put the desired rows into the jquery
   object instead of grabbing all rows and looping through them to
   operate only on the ones I want.
 
   I keep thinking something like this where the .not() sets the range.
   It seems almost right but I know its not.
   var firstRow = 11, lastRow = 19;
 
   $('#myTable tr').not(':lt(' + firstRow + '), :gt(' + lastRow + ')');
 
   I know it's simple I just haven't hit on it yet.
 
  --
  Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com




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


[jQuery] Re: I can't specify the photos width and height

2007-08-29 Thread Justin Sepulveda

http://sorgalla.com/projects/jcarousel/#Configuration

itemwidth and itemheight aren't properties of this plugin?

On Aug 29, 6:27 am, Benjamin Sterling
[EMAIL PROTECTED] wrote:
 Omar,
 Is there a live version we can have a look at?

 On 8/29/07, Omar101 [EMAIL PROTECTED] wrote:





  Hi,
  I have created a jCarousel photo gallery using drupal, it takes the
  photos dynamically from drupal moduke, its work fine, but i can't
  control the photos width and height, it takes it as it is stored in
  drupal module what i should do.
  furthermore i specified it in my configuration, but it isn't
  applied but the scroll property  is  applied right... why?!!!

  jQuery(document).ready(function() {
  jQuery('#mycarousel').jcarousel({
  scroll: 3,
  itemwidth : 100,
  itemheight : 80
  });
  });
  Thanks for your support,

 --
 Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com



[jQuery] Re: Select range of table rows

2007-08-29 Thread Benjamin Sterling
Klaus, you are correct.  Had a hard time keeping it straight last night, but
if you want to start at the 11th row, you would start at 10 and if you
wanted to end at the 19th row, you would use 18.

On 8/29/07, Klaus Hartl [EMAIL PROTECTED] wrote:


 Stuart wrote:
  I'm trying to figure out an efficient way to select a range of table
  rows. What I'd like to do is select perhaps rows 11 through 19.
 
  I want to have the selector put the desired rows into the jquery
  object instead of grabbing all rows and looping through them to
  operate only on the ones I want.
 
  I keep thinking something like this where the .not() sets the range.
  It seems almost right but I know its not.
  var firstRow = 11, lastRow = 19;
 
  $('#myTable tr').not(':lt(' + firstRow + '), :gt(' + lastRow + ')');
 
  I know it's simple I just haven't hit on it yet.


 Have you tried (pre jQuery 1.1.4.):

 $('tr').lt(19).gt(10);

 If you're using jQuery 1.1.4 you should use the new slice method:

 $('tr').slice(10, 18);

 (not sure about the correct numbers right now)



 --Klaus




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


[jQuery] Re: AJAX GetElementByID problem

2007-08-29 Thread Glen Lipka
Where is the jQuery?

Glen

On 8/29/07, Kevin [EMAIL PROTECTED] wrote:


 Hi All,

 I'm trying to use an ajax call to call a 2nd page which uses a
 getElementByID to set a div's content on that page.  If I just try to
 call the 2nd page, I get a js error that I can't run the
 getElementByID because it has no properties.  If I change the 2nd page
 to be a callback function and call that via the callback function of
 jquery it works fine, so it sounds like an order of operations problem
 here.  Is there anyway to allow getElementByIDs without forcing them
 in a callback function?

 Here is my ajax call:
 div id=destDiv1
 script language=JavaScript
 document.getElementById(destDiv1).innerHTML = div
 align=\center
 \img src=\/ajax/ajax-loader.gif\ alt=\Loading...\ //div;
 $.ajax({
 url: 'j1.html?a=' + Math.random(),
 type: 'GET', dataType: 'html', timeout: 6,
 error: function(a,b,c){
 document.getElementById(destDiv1).innerHTML =
 'Error loading
 channel' + a + | + b + | + c;
 },
 success: function(thehtml){
 // do something with HTML
 document.getElementById(destDiv1).innerHTML =
 thehtml;
 }
 });
 /script
 /div

 Now the page to be loaded:

 div id=blah1/div
 script language=JavaScript
 alert(hi);
 document.getElementById(blah1).innerHTML = stronghi/strong;
 /script

 This throws the error: TypeError: document.getElementById(blah1) has
 no properties

 Any ideas?

 Thanks!

 -Kevin




[jQuery] Re: AJAX and Http Response Codes

2007-08-29 Thread Pops



On Aug 28, 10:30 pm, oravecz [EMAIL PROTECTED] wrote:
 Is there a more raw form of .ajax (or get, .post) that will expose
 the XHR method to the success (or error) handler?

The current XHR protocol only has a nreadystatechange handler. I'm not
up to par on how the W3.ORG working groups procedure is done (I'm more
familar IETF),  I believe there is a working draft is extending the
protocol with more callback handlers such onSuccess, OnError, etc.
The current release does not have these.

However, jQuery emulates these similar callbacks based on the state of
the XHR.

 I am attempting to convert an application to jQuery that has a
 proprietary server module that uses a wide range of HTTP status codes
 for certain nuances on the client.

Same here.

If all you want is the status code, Mike's suggestion is good enough.

 I notice that the XHR is returned when an ajax method is invoked:

 var xhr = $.get(uri, options.parameters, options.onSuccess, 'xml');

 I suppose I could create a new class that encapsulates the ajax call
 and makes the XHR method available as a private variable.

It does return the XHR object, but it begins running at that moment.

You can do something like this as a quick monitor:

 var xhr = $.get(uri, options.parameters, options.onSuccess, 'xml');
 var iTimer = 0;

 function monitor()  {
   if (xhr.readyState) {
  log(state: +xml.readyState);
  if (xhr.readyState == 4) {
clearInterval(iTimer);
return;
 }
  }
  }
  iTimer =  setInterval(monitor, 1);

If you are not familar with the JS memory model, this works because
the xhr and iTimer variables are global to the inline function
monitor()

 If I provide
 my own onSuccess handler proxy, I could gain access to the XHR
 variable and pass it along. I am hoping that jQuery or a plugin may
 have already taken care of this.

well, Mike's answer shows that the the internal complete() callback
does pass the object to you, so you can use that.

But  overall there are things that jQuery removed from the XHR
protocol functionality that limits applications.

For example,

1) for us a 403 is not necessarily an ERROR.

2) There are designs where you want to get state 2 or 3, These are
lost via JQuery. You only get state 1 and 4 which is perfect for most
simple AJAX calls.   If you use the above monitor() you will see this.

3) It doesn't have a built-in monitor that allows you to do things
you might need in 2.

4) It depends on a timer polling concept to watch the current XHR
state.

and a few other goodies.

Anyway, I'm working on a plug-in replacement and if you are
interested, I am going to need a few beta testers.  So  if interested,
keep an eye on any announcement I make here.

--
HLS



[jQuery] [OT] NEWS: AjaxRain Updates

2007-08-29 Thread Karl Swedberg

Hey everyone,

Looks like ajaxrain.com has gone through some changes, with a bunch  
of new features:


* Storing favorites
* Comments
* Voting on entries
* Date that a submission was posted
* Enhanced search
* Expansion into posting RIA components based on SilverLight  Flex

And they're still churning out the entries, with over 600 submissions.

See the announcement over at Ajaxian:
http://ajaxian.com/archives/ajaxraincom-gets-a-facelift-tops-600- 
ajaxjsria-controls



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





[jQuery] Re: [OT] NEWS: AjaxRain Updates

2007-08-29 Thread Tane Piper

And out of those 600 submissions, the highest percentage of
submissions are for jQuery with well over 100 plugins and scripts
available - beating the nearest library by miles :)


On 29/08/2007, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hey everyone,

 Looks like ajaxrain.com has gone through some changes, with a bunch
 of new features:

  * Storing favorites
  * Comments
  * Voting on entries
  * Date that a submission was posted
  * Enhanced search
  * Expansion into posting RIA components based on SilverLight  Flex

 And they're still churning out the entries, with over 600 submissions.

 See the announcement over at Ajaxian:
 http://ajaxian.com/archives/ajaxraincom-gets-a-facelift-tops-600-
 ajaxjsria-controls


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






-- 
Tane Piper
http://digitalspaghetti.me.uk

This email is: [ ] blogable [ x ] ask first [ ] private


[jQuery] ie lost selection in textarea

2007-08-29 Thread Amir.Mamedov

use 2 plugins
fieldSelection and jqModal

how save selected state of textarea when i lost focus on field and
revert when i need to use them?



[jQuery] Can get the jqUploader Flash swf to appear in IE7 - ActiveX workaround won't work

2007-08-29 Thread reto

The Demo doesn't work either in IE7.

http://www.pixeline.be/experiments/jqUploader/

I have tried:

1.jquery uncompressed (Doesn't the problem only occurs with the
compressed version?
2.query compressed with and without the patch



If the plug in doesn't work in IE7 it is basically useless.

Can anybody report the current status of the bug? Has the author given
up on this since the plugin hasn't been updated for a long time?

Thanks



[jQuery] Re: how to add jQ$ to be same as $ ?

2007-08-29 Thread Max

that's very nice.
thanks.

On Aug 29, 10:24 pm, David Duymelinck [EMAIL PROTECTED] wrote:
 You can use the noConfict method for that:

 http://docs.jquery.com/API/1.1.2/Core#.24.noConflict.28.29

 As of 1.1.4 you can add the jquery functionality to your current library
 using the argument true

 http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-...

 -- David

 Max schreef:

  Hello there,
  I want to place jQ$ to be same as $ and/or jQuery.
  just than, I can use jQ$ in case of jQuery when using with other js
  framework and $() is defined.
  who can add this and pack it for me.
  I don't know how the original pack file is to be packed. It is more
  smore at size than what I pack using packer 
  athttp://dean.edwards.name/packer/.

  thanx for your help.

 --
 David Duymelinck
 
 [EMAIL PROTECTED]



[jQuery] Re: .value= / .val()

2007-08-29 Thread Enrico

thank you mike,
for your answer...now i understand it.

best wishes,
Enrico



[jQuery] jQuery 1.1.4 incompatible with Interface 1.2

2007-08-29 Thread henry

When I use Sortables with fx:n ,

Firefox firebug output:

--
jQuery.easing[options.easing] is not a function

z.now = jQuery.easing[options.easing](p, n, firstNum, (lastNum-
firstNum, options.durations);

jquery.js (line 5214)
--

According to the following thread, this bug should have been fixed in
1.1.4 :
http://groups.google.com/group/jquery-en/browse_thread/thread/561619139c498172/1a78636e644db437


Help?



[jQuery] Re: null vs Vriables containing null

2007-08-29 Thread Michael Geary

 From: Pops
 
 This might be slightly off topic, a javascript script 
 question, but its being applied to jQuery. :-)
 
 Ok, there is a different in other languages when you do this:
 
var p = null;
xyz(null);
xyx(p);
 
 It depends on the function prototype and how a language binds 
 to the function..
 
 In JavaScript, what is passed to the function xyz:
 
 The address of p or the value of p.

Object, Array, and Function arguments are passed by reference; other types
such as Number and String are passed by value.

null is an Object and is passed by reference. (There is only one null
object.)

In your example, the two calls to xyz() are identical. Both pass the same
null object into the function.

 I ask because in the jQuery XHR implementation, it has this
 
  xml.send(s.data);
 
 And s.data is set to null if s.type is get
 
 So I am wondering if it safe to assume the user's agent 
 external prototype for send() expects:
 
 -   an asciiz string
 
 -   OLE string (like BSTR) like its normally done in 
 Windows's OLE/
 ActiveX/COM/DCOM
 RPC interfacing

The standard calls for the argument to send() to be a DOMString, a Document,
null, or omitted. Any other type is converted to a DOMString if possible,
otherwise treated as null:

http://www.w3.org/TR/XMLHttpRequest/#dfn-send

 Of course, if you are not sure, its always to be safe and do:
 
xml.send(( s.type.toLowerCase() == get )?null:s.data);

Just as in your xyz() example, if s.data is null, then these two calls are
identical:

   xml.send( null );
   xml.send( s.data );

So the extra code isn't necessary.

-Mike



[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Jeroen Coumans

Thanks for the explanation, that makes sense. But this is not how the
CSS spec has it defined. You can see that in my test file where the
CSS rule is only applied to the top list items.

The question is; is the jQuery behaviour a bug or a feature? And if
it's a feature, it should be documented.

Jeroen

On Aug 29, 2:01 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 Because you are binding the click event to the a tag, not the li. So what
 your saying is get all the a tags within each li (which is all the a tags in
 your ul). You just need one more child selector in there between the li and
 a to make sure you only select the immediate a tags of the li only ...
 instead of all the a tags within the li.

 $('#test  li  a').click(...);

 --
 Brandon Aaron

 On 8/29/07, Jeroen Coumans [EMAIL PROTECTED] wrote:



  Hi,

  See http://lab.jeroencoumans.nl/jquery/child-selector.html
  It's my understanding that child selectors only select direct children
  of an element. Thus, $('#test  li') should only select direct
  descendent li elements of #test, not nested li's. This is
  confirmed with a simple CSS rule. So how come, when I attach a click
  event to a direct child, it seems to attach itself to all
  descendents?

  Regards, Jeroen



[jQuery] Re: null vs Vriables containing null

2007-08-29 Thread Pops

Thanks mike

On Aug 29, 3:21 pm, Michael Geary [EMAIL PROTECTED] wrote:
  From: Pops

  This might be slightly off topic, a javascript script
  question, but its being applied to jQuery. :-)

  Ok, there is a different in other languages when you do this:

 var p = null;
 xyz(null);
 xyx(p);

  It depends on the function prototype and how a language binds
  to the function..

  In JavaScript, what is passed to the function xyz:

  The address of p or the value of p.

 Object, Array, and Function arguments are passed by reference; other types
 such as Number and String are passed by value.

 null is an Object and is passed by reference. (There is only one null
 object.)

 In your example, the two calls to xyz() are identical. Both pass the same
 null object into the function.

  I ask because in the jQuery XHR implementation, it has this

   xml.send(s.data);

  And s.data is set to null if s.type is get

  So I am wondering if it safe to assume the user's agent
  external prototype for send() expects:

  -   an asciiz string

  -   OLE string (like BSTR) like its normally done in
  Windows's OLE/
  ActiveX/COM/DCOM
  RPC interfacing

 The standard calls for the argument to send() to be a DOMString, a Document,
 null, or omitted. Any other type is converted to a DOMString if possible,
 otherwise treated as null:

 http://www.w3.org/TR/XMLHttpRequest/#dfn-send

  Of course, if you are not sure, its always to be safe and do:

 xml.send(( s.type.toLowerCase() == get )?null:s.data);

 Just as in your xyz() example, if s.data is null, then these two calls are
 identical:

xml.send( null );
xml.send( s.data );

 So the extra code isn't necessary.

 -Mike



[jQuery] Re: How to use Form Plugin and ValidationAide Plugin

2007-08-29 Thread Jörn Zaefferer


Massimiliano Marini schrieb:

I manage my form with this Form Plugin code:
$(document).ready(function() { 
	$('#f1').ajaxForm(function() { 
		target: '#response',

success: function() {
$('#response').fadeIn('slow');
}
}); 



Maybe it help, the call to the plugin for the form validation is
simply : 
	$(#f1).validationAideEnable();


But I don't know if both plugin can work together. Any idea?
  
There is an example for integration with the form plugin: 
http://jquery.bassistance.de/validate/demo-test/ajaxSubmit-intergration-demo.html


There is certainly room to improve that example...

The  interesting code is this:

var v = jQuery(#form).validate({
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
dataType: json,
after: function(result) {
if(result.status) {

v.showErrors(result.data);
v.focusInvalid();
}   
}
});
}
});


-- Jörn


[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Brandon Aaron
Actually it works this way in the CSS Spec also and your test file proves
it. Just use this selector instead of your other selector:

#test  li a

--
Brandon Aaron

On 8/29/07, Jeroen Coumans [EMAIL PROTECTED] wrote:


 Thanks for the explanation, that makes sense. But this is not how the
 CSS spec has it defined. You can see that in my test file where the
 CSS rule is only applied to the top list items.

 The question is; is the jQuery behaviour a bug or a feature? And if
 it's a feature, it should be documented.

 Jeroen

 On Aug 29, 2:01 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
  Because you are binding the click event to the a tag, not the li. So
 what
  your saying is get all the a tags within each li (which is all the a
 tags in
  your ul). You just need one more child selector in there between the li
 and
  a to make sure you only select the immediate a tags of the li only ...
  instead of all the a tags within the li.
 
  $('#test  li  a').click(...);
 
  --
  Brandon Aaron
 
  On 8/29/07, Jeroen Coumans [EMAIL PROTECTED] wrote:
 
 
 
   Hi,
 
   See http://lab.jeroencoumans.nl/jquery/child-selector.html
   It's my understanding that child selectors only select direct children
   of an element. Thus, $('#test  li') should only select direct
   descendent li elements of #test, not nested li's. This is
   confirmed with a simple CSS rule. So how come, when I attach a click
   event to a direct child, it seems to attach itself to all
   descendents?
 
   Regards, Jeroen




[jQuery] Re: Validation by Jörn Zaefferer - errorPla cement confusion

2007-08-29 Thread Jörn Zaefferer


Feed schrieb:

Jörn, did you get to this issue? Sorry to bother you, but currently I
had to disable validation from my forms because of this bug in IE6,
I really want to use it in my project, it is awesome. Thanks in
advance.
  
No, I haven't got around to it. Any help on the actual source of the 
actual problem is highly appreciated...


-- Jörn


[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Brandon Aaron
Whoops :)  that should be:

#test  li  a

That will only select the direct a tags of the LI. Previously you where
selecting all A tags of the LI. Even the A tags within the other child
elements of the LI.

--
Brandon Aaron

On 8/29/07, Brandon Aaron [EMAIL PROTECTED] wrote:

 Actually it works this way in the CSS Spec also and your test file proves
 it. Just use this selector instead of your other selector:

 #test  li a

 --
 Brandon Aaron

 On 8/29/07, Jeroen Coumans [EMAIL PROTECTED] wrote:
 
 
  Thanks for the explanation, that makes sense. But this is not how the
  CSS spec has it defined. You can see that in my test file where the
  CSS rule is only applied to the top list items.
 
  The question is; is the jQuery behaviour a bug or a feature? And if
  it's a feature, it should be documented.
 
  Jeroen
 
  On Aug 29, 2:01 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
   Because you are binding the click event to the a tag, not the li. So
  what
   your saying is get all the a tags within each li (which is all the a
  tags in
   your ul). You just need one more child selector in there between the
  li and
   a to make sure you only select the immediate a tags of the li only ...
 
   instead of all the a tags within the li.
  
   $('#test  li  a').click(...);
  
   --
   Brandon Aaron
  
   On 8/29/07, Jeroen Coumans  [EMAIL PROTECTED] wrote:
  
  
  
Hi,
  
See http://lab.jeroencoumans.nl/jquery/child-selector.html 
It's my understanding that child selectors only select direct
  children
of an element. Thus, $('#test  li') should only select direct
descendent li elements of #test, not nested li's. This is
confirmed with a simple CSS rule. So how come, when I attach a click
event to a direct child, it seems to attach itself to all
descendents?
  
Regards, Jeroen
 
 



[jQuery] Re: $.load(url) and IE fails to find CSS/JS

2007-08-29 Thread John Napiorkowski


--- Michael Lo [EMAIL PROTECTED] wrote:

 Try this
 
 $.get('page.html',function(data){
 ($('#target').html(data);
 });
 
 Michael

The problem seems to be that IE strips script and
style tags on incoming with the xmlrequestobject and
firefox doesn't...

I'm shocked that this issue isn't noticed or discussed
more, but I guess I'm just too new to this to know
these kinds of things.

Does anyone know a way to force this behavior to
change on IE, or do I need to come up with a different
workaround?

If someone assists me I promise to add details to the
wiki someplace obvious.

Thanks!

--John

PS, if we could all try to not top post it will help
us follow long discussion threads!  Thanks!




 
 On 8/24/07, John Napiorkowski [EMAIL PROTECTED]
 wrote:
 
 
 
  --- polyrhythmic [EMAIL PROTECTED] wrote:
 
  
   John,
   What version of jQuery are you running?  And
 what
   are your browser
   versions?  Also, style tags must be placed
 inside
   the head tags.
   jQuery makes it easy to manipulate DOM styles
 from
   AJAX data, but if
   you would like to import styles as inline HTML
 you
   must style each
   invidual element using its style attribute:
   element style=foo: bar; 
  
   Charles
   doublerebel.com
 
  I am using the latest JQuery from the download
 area.
 
  What I have is a full webpage that I am
 dynamically
  injecting some HTML into via $.load(...) and that
  injected bit has a style and script block.  On
 FireFox
  it seems that that scripts and styles get
 activated,
  but on IE is doesn't.  For example if I put a
 
  scriptalert(1)/script
 
  into the injected page, on FF I see the alert when
 the
  page loads, but on IE I don't.
 
  To be honest this is a huge difference in
 behavior, so
  I figure I can't be the only one that ran into the
  trouble.  It looks like JQuery does some sort of
 eval
  if it finds a script tag, but Maybe IE is removing
  them.  Anyway, just trying to figure out If I can
 make
  this work or not.
 
  Thanks for your reply and I hope I've described my
  issue correctly.
 
  --John
 
 
  
   On Aug 22, 9:47 pm, John Napiorkowski
   [EMAIL PROTECTED] wrote:
Hi,
   
I'm sure this is a stupid error on my part but
   it's
driving me crazy.  I have a bit of html that I
   want to
inject into my page like so:
   
$('#target').load('page.html');
   
Now this works, but I find that if 'page.html'
contains a script and style section IE won't
   process
it, but Firefox seems to.  What I mean is that
 if
   the
'pages.html' itself contains some inline
   javascript
than Firefox will execute it but IE doesn't.
   
So for example my 'pages.html' might look like
   (this
is abbreviated, but I think you'll get the
 idea):
   
div id=container
  style
form { ... }
  /style
  script
$()ready({ ... });
  /script
  !-- More html that the above works on --
/div
   
Putting aside for the moment about whether or
 not
inline script sections is a good idea or not,
 does
anyone know why this would work on Firefox
 only
   and is
there any workarounds?  My client's setup
 makes
anything but inline scripting a nightmare, so
 I am
hoping to solve this.  If I can't make this
 work
   I'll
have to us popup windows, so please help me :)
   
I saw something in the docs about $.getScript
   versus
$.get but I didn't see how this could help. 
 The
   only
thing I found was a call to evalScripts in
 the
source, but I couldn't find documentation for
   that, so
I didn't play with it.
   
Thanks!
John Napiorkowski
   
   
  
 
 

Ready
   for the edge of your seat?
Check out tonight's top picks on Yahoo!
   TV.http://tv.yahoo.com/
  
  
 
 
 
 
 
 


  Sick sense of humor? Visit Yahoo! TV's
  Comedy with an Edge to see what's on, when.
  http://tv.yahoo.com/collections/222
 
 



   

Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=listsid=396545433


[jQuery] Re: [OT] NEWS: AjaxRain Updates

2007-08-29 Thread Karl Swedberg

Cool!

And, as has been noted here before, ajaxrain.com itself is powered by  
jQuery.


--Karl


On Aug 29, 2007, at 2:49 PM, Tane Piper wrote:



And out of those 600 submissions, the highest percentage of
submissions are for jQuery with well over 100 plugins and scripts
available - beating the nearest library by miles :)


On 29/08/2007, Karl Swedberg [EMAIL PROTECTED] wrote:

Hey everyone,

Looks like ajaxrain.com has gone through some changes, with a bunch
of new features:

 * Storing favorites
 * Comments
 * Voting on entries
 * Date that a submission was posted
 * Enhanced search
 * Expansion into posting RIA components based on SilverLight  
 Flex


And they're still churning out the entries, with over 600  
submissions.


See the announcement over at Ajaxian:
http://ajaxian.com/archives/ajaxraincom-gets-a-facelift-tops-600-
ajaxjsria-controls


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







--
Tane Piper
http://digitalspaghetti.me.uk

This email is: [ ] blogable [ x ] ask first [ ] private




[jQuery] jQuery form, invalid success label?

2007-08-29 Thread Steve Finkelstein
Hi,

Firebug is reporting success: is an invalid label with the following code:

$(document).ready(function() {
// bind 'form2' and provide a simple callback function
$('#form2').ajaxForm(function() {
// Server should send data back in json encoding
dataType:'json',
success:function() {
alert(DEBUG: Testing.);
}
});
});

Any idea?

-sf


[jQuery] unsubscribe

2007-08-29 Thread carl


unsubscribe


[jQuery] Re: like 'isset'...determining is something exists on the page

2007-08-29 Thread Karl Rudd

The .is() function only tests the first element of a jQuery object.
What you want to do is filter the list and see if there's anything
in it after the filter (or a normal select via $()).

For your example:

if ( $('a#f_' + ide).siblings().filter('img').length )
{
  // do this action
}
else
{
  // do something else
}

Now that test will be true (ie not 0) on HTML like this:

something
  a id=f_something ...Blah/a
  img ...
/something

If you want to check whether a link contains an 'img' then use:

if ( $('a#whatever img').length ) {
  // contains an img
}

Karl Rudd

On 8/29/07, Txt.Vaska [EMAIL PROTECTED] wrote:

 I'm trying to determine if soemthing has been set on the page...and
 if it is do a different action. I have...

 if ($('a#f_' + ide).siblings().is('img'))
 {
// do this action
 }
 else
 {
// do something else
 }

 Which looks to see if an image exists in

 I'm expecting that .is() will return true in some cases but it never
 does.

 Am I going about this entirely the wrong way?

 Thanks



[jQuery] Re: $.load(url) and IE fails to find CSS/JS

2007-08-29 Thread Shelane

Actually, this has been discussed quite a bit.

http://groups.google.com/group/jquery-en/browse_thread/thread/6722e380538892b9/

I did manage to get scripts working properly in IE, with some trick
that John Resig told me to try.  Look at the code I have in my
examples pack:
http://education.llnl.gov/jquery/

On Aug 29, 12:41 pm, John Napiorkowski [EMAIL PROTECTED] wrote:
 --- Michael Lo [EMAIL PROTECTED] wrote:

  Try this

  $.get('page.html',function(data){
  ($('#target').html(data);
  });

  Michael

 The problem seems to be that IE strips script and
 style tags on incoming with the xmlrequestobject and
 firefox doesn't...

 I'm shocked that this issue isn't noticed or discussed
 more, but I guess I'm just too new to this to know
 these kinds of things.

 Does anyone know a way to force this behavior to
 change on IE, or do I need to come up with a different
 workaround?

 If someone assists me I promise to add details to the
 wiki someplace obvious.

 Thanks!

 --John

 PS, if we could all try to not top post it will help
 us follow long discussion threads!  Thanks!





  On 8/24/07, John Napiorkowski [EMAIL PROTECTED]
  wrote:

   --- polyrhythmic [EMAIL PROTECTED] wrote:

John,
What version of jQuery are you running?  And
  what
are your browser
versions?  Also, style tags must be placed
  inside
the head tags.
jQuery makes it easy to manipulate DOM styles
  from
AJAX data, but if
you would like to import styles as inline HTML
  you
must style each
invidual element using its style attribute:
element style=foo: bar; 

Charles
doublerebel.com

   I am using the latest JQuery from the download
  area.

   What I have is a full webpage that I am
  dynamically
   injecting some HTML into via $.load(...) and that
   injected bit has a style and script block.  On
  FireFox
   it seems that that scripts and styles get
  activated,
   but on IE is doesn't.  For example if I put a

   scriptalert(1)/script

   into the injected page, on FF I see the alert when
  the
   page loads, but on IE I don't.

   To be honest this is a huge difference in
  behavior, so
   I figure I can't be the only one that ran into the
   trouble.  It looks like JQuery does some sort of
  eval
   if it finds a script tag, but Maybe IE is removing
   them.  Anyway, just trying to figure out If I can
  make
   this work or not.

   Thanks for your reply and I hope I've described my
   issue correctly.

   --John

On Aug 22, 9:47 pm, John Napiorkowski
[EMAIL PROTECTED] wrote:
 Hi,

 I'm sure this is a stupid error on my part but
it's
 driving me crazy.  I have a bit of html that I
want to
 inject into my page like so:

 $('#target').load('page.html');

 Now this works, but I find that if 'page.html'
 contains a script and style section IE won't
process
 it, but Firefox seems to.  What I mean is that
  if
the
 'pages.html' itself contains some inline
javascript
 than Firefox will execute it but IE doesn't.

 So for example my 'pages.html' might look like
(this
 is abbreviated, but I think you'll get the
  idea):

 div id=container
   style
 form { ... }
   /style
   script
 $()ready({ ... });
   /script
   !-- More html that the above works on --
 /div

 Putting aside for the moment about whether or
  not
 inline script sections is a good idea or not,
  does
 anyone know why this would work on Firefox
  only
and is
 there any workarounds?  My client's setup
  makes
 anything but inline scripting a nightmare, so
  I am
 hoping to solve this.  If I can't make this
  work
I'll
 have to us popup windows, so please help me :)

 I saw something in the docs about $.getScript
versus
 $.get but I didn't see how this could help.
  The
only
 thing I found was a call to evalScripts in
  the
 source, but I couldn't find documentation for
that, so
 I didn't play with it.

 Thanks!
 John Napiorkowski

 Ready
for the edge of your seat?
 Check out tonight's top picks on Yahoo!
TV.http://tv.yahoo.com/

 

   Sick sense of humor? Visit Yahoo! TV's
   Comedy with an Edge to see what's on, when.
  http://tv.yahoo.com/collections/222

 
 Be a better Heartthrob. Get better relationship answers from someone who 
 knows. Yahoo! Answers - Check it 
 out.http://answers.yahoo.com/dir/?link=listsid=396545433



[jQuery] DOM problems with jQuery's Form Plugin

2007-08-29 Thread Steve Finkelstein

Hi,

The following code works:

$(document).ready(function() {
// bind 'form2' and provide a simple callback function
$('#form2').ajaxForm(function() {
   alert(DEBUG Test);
});
});

However the following does not:

$(document).ready(function() {
// bind 'form2' and provide a simple callback function
$('#form2').ajaxForm(function() {
// Server should send data back in json encoding
target: '#container'
});
});

No broken responses. My div id=container/div just does not get
updated. My server sends back:

echo DEBUG MESSAGE;

Firebug shows the echo'd response.

Totally would appreciate any help.

- sf



[jQuery] Re: Validation by Jörn Zaefferer - errorPla cement confusion

2007-08-29 Thread Feed

Jörn, the problem is simple:

using .parent().parent() in errorPlacement breaks the code in IE6.

For example, imagine a TABLE with 2 cols and 2 rows.

errorPlacement: function(error, element) {
error.appendTo( element.parent().parent().css('backgroundColor','#00') );
 }

In FIREFOX the TR containing the error field is painted black.
In IE6 the TD containing the error field is painted black, but it
should paint the TR, not the TD.

Can you please try to reproduce this?

On Aug 29, 4:36 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Feed schrieb: Jörn, did you get to this issue? Sorry to bother you, but 
 currently I
  had to disable validation from my forms because of this bug in IE6,
  I really want to use it in my project, it is awesome. Thanks in
  advance.

 No, I haven't got around to it. Any help on the actual source of the
 actual problem is highly appreciated...

 -- Jörn



[jQuery] Re: [OT] NEWS: AjaxRain Updates

2007-08-29 Thread Tane Piper

I'd like to think that is just shows how big and creative the jQuery
community is :)

On 8/29/07, Benjamin Sterling [EMAIL PROTECTED] wrote:
 Hmmm... bias maybe? :)


 On 8/29/07, Karl Swedberg [EMAIL PROTECTED] wrote:
 
  Cool!
 
 
  And, as has been noted here before, ajaxrain.com itself is powered by
 jQuery.
 
 
 
  --Karl
 
 
 
 
 
  On Aug 29, 2007, at 2:49 PM, Tane Piper wrote:
 
 
 
 
  And out of those 600 submissions, the highest percentage of
  submissions are for jQuery with well over 100 plugins and scripts
  available - beating the nearest library by miles :)
 
 
 
 
  On 29/08/2007, Karl Swedberg  [EMAIL PROTECTED] wrote:
 
  Hey everyone,
 
 
  Looks like ajaxrain.com has gone through some changes, with a bunch
  of new features:
 
 
   * Storing favorites
   * Comments
   * Voting on entries
   * Date that a submission was posted
   * Enhanced search
   * Expansion into posting RIA components based on SilverLight  Flex
 
 
  And they're still churning out the entries, with over 600 submissions.
 
 
  See the announcement over at Ajaxian:
 
 http://ajaxian.com/archives/ajaxraincom-gets-a-facelift-tops-600-
  ajaxjsria-controls
 
 
 
 
  --Karl
  _
  Karl Swedberg
  www.englishrules.com
  www.learningjquery.com
 
 
 
 
 
 
 
 
 
 
 
 
  --
  Tane Piper
  http://digitalspaghetti.me.uk
 
 
  This email is: [ ] blogable [ x ] ask first [ ] private
 



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


-- 
Tane Piper
http://digitalspaghetti.me.uk

This email is: [ ] blogable [ x ] ask first [ ] private


[jQuery] Re: unsubscribe

2007-08-29 Thread Klaus Hartl


Rey Bango wrote:


Carl, you need to go to your Google Groups page and unsubscribe there.

Rey


It'll probably also work like subscribing. Send a mail to

[EMAIL PROTECTED]



--Klaus


[jQuery] Ajax Authentication Question

2007-08-29 Thread Pops

I'm pulling my hair on this one.  It might not be a jQuery issue but
just the BROWSER issue.  But since I am planning to use jQuery, the
issue applies to it as well.

First, this is under FIREFOX only.  I don't see this behavior with IE
and OPERA. But I think maybe it may something by FF design and/or the
others don't see it as a Security issue.

I can reduce the issue to this and I'm looking for an answer:

-  I am using XHR to login and XHR to logout.
-  The /Logout Url is not work because the Authentication header is
not passed with the XHR

I narrowed it down to this:

If the original URLl PATH (not domain) that forced a login is
different  from the /logout url, then XHR will not pass the
Authentication header.

So I can have this for example:

 // Four Buttons binded to XHR calls

 $(#btnLogin).click($.get(/login));
 $(#btnLogout).click($.get(/logout));
 $(#btnUrl1).click($.get(/folder1/someurl));
 $(#btnUrl2).click($.get(/folder2/someurl));

if the user logs in via the login button, and then log off via the
logout button, its all fine.

However, if the user goes directly to a private side folder url by
clicking the folder buttons, the server forces the login as expected,
but from that point, the logout button doesn't work because the XHR is
no longer sending the Authentication Header.

So its not a Cross-Domain thing but a Cross Folder issue.

Make sense?

If so, how can I resolve this with jQuery and Firefox or I am beating
a dead horse?

--
HLS




[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Jeroen Coumans

You're right. I've adjusted my test case slightly and tested in more
browsers. Apparently, Safari put me on the wrong track - it's the only
browser that handles it the way I expected it to (and the only browser
I checked in). Thanks a lot, this was a good learning experience for
me!

Jeroen

On Aug 29, 9:35 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 Whoops :)  that should be:

 #test  li  a

 That will only select the direct a tags of the LI. Previously you where
 selecting all A tags of the LI. Even the A tags within the other child
 elements of the LI.

 --
 Brandon Aaron

 On 8/29/07, Brandon Aaron [EMAIL PROTECTED] wrote:



  Actually it works this way in the CSS Spec also and your test file proves
  it. Just use this selector instead of your other selector:

  #test  li a

  --
  Brandon Aaron

  On 8/29/07, Jeroen Coumans [EMAIL PROTECTED] wrote:

   Thanks for the explanation, that makes sense. But this is not how the
   CSS spec has it defined. You can see that in my test file where the
   CSS rule is only applied to the top list items.

   The question is; is the jQuery behaviour a bug or a feature? And if
   it's a feature, it should be documented.

   Jeroen

   On Aug 29, 2:01 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
Because you are binding the click event to the a tag, not the li. So
   what
your saying is get all the a tags within each li (which is all the a
   tags in
your ul). You just need one more child selector in there between the
   li and
a to make sure you only select the immediate a tags of the li only ...

instead of all the a tags within the li.

$('#test  li  a').click(...);

--
Brandon Aaron

On 8/29/07, Jeroen Coumans  [EMAIL PROTECTED] wrote:

 Hi,

 See http://lab.jeroencoumans.nl/jquery/child-selector.html
 It's my understanding that child selectors only select direct
   children
 of an element. Thus, $('#test  li') should only select direct
 descendent li elements of #test, not nested li's. This is
 confirmed with a simple CSS rule. So how come, when I attach a click
 event to a direct child, it seems to attach itself to all
 descendents?

 Regards, Jeroen



[jQuery] Re: DOM problems with jQuery's Form Plugin

2007-08-29 Thread Steve Finkelstein
Actually AgentScorpion helped me out on IRC .. here was the issue:

$('#form2').ajaxForm({ target: '#container', type: 'post' });

I was trying to send ajaxForm a function with parameters ... all is well
now, thanks. :-)

On 8/29/07, Josh Nathanson [EMAIL PROTECTED] wrote:


 Hi Steve,

 Make sure your JSON is well formed.  If it is not, your callback probably
 won't work.  Try doing just a console.log with the returned json data
 and
 see what you get, then try to eval it to see if will return an object.

 -- Josh


 - Original Message -
 From: Steve Finkelstein [EMAIL PROTECTED]
 To: jQuery (English) jquery-en@googlegroups.com
 Sent: Wednesday, August 29, 2007 2:47 PM
 Subject: [jQuery] DOM problems with jQuery's Form Plugin


 
  Hi,
 
  The following code works:
 
  $(document).ready(function() {
  // bind 'form2' and provide a simple callback function
  $('#form2').ajaxForm(function() {
alert(DEBUG Test);
 });
  });
 
  However the following does not:
 
  $(document).ready(function() {
  // bind 'form2' and provide a simple callback function
  $('#form2').ajaxForm(function() {
 // Server should send data back in json encoding
 target: '#container'
 });
  });
 
  No broken responses. My div id=container/div just does not get
  updated. My server sends back:
 
  echo DEBUG MESSAGE;
 
  Firebug shows the echo'd response.
 
  Totally would appreciate any help.
 
  - sf
 




[jQuery] The Mitchies. Rating the Best GUI Plugins

2007-08-29 Thread Mitch

The Mitchies. Rating the Best GUI Plugins

My interface is an example of what a novice non programmer can do
using jQuery and a number of its best plugins.

The goal was to build a GUI that contained a large number of web 2.0
features, meaning controls that gave a desktop experience inside the
browser. Besides wanting to upgrade my very popular avian search
engine (http://www.whatbird.com), I wanted to see how far I could go,
how many controls could I use to make my GUI inviting and modern. I
also wanted to see how such a GUI would work in the various browsers,
such as IE and FF. I wanted to see how fragile javascirpted web 2.0
pages were.

I stumbled upon jQuery and instantly saw its value. Then I dived in.
The resulting project was an inspiration to me because of how much I
could accomplish with so little code. I had to become familiar with a
large number of topics that were very technical, but I had a lot of
hand holding and help from thejQuery community.

Below I have listed the plugins I have used in the whatbird GUI. Three
stand out. I have given links to these so you can go get the plugin
and try it. But you can see how it works right here by just going to
the tab above calledSearch.

I decided to give each plugin my own mitchie which is essentially my
own plugin rating from 1 to 5 like the kind you see on Amazon. The
winners are cycle from Mike Alsup, tabs by Klaus Hartl and accordian
by John Resig.

You can see the details and winners here:

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

Thanks Mike, Klaus and Dan.

Mitch



[jQuery] Re: IE6 ajax oddity

2007-08-29 Thread westamastaflash

Theo, your link fixed my problem as well.

It seems that IE 6 sometimes wants a few carriage returns in served
JSON content when it is parsed.

Thanks!

Theo Skye wrote:
 Also, check this post on Remy Sharp's blog:

 http://remysharp.com/2007/01/16/broken-ajax-nothing-coming-back/

 Cheers,
 -THEO-




 On Aug 8, 2007, at 6:51 PM, Bruce MacKay wrote:

 
  Folks,
 
  I have a small blog application at http://www.thomasbaine.com/
  thetuis.asp
 
  The application works fine in IE7 and FF on both the production
  server (above) and my local development machine.
 
  IE6 works fine on my local machine, but fails on the production
  server.
 
  By fail, I mean that ajax calls to the server are not returned.
  For example, I can post a comment - and it will be stored in the
  database - but the return ajax stream of data to update the page
  does not arrive.  Similarly, click on the Recent links to
  retrieve previous items of the blog do not work - the server
  receives the instruction and does the processing, but the return
  ajax stream doesn't seem to arrive.
 
  Any ideas?
 
  Thanks/Bruce
 



[jQuery] Re: Can get the jqUploader Flash swf to appear in IE7 - ActiveX workaround won't work

2007-08-29 Thread Alexandre Plennevaux

I've looked and tried many things, but i just cant seem to find what's
making IE choke on this.
Does anybody has a good tip to track down what's wrong?

As far as i can see, the issue seems related to the options, because if i
don't overwrite any options in my function call, then it works fine.

Here is the direct link to the plugin:
http://www.pixeline.be/experiments/jqUploader/jquery.jqUploader.js and here
is the demo: http://www.pixeline.be/experiments/jqUploader/test.php


Thanks for any help

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alexandre Plennevaux
Sent: mercredi 29 août 2007 22:19
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Can get the jqUploader Flash swf to appear in IE7 -
ActiveX workaround won't work


Hi Reto, i'm checking the issue. I usually tested each release against FF2,
opera 9 and IE 6 + IE7, but maybe i didn't in the last update (2 weeks ago).

In the upcoming release of the UI library there will be a full fledge upload
component, so indeed, i don't plan to work on mine anymore. The UI library
is due around 3 Sept.

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of reto
Sent: mercredi 29 août 2007 19:22
To: jQuery (English)
Subject: [jQuery] Can get the jqUploader Flash swf to appear in IE7 -
ActiveX workaround won't work


The Demo doesn't work either in IE7.

http://www.pixeline.be/experiments/jqUploader/

I have tried:

1.jquery uncompressed (Doesn't the problem only occurs with the compressed
version?
2.query compressed with and without the patch



If the plug in doesn't work in IE7 it is basically useless.

Can anybody report the current status of the bug? Has the author given up on
this since the plugin hasn't been updated for a long time?

Thanks

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.484 / Base de données virus: 269.12.10/977 - Date: 28/08/2007
16:29
 

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.484 / Base de données virus: 269.12.10/977 - Date: 28/08/2007
16:29
 



[jQuery] Re: Ajax Authentication Question

2007-08-29 Thread Pops

Ok, this seems to be a know issue with FireFox.

I found various indirect articles:

http://lists.macosforge.org/pipermail/webkit-unassigned/2006-March/006196.html
http://lullabiesincode.blogspot.com/2007/02/problem-with-firebug-and-http.html

Even one that says FireBug might be the issue:

  http://code.google.com/p/fbug/issues/detail?id=19can=2

But I tried this on another machine with firefox sans Firebug with the
same issue.

However, this article seems to confirm the issue:

http://www.berenddeboer.net/rest/authentication.html

and it came up to the same conclusion:

   -- quote 
So a logout can be either of two things: logout, but also logging
again. Logout and login are actually the same thing! Once this concept
is grasped, the solution falls into place quite nicely:

   1. The logout link is the same as the login link.
   2. We add a special query string to it so login can deny access on
the first attempt, forcing the browser to display the login dialog
box.

The first attempt is the issue here.
   -- unquote 

The rest of the article suggest a solution but this is not generic and
in addition, there some DIGEST options that will change the picture
slightly like we discoverd in our DIGEST + COOKIE method to remove
Browser Credentials.  It works perfectly for all browsers except with
FIREFOX/XHR.

So this seems to be more germane to XHR implementation in FireFox
because the credentials are always passed for with the URL paths are
different.  Not just with XHR.

So I need to continue looking to see if this can be solved for
FireFox.

Any time saving comments would be appreciated.  :-)

---
HLS


On Aug 29, 6:01 pm, Pops [EMAIL PROTECTED] wrote:
 I'm pulling my hair on this one.  It might not be a jQuery issue but
 just the BROWSER issue.  But since I am planning to use jQuery, the
 issue applies to it as well.

 First, this is under FIREFOX only.  I don't see this behavior with IE
 and OPERA. But I think maybe it may something by FF design and/or the
 others don't see it as a Security issue.

 I can reduce the issue to this and I'm looking for an answer:

 -  I am using XHR to login and XHR to logout.
 -  The /Logout Url is not work because the Authentication header is
 not passed with the XHR

 I narrowed it down to this:

 If the original URLl PATH (not domain) that forced a login is
 different  from the /logout url, then XHR will not pass the
 Authentication header.

 So I can have this for example:

  // Four Buttons binded to XHR calls

  $(#btnLogin).click($.get(/login));
  $(#btnLogout).click($.get(/logout));
  $(#btnUrl1).click($.get(/folder1/someurl));
  $(#btnUrl2).click($.get(/folder2/someurl));

 if the user logs in via the login button, and then log off via the
 logout button, its all fine.

 However, if the user goes directly to a private side folder url by
 clicking the folder buttons, the server forces the login as expected,
 but from that point, the logout button doesn't work because the XHR is
 no longer sending the Authentication Header.

 So its not a Cross-Domain thing but a Cross Folder issue.

 Make sense?

 If so, how can I resolve this with jQuery and Firefox or I am beating
 a dead horse?

 --
 HLS



[jQuery] Re: Can get the jqUploader Flash swf to appear in IE7 - ActiveX workaround won't work

2007-08-29 Thread Alexandre Plennevaux

Nevermind, i found a trailing comma... It seems to solve the issue 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alexandre Plennevaux
Sent: jeudi 30 août 2007 0:53
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Can get the jqUploader Flash swf to appear in IE7 -
ActiveX workaround won't work


I've looked and tried many things, but i just cant seem to find what's
making IE choke on this.
Does anybody has a good tip to track down what's wrong?

As far as i can see, the issue seems related to the options, because if i
don't overwrite any options in my function call, then it works fine.

Here is the direct link to the plugin:
http://www.pixeline.be/experiments/jqUploader/jquery.jqUploader.js and here
is the demo: http://www.pixeline.be/experiments/jqUploader/test.php


Thanks for any help

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alexandre Plennevaux
Sent: mercredi 29 août 2007 22:19
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Can get the jqUploader Flash swf to appear in IE7 -
ActiveX workaround won't work


Hi Reto, i'm checking the issue. I usually tested each release against FF2,
opera 9 and IE 6 + IE7, but maybe i didn't in the last update (2 weeks ago).

In the upcoming release of the UI library there will be a full fledge upload
component, so indeed, i don't plan to work on mine anymore. The UI library
is due around 3 Sept.

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of reto
Sent: mercredi 29 août 2007 19:22
To: jQuery (English)
Subject: [jQuery] Can get the jqUploader Flash swf to appear in IE7 -
ActiveX workaround won't work


The Demo doesn't work either in IE7.

http://www.pixeline.be/experiments/jqUploader/

I have tried:

1.jquery uncompressed (Doesn't the problem only occurs with the compressed
version?
2.query compressed with and without the patch



If the plug in doesn't work in IE7 it is basically useless.

Can anybody report the current status of the bug? Has the author given up on
this since the plugin hasn't been updated for a long time?

Thanks

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.484 / Base de données virus: 269.12.10/977 - Date: 28/08/2007
16:29
 

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.484 / Base de données virus: 269.12.10/977 - Date: 28/08/2007
16:29
 

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.484 / Base de données virus: 269.12.10/977 - Date: 28/08/2007
16:29
 



[jQuery] Re: The Mitchies. Rating the Best GUI Plugins

2007-08-29 Thread Karl Swedberg

Mitch,

Your bird search looks fantastic! Congratulations on an excellent job.

One sad note about the jTip: In FF Mac, the scrollbars of div  
id=match poke through the tooltip when it is shown. I don't know  
of any workaround for this issue, but maybe somebody else does? If I  
recall correctly, not even the iFrame hack will work (as it does with  
select lists in IE6).



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



On Aug 29, 2007, at 6:21 PM, Mitch wrote:



The Mitchies. Rating the Best GUI Plugins

My interface is an example of what a novice non programmer can do
using jQuery and a number of its best plugins.

The goal was to build a GUI that contained a large number of web 2.0
features, meaning controls that gave a desktop experience inside the
browser. Besides wanting to upgrade my very popular avian search
engine (http://www.whatbird.com), I wanted to see how far I could go,
how many controls could I use to make my GUI inviting and modern. I
also wanted to see how such a GUI would work in the various browsers,
such as IE and FF. I wanted to see how fragile javascirpted web 2.0
pages were.

I stumbled upon jQuery and instantly saw its value. Then I dived in.
The resulting project was an inspiration to me because of how much I
could accomplish with so little code. I had to become familiar with a
large number of topics that were very technical, but I had a lot of
hand holding and help from thejQuery community.

Below I have listed the plugins I have used in the whatbird GUI. Three
stand out. I have given links to these so you can go get the plugin
and try it. But you can see how it works right here by just going to
the tab above calledSearch.

I decided to give each plugin my own mitchie which is essentially my
own plugin rating from 1 to 5 like the kind you see on Amazon. The
winners are cycle from Mike Alsup, tabs by Klaus Hartl and accordian
by John Resig.

You can see the details and winners here:

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

Thanks Mike, Klaus and Dan.

Mitch





[jQuery] Re: Graceful degradation (Safari 2)

2007-08-29 Thread Karl Rudd

If you're using jQuery 1.1.3 or later you can test for the version of
Safari really easily:

if ( $.browser.safari  parseFloat($.browser.version)  2 ) {
  // Do stuff for Safari version  2
}

Karl Rudd

On 8/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I love jquery, the only issue I have is the non-graceful degradation
 of some methods with mainly Safari Ver  2.
 I understand this browser is outdated, and perhaps the worst browser
 out there, but my colleagues at work still use it.
 If some of the features of jquery are not available for safari 1x, why
 not make it degrade gracefully?
 For instance, I want to show() a division layer, that has set
 display:none.
 If safari 1x does not support the opacity effects, then why not
 degrade to simply changing the container style to display:block,
 instead of returning and doing nothing?
 I think this would be a great advantage if jquery could do this, i
 would like to know why jquery does not support graceful degradation.
 Thank you for any comments.




[jQuery] Re: Graceful degradation (Safari 2)

2007-08-29 Thread Brandon Aaron
The Safari version is actually the WebKit build number. Which is 413 for
Safari 2.

--
Brandon Aaron

On 8/29/07, Karl Rudd [EMAIL PROTECTED] wrote:


 If you're using jQuery 1.1.3 or later you can test for the version of
 Safari really easily:

 if ( $.browser.safari  parseFloat($.browser.version)  2 ) {
   // Do stuff for Safari version  2
 }

 Karl Rudd

 On 8/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  I love jquery, the only issue I have is the non-graceful degradation
  of some methods with mainly Safari Ver  2.
  I understand this browser is outdated, and perhaps the worst browser
  out there, but my colleagues at work still use it.
  If some of the features of jquery are not available for safari 1x, why
  not make it degrade gracefully?
  For instance, I want to show() a division layer, that has set
  display:none.
  If safari 1x does not support the opacity effects, then why not
  degrade to simply changing the container style to display:block,
  instead of returning and doing nothing?
  I think this would be a great advantage if jquery could do this, i
  would like to know why jquery does not support graceful degradation.
  Thank you for any comments.
 
 



[jQuery] Select all elements except the first and the 3 last ones?

2007-08-29 Thread Felix Geisendörfer

Hey folks,

I need to select all but the first and the 3 last rows of a table. I 
found out that the following works:


$('table tr:gt(0):not(:last:last:last)')

Whoever it does not seem particular elegant to me and jQuery is always 
(!) elegant, so I'm wondering if one of you could come up with something 
cooler : ).


(I know that giving the elements I'm looking for a class name is 
probably the desirable solution in the long run but I'm interested in 
the problem itself and changing the markup is cheating ^^)


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


[jQuery] Re: Select all elements except the first and the 3 last ones?

2007-08-29 Thread Joel Birch
Hi Felix,

As of jQuery 1.1.4 there is a new slice() method which works similar to the
JavaScript native Array.slice() method, except on jQuery objects. Therefore,
I guess you could do something like:

var $rows = $('table tr');
$rows.slice(1,$rows.length-3);

I may not have calculated the slice parameters properly because I wanted to
post this quick enough to beat Karl to the punch :)

Joel Birch.


  1   2   >