[jQuery] Re: nested function problem?

2007-12-04 Thread paulj

Thanks, Wizzud. Your solution solved the problem.

On 3 Dec, 23:15, Wizzud <[EMAIL PROTECTED]> wrote:
> Just considering the problem area, and assuming that you want a
> generic solution...
>
> for(var i = 0; i   array2.push(array1[i] + (array1[i+1] || ''));
>
> }
>
> On Dec 3, 7:30 am, "Paul Jones" <[EMAIL PROTECTED]> wrote:
>
> > I have managed to place the values of 4 textboxes into an array called
> > array1 (each value is placed into
> > its own array element).
> > I am having problems when I try to place the 1st 2 elements of array1
> > into the 1st element of array2
> > ie
> > array2[0] = concatenated value of array1[0] and array1[1]
> > array2[1] = concatenated value of array1[2] and array1[3]
>
> > I guess this isn't the optimum solution so any advice is welcome.
>
> > TIA
>
> > 
> > 
> > 
> >   
> >   
>
> >   $(document).ready(function()
> >   {
> >   var array1 = new Array();
> >   var array2 = new Array();
>
> > $("#button").click(function ()
> > {
> >   $('.val').each(function(i)
> >   {
> >   array1[i] = $(this).val()   // this places the value of
> > each textbox into an array element
> >alert(array1[i]) //- testing purposes - this works
> >   });
> >   // *PROBLEM AREA*
> >   // I would like (eg) element 1 of array2 to be the
> > concatenated value of element 1 and element 2 of array1
> >   // Pseudocode - array2[i] = array1[i] + array2[i + 1]
> > });
> >   });
>
> >  
>
> > 
>
> > 
>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
>
> > 
>
> > 


[jQuery] jQuery magnifier not working when using multiple divs for images

2007-12-04 Thread defender71

I'm having some problems using the magnifier ui.  Everything seems to
work for one div of images however if I add another div of images the
script
does not work as expected.  For the second div the image zooms in when
the
mouse is not even close to the image.  I have posted the sample code
below
and a link to the sample
http://www.kikesweb.com/pos/magnifiertest.html
http://www.kikesweb.com/pos/magnifiertest.html








/*Magnifier*/
jQuery(document).ready(function(){
$("#example").magnifier({
overlap:true,
magnification:2,
zindex:'3',
opacity:{min:'0.6', max:'1'},
distance:'20',
baseline:0,
});
});




jQuery(document).ready(function(){
$("#secondary").magnifier({
overlap:true,
magnification:2,
zindex:'3',
opacity:{min:'0.6', max:'1'},
distance:'20',
baseline:0,
});
});




 images/mustang.jpg
 images/camaro.jpg
 images/plants.jpg






 images/mustang.jpg
 images/camaro.jpg
 images/plants.jpg




http://www.nabble.com/Magnifier-tf4941428s27240.html#a14145513
Sent from the jQuery UI Discussion mailing list archive at Nabble.com.


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Amit Uchat
Benjamin,
very good way to explain complex information. I would look forward to hear
more on your website.

On Dec 4, 2007 8:23 PM, Benjamin Sterling <[EMAIL PROTECTED]>
wrote:

> Dave, I know I am getting in here late, but I did a post on fast selectors
> that may point you in the right direction: 
> http://benjaminsterling.com/jquery-what-are-the-fastest-selector/
>
>
>
> On 12/4/07, Flesler <[EMAIL PROTECTED]> wrote:
> >
> >
> > There is, it's called slick speed.
> >
> > Ariel Flesler
> >
> > On 4 dic, 19:48, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> > > This would make a great page.  Put two selectors in and see which one
> > is
> > > faster.
> > > Glen
> > >
> > > On Dec 4, 2007 10:29 AM, sawmac <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > >
> > > > > $('p span'): 863ms
> > > > > $('p').find('span'): 3050ms
> > >
> > > > Wow, that's a big difference.
> > > > Thanks Eric for running this test and thanks Gordon for pointing me
> > to
> > > > the Firebug profiler
> > >
> > > > cheers
> > >
> > > > --dave- Ocultar texto de la cita -
> > >
> > > - Mostrar texto de la cita -
> >
>
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com 
> http://www.KenzoHosting.com 
> http://www.benjaminsterling.com




-- 
Know that you are special but be ordinary. -Sri Sri Ravisankar


[jQuery] iFrames and jQuery

2007-12-04 Thread Ryura

I need to grab content from an iFrame, preferably using jQuery.
However, I have no clue how to do this.

First off, I'm inserting the iFrame into the page:

$(function() {
$("#divID").after("");
});


Now then, test.html looks something like this:

Test

Text



I need to pull out the text in #example. I tried this

$(function() {
$("#divID").after("");
var something = $("parent.frames['tesaaat'].document >
#example").text();
});


But for some reason this doesn't work. When I try alert(something) it
alerts a box with nothing, and oddly enough it does it twice.
I searched around a bit but didn't find anything that could help me,
and this should be simple I think.
Anyone got any clues? Thanks.


[jQuery] animated list problem

2007-12-04 Thread Pere Gar

Hi,

I create a list of items, which are randomly being added to the top of
the list and removed from the bottom of it.

My idea was to animate newly appearing items with sliding them down
and fading in, and animate items, being removed by fading out and
sliding down.

It more or less works, but one time it just stops working and some
items are stuck and some internal jquery loop keeps running and giving
me the whole bunch of errors in browser. Actually it works as expected
in IE, but stuck in both Opera and FF.

Here is a little snipplet, sorry, if it's too long


function list(id) {
this.list = document.getElementById(id);
this.countries = ['cy', 'ee', 'lb', 'md', 'mv', 'so', 'zm'];
this.names = ['bob', 'james', 'hoha', 'vitja', 'ziz', 'Maho',
'urjuk', 'Zizjaj'];
this.i = 0;
}

list.prototype.add_item = function (name, country) {
// make it appear by sliding down

$('' + name + ''). // create new list item element
hide().   // hide it first
prependTo(this.list). // prepend to the main list
slideDown('slow');// show yourself
}

list.prototype.remove_item = function () {
// find last element in list
var li = $('li:last', this.list);

// if not found, means, no elements in list
if (!li.length) return;

// get DOM element
var l = li.get();

// remember removing for the current element to avoid double removing
if (typeof l.rm != 'undefined') return;
l.rm = true;

// fade it out, and then slide up, then remove forever
li.fadeTo('slow', 0.01, function () {
$(this).slideUp('slow', function () {
$(this).remove();
});
});
}

// get random array element
list.prototype.get_random = function (arr) {
return arr[Math.floor(Math.random() * arr.length)];
}

list.prototype.start = function () {
// if button pressed, stop
if (this.stopped)
return;

// 50/50 add or remove element
if ((Math.random() >= 0.5) )
{
// remove from the tail of a list
this.remove_item();
}
else
{
// add to the top of a list
this.add_item(this.get_random(this.names),
this.get_random(this.countries));
}

// repeat after random timeout (adjust random multiplier to regulate
speed)
window.setTimeout('items.start()', Math.round(Math.random() * 1000));
}

// push the button
list.prototype.stop = function () {
this.stopped = true;
}

The example may be seen at http://myprofi.sourceforge.net/stat/

Sometimes it works for some time and then gets stuck and sometimes it
gets stuck right away.

When I debugged it, it appeared, that if I remove items without any
animation, $('li:last').remove(); it won't ever get stuck, and works
allright. The problem raises only if I add animation for the item
being removed.

Actually $(this) object inside callback function of fadeOut or slideUp
whether disappears or gets somehow empty, so it's not available for us
by the time the animation has played.

I'm affraid it to be some multithreading desync problem, as it's too
hard to solve for such an easy piece of code.

Or, if it's somehow related to the jquery internals or the process
jquery runs the animation I would very appreciate to learn it from
your comments.

Thanks in advance


[jQuery] Re: Smoothly scroll to the anchor given in the URL

2007-12-04 Thread Maccer


Thanks, this seems to work except when the same link is clicked again (but
that's probably not Jquery's fault). Since I am not too familiar with how to
access things using Javascript it was the following row that I couldn't get
right:  
var target = location.hash && $(location.hash)[0];

You talk about improving the Jquery domumentation. My question is then: *is*
there a proper documentation somewhere? The "documentation" link on
http://jquery.com/plugins/project/ScrollTo leads to your blog
(http://flesler.blogspot.com/search/label/jQuery.ScrollTo) which just seems
to be a collection of announcement for new releases. In the Jquery package I
can only see a small readme with a few notes and a well commented source
code file. For people that know Javascript and Jquery well that is proably
enough, but for Jquery newbies like me it would be great to have a page
where one could see some examples (including this scroll-on-page-load
example) together with an explanation of the important parts of the code for
those examples. On http://www.freewebs.com/flesler/jQuery.ScrollTo/ there
are only the examples but one has to look at the source code for the
explanations. They should be visible on the page itself, just like in the
Jquery tutorials.


Hm.. second time I hear that, should I improve the documentation of
jQuery.ScrollTo?
So you need to scroll the page only once, each time it loads?

Try this (I'll use ScrollTo but you can certainly avoid it if you
want)

$(function(){
  var target = location.hash && $(location.hash)[0];
  if( target )
  $.scrollTo( target, { speed:1000,.} );
});

Ariel Flesler
-- 
View this message in context: 
http://www.nabble.com/Smoothly-scroll-to-the-anchor-given-in-the-URL-tf4936899s27240.html#a14160634
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jQuery Magnifier for multiple divs

2007-12-04 Thread defender71

My apologies if this is posted twice.

I'm having some problems using the magnifier ui.  Everything seems to
work for one div of images however if I add another div of images the
script does not work as expected.  For the second div the image zooms
in when the mouse is not even close to the image.  I have posted the
sample code below
and a link to the sample http://www.kikesweb.com/pos/magnifiertest.html

http://www.kikesweb.com/pos/magnifiertest.html








/*Magnifier*/
jQuery(document).ready(function(){
$("#example").magnifier({
overlap:true,
magnification:2,
zindex:'3',
opacity:{min:'0.6', max:'1'},
distance:'20',
baseline:0,
});
});




jQuery(document).ready(function(){
$("#secondary").magnifier({
overlap:true,
magnification:2,
zindex:'3',
opacity:{min:'0.6', max:'1'},
distance:'20',
baseline:0,
});
});




 images/mustang.jpg
 images/camaro.jpg
 images/plants.jpg






 images/mustang.jpg
 images/camaro.jpg
 images/plants.jpg






[jQuery] Looking for a faster way

2007-12-04 Thread Shawn

(sorry, long post so I can explain the background some)

I have a rather data intensive page that is pulling information via 
Ajax, and then populating the page.  I'm wondering if anyone can see a 
faster way to do this, as I'm seeing 12-15 second render times, and the 
page will be heavily used.

Basically, my page looks something like this (I'll post some code below):

Bob   0  0  0
Stan  1  1  0
   Vacation   Coding

There are many people rows (usually around 50ish), and the default veiw 
has 10 columns.  Each column represents a day.  The number represent how 
many tasks on that day, and the bit below the numbers show some summary 
information about the first task on that day.  A typical view will have 
a task for almost every employee/day.  (of course this is rather 
simplified, but it's enough to show the logic issues).

Creating the initial table is more than quick enough.  It's populating 
the tasks where the problem comes in.  The initial table has the 
employee ID set as the TR id's, and each day cell has a class of the 
date in question in the form "1-Jan-2007'.  So, I can then just match my 
task's employee ID to the row, and use the start/end date of the task to 
figure out which columns to populate. (that's what the inner while loop 
below is for)

Here's the code that does just this:

//Add the tasks to the schedule table
for (var x=0; x < json.results.length; x++) {
   var cur = json.results[x];
   var ds = new Date(cur.start_date);
   var de = new Date(cur.end_date);
   var curDay = new Date(ds);
   //if a task spans days, we need to add it to each day
   while (curDay && curDay < de) {
 var lbl = curDay.getDate() + "-" +
   schedule.shortMonth[curDay.getMonth()] + "-" +
   curDay.getFullYear();
 $(".crewSchedule tr[id='" + cur.employee_id + "'] ." + lbl)
   .each( function () {
 var q = parseInt($(this).children(".qty").text()) + 1;
 $(this).children(".qty").text(q);
 $(this).children(".detail").html(task.summary(cur));
   });

 curDay = new Date(curDay.setDate(curDay.getDate() + 1));
   }
}

//Task.summary function builds a simple table:
summary : function (json) {
   var t = "";

   var l1 = json.project || json.task_name;
   var l2 = json.company;
   var l3 = json.location;
   t += "" + l1 + "";
   t += "" + l2 + "";
   t += "" + l3 + "";
   t += "";
   return t;
}

And a sample of the JSON looks like so:

{
   "task_id" : "3866",
   "task_name" : "TIME OFF REQUESTED",
   "employee_id" : "111",
   "employee" : "Smith, Bob",
   "start_date" : "19 Feb 2007",
   "end_date" : "24 Feb 2007",
   "job_number" : "",
   "company" : "",
   "project" : "",
   "color:" : "#99FF99",
   "location" : "",
   "note" : ""
}

I think the delays are resulting from the first bit of code (the for 
loop through the json results), and am looking for any jQuery tricks I 
might use to speed this up some.  I've already got this down to only 
looping once through the tasks (previous efforts required multiple 
loops).  Is my use of the .each() method making sense?  Will that slow 
things down?  Any ideas how I can avoid a .each?  There *should* only be 
one row for the employee... hmmm.. so far - I will have multiple rows in 
some special cases...  But I'm ignoring that issue for now.

I'll be playing with the code in the for loop there some - I can see 
ways to clean that up a little, but still would like a second opinion...

Oh, the delays are rendering times, not Ajax load times...

Any tips appreciated.  Even though I know this is such a broad request 
for a complex problem.  I'm hoping another set of eyes my see something 
I've missed Thanks.

Shawn


[jQuery] Re: attribute filters for blank string

2007-12-04 Thread JennHi

That was weird. It didn't work for me before but it works now.

Thank you!

On Dec 4, 10:47 am, Olaf Bosch <[EMAIL PROTECTED]> wrote:
> JennHi schrieb:
>
> > Is there any way to match attributes that are an empty string using
> > attribute filters?
>
> This works for me:
>
>$("a[href='']").text("was empty");
>
> match:
>
> hier
>
> --
> Viele Grüße, Olaf
>
> ---
> [EMAIL PROTECTED]://olaf-bosch.dewww.akitafreund.dehttp://ohorn.info/
> ---


[jQuery] Re: DateJS: Robust Date manipulation library

2007-12-04 Thread coolgeoff

Thought I would jump in here and respond to a few of your comments/
suggestions...

First off, the Datejs library is actually built from 4 separate
modules (CultureInfo, core, parser, sugarpak). We compile all of them
together creating one date.js for each language/culture/country during
our final build process out of convenience for the end user developer.
You are more than welcome to piece together the modules as required.
Basically only the CultureInfo and core.js files are required. The
Parser and SugarPak are optional. The complete library is 25k because
theirs a lot going on. If you have recommendations for optimizations,
please let us know.

There's more information regarding the modules on the projects
GoogleCode home page. See http://www.datejs.com/googlecode/.

I guess it all comes down to how much Date processing power you
require. I imagine if you're building a scheduling app, the Datejs
library is going to come in real handy.

We compress with JSMin. Why? Because we like JSMin. There's something
very reassuring about Crockford's work and once gzipped, there's very
little difference between the various compression options/
combinations. Obviously if you pass the bits through Packer there's
some up front savings. The choice is yours.

@Nicolas Hoizey - I find your syntax suggestion of
Date.today().next('thursday') to be rather goofy. We have something
much cleaner, faster and explicit, Date.parse('next thursday'). What
happens if you don't pass the string parameter (eg
Date.today().next()) into .next(), what does that return? How is that
any different than leaving off the final function call on (3).days()?
which would return '3' by the way.

@Chris Jordan - Your sample "tomorrow at 8:15PM" is working now. You
caught a small bug that we weren't testing for.

Hope this helps answer some of your questions.



On Nov 29, 1:28 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Nicolas Hoizey schrieb:
>
> >>> This came through my feed reader this morning, and I thought it looked
> >>> like the kind of thing jQuerians might enjoy:
> >>>http://www.datejs.com/
>
> > I really don't like the weird syntax they use.
>
> > This Date.today().next().thursday(); is not real chaining IMHO. Even
> > more (3).days().ago();
>
> > Chaining suppose you can remove last call and still get something.
>
> > What would (3).days(); mean?
>
> > jQuery like syntax would probably be more Date.today().next('thursday');
>
> Good point. You should post that to their mailing list.
>
> Jörn


[jQuery] Re: calling ajax with url parameter

2007-12-04 Thread Chris J. Lee

I'm fairly new to this ajax call and am trying to learn. What do you
usually put in the php file?

Without getting into too much php.

Something like this would work right?



---

Chris

On Dec 4, 12:53 am, dimmex <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm pretty new to jQuery and want to implement someajax.
>
> I have a html like this:
> click here
> 
>
> After learning jQuery a little while, I got the way to callajax
> something like this:
>
> $(document).ready(function() {
> $('#item1').click(function() {
> $('#result').load('process.php', {parameters will be passed here});
> return false;
>
> });
> });
>
> from what I learnt, the parameters will be passed in format: {'a' :
> value, 'b': value}
>
> My question, can I get the href part or specifically only theparameter(only 
> 'a=1&b=2') and passing it and in my process.php I can
> access it just like $_POST variables ( $_POST['a'] and
> $_POST['b'] ) ?  what jQuery function do I need to do that? what I'm
> thinking is something like $('#result').load('process.php',
> extract(getparameter(url)));
>
> I hope my question is clear enough :) any help is appreciated.
>
> Thanks.
> Dimm


[jQuery] Fading a background image

2007-12-04 Thread jonhobbs

HI Guys,

I'm trying to fadeIn the background image of an A tag (which is set to
display:blovk so effectively a div) when you roll over it. The A tags
form the main menu of a site I am designing.

I haven't managed to find any way of changing the Background Image
opacity using css so can't use the normal animate method.

I came up with one idea which was to wrap a coupld of block elements
inside each other. Each A tag would have the background image applied
and over the top of that there would be another block element with a
white background which I would fade out when I wanted the background
image to be visible.

The problem I have found is that when I fade the div with the white
background it also fades the contents, including the text of the menu
item.



Here is my Jquery.

$(".MyMenu a").hover(
  function () {
$(this).children(".Fade").fadeOut("fast");
  },
  function () {
$(this).children(".Fade").fadeIn("fast");
  }
);


Here is my CSS...

.MyMenu{}
.MyMenu a{display:block; background:url(MenuBack.gif) no-repeat right
center; text-align:right;}
.MyMenu a .Fade{display:block; background-color:White;}
.MyMenu a .Text{display:block; padding:4px 28px 5px 0;}



And here is the HTML..


Summary
Full
Description
Compare
Specs
Images &
Video
User
Reviews




Can anyone htink of an easier way to do this, or a better way
altogether ?

Jon


[jQuery] Re: new jARIA plugin

2007-12-04 Thread John Resig

Chris -

This is some fantastic work. I want to get this into SVN right away
and begin expanding on it. The first major improvement, that I can
see, would be to allow for $(":role") and $(":role(checkbox)")
selectors, as opposed to the current filters.

Also, you might want to adjust how you set the attributes in browsers,
check out Dojo's implementation and the associated post on the google
group:

http://groups.google.com/group/mozilla.dev.accessibility/browse_thread/thread/19fb681fad23db37#5ed706794b207fb6
http://trac.dojotoolkit.org/browser/dijit/trunk/_base/wai.js

Also, check out Dojo's test suite - it'd be good to get something
similar set up.
http://trac.dojotoolkit.org/browser/dijit/trunk/tests/_base/wai.html

I spotted a couple minor bugs with your implementation (mostly with
forgetting to 'return' the right value at the end of chainable
functions. But we can work that out in the wash.

Ping me offlist for access to the jQuery SVN and we can start this
going, and move the discussion over to the jquery-dev (or jquery-ui)
list.

--John

On Dec 3, 2007 12:24 AM, Chris <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> Because 1) I haven't been able to find much about jQuery and WAI-ARIA
> (Accessible Rich Internet Applications), and 2) I wanted to try to get
> my head around ARIA, I've written a jARIA plugin.
>
> code: http://www.outstandingelephant.com/jaria/jARIA.js
> docs: http://www.outstandingelephant.com/jaria
>
> It should make implementing ARIA in jQuery-based Web apps relatively
> simple.
>
> Any comments, questions or suggestions are more than welcome.
>
> I apologize if I've reduplicated anyone's effort.
>
> Best,
>
> Chris
>
> email: mistermuckle *at* gmail *dot* com
>


[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
Let's start at the beginning.  Let's assume (work with me here) that
autogeneration of sprites and css is the path to ruin.
Let's assume 100 images should be manageable in a very easy way. (When you
add new images it should take under 3 minutes to update things)

Here a beginning...
http://www.commadot.com/jquery/hoverSprite.php

Structure is everything.  When you set up a good architecture, maintenance
is easy.

So far in the demo I have.
1. Images are variable size, currently width is variable, if height is
variable that is fine, but I would like to see the range of possible
heights/widths.
2. Some are hoverable and some not.  I use the "canHover" class and the
"button" class in tandem to achieve the right selection.

Look at the source and go slow.  I am sure this doesn't scale for some
reason.  Show me the images to add and I will show you how it scales.

Glen

PS.  This technique works for a sprite I manage.  Rows: 80, Cols: 8.  Its
gigantic and super easy to manage.


On Dec 4, 2007 7:19 PM, DaveG <[EMAIL PROTECTED]> wrote:

>
> Hey, if you can help simplify this, great!
>
> 1. Different size images.
> 2. *Some* images have 'hover' effects.
> 3. Classes within the sprite are named the same as the originating image
> name.
> 4. When images are added/changed/removed and the sprite is regenerated,
> need to be able to copy/paste the auto-generated positioning CSS.
>
> Current approach, is to:
> * name hover images with a 'hover-' prefix.
> * package the images into a zip and use
> http://spritegen.website-performance.org/ to create the sprite and
> positioning css.
> * for hover elements ensure the 'hover-' class is first in the class list.
> * use the hover function below to grab all 'hover-' elements, and attach
>  the switching code.
>
> One of the driving factors here is to simplify on-going maintenance. We
> have ~100 images, so changes to the sprite need to be easy to integrate
> to the code base.
>
>
>  ~ ~ Dave
>
> Glen Lipka wrote:
> > Let's slow down a little.  I think this might be much easier than you
> > imagine.
> > Let's go over the requirements.
> >
> > 1. You have different shaped buttons.
> > 2. Each button has a "hover".
> > 3. You want to add all the hover handlers using jQuery.
> >
> > Does this sound correct?  Add to this list, but keep it straightforward.
> > Can you post some of the other sized button images?
> >
> > I think I could help whip this up pretty quickly.
> >
> > Glen
> >
> >
> > On Dec 4, 2007 6:43 PM, DaveG <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > A slightly better working version:
> > jQuery(document).ready(function() {
> >jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
> >   function(){
> >  jQuery(this).addClass(
> > this.className.replace(/sprite-hover-(\w+)-off/gi,
> > 'sprite-hover-$1-on') );
> > // jQuery(this).attr('class',
> > this.className.replace(/sprite-hover-(\w+)-off/gi,
> > 'sprite-hover-$1-on') );
> >   },
> >   function(){
> >  jQuery(this).removeClass(
> > this.className.match(/sprite-hover-(\w+)-on/gi) );
> > // jQuery(this).attr('class',
> > this.className.replace(/sprite-hover-(\w+)-on/gi,
> > 'sprite-hover-$1-off') );
> >   }
> >);
> > });
> >
> > This adds/removes a class. My guess is that replacing the entire
> class
> > is causing the hover event to retrigger for some reason, whereas
> adding
> > replacing classes does not.
> >
> >  ~ ~ Dave
> >
> >
>


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Benjamin Sterling
Dave, I know I am getting in here late, but I did a post on fast selectors
that may point you in the right direction:
http://benjaminsterling.com/jquery-what-are-the-fastest-selector/

On 12/4/07, Flesler <[EMAIL PROTECTED]> wrote:
>
>
> There is, it's called slick speed.
>
> Ariel Flesler
>
> On 4 dic, 19:48, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> > This would make a great page.  Put two selectors in and see which one is
> > faster.
> > Glen
> >
> > On Dec 4, 2007 10:29 AM, sawmac <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > > $('p span'): 863ms
> > > > $('p').find('span'): 3050ms
> >
> > > Wow, that's a big difference.
> > > Thanks Eric for running this test and thanks Gordon for pointing me to
> > > the Firebug profiler
> >
> > > cheers
> >
> > > --dave- Ocultar texto de la cita -
> >
> > - Mostrar texto de la cita -
>



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


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Flesler

There is, it's called slick speed.

Ariel Flesler

On 4 dic, 19:48, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> This would make a great page.  Put two selectors in and see which one is
> faster.
> Glen
>
> On Dec 4, 2007 10:29 AM, sawmac <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > > $('p span'): 863ms
> > > $('p').find('span'): 3050ms
>
> > Wow, that's a big difference.
> > Thanks Eric for running this test and thanks Gordon for pointing me to
> > the Firebug profiler
>
> > cheers
>
> > --dave- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -


[jQuery] Re: hover and className

2007-12-04 Thread DaveG


Hey, if you can help simplify this, great!

1. Different size images.
2. *Some* images have 'hover' effects.
3. Classes within the sprite are named the same as the originating image 
name.
4. When images are added/changed/removed and the sprite is regenerated, 
need to be able to copy/paste the auto-generated positioning CSS.


Current approach, is to:
* name hover images with a 'hover-' prefix.
* package the images into a zip and use 
http://spritegen.website-performance.org/ to create the sprite and 
positioning css.

* for hover elements ensure the 'hover-' class is first in the class list.
* use the hover function below to grab all 'hover-' elements, and attach 
 the switching code.


One of the driving factors here is to simplify on-going maintenance. We 
have ~100 images, so changes to the sprite need to be easy to integrate 
to the code base.



 ~ ~ Dave

Glen Lipka wrote:
Let's slow down a little.  I think this might be much easier than you 
imagine.

Let's go over the requirements.

1. You have different shaped buttons.
2. Each button has a "hover".
3. You want to add all the hover handlers using jQuery.

Does this sound correct?  Add to this list, but keep it straightforward.
Can you post some of the other sized button images?

I think I could help whip this up pretty quickly.

Glen


On Dec 4, 2007 6:43 PM, DaveG <[EMAIL PROTECTED] 
> wrote:



A slightly better working version:
jQuery(document).ready(function() {
   jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
  function(){
 jQuery(this).addClass(
this.className.replace(/sprite-hover-(\w+)-off/gi,
'sprite-hover-$1-on') );
// jQuery(this).attr('class',
this.className.replace(/sprite-hover-(\w+)-off/gi,
'sprite-hover-$1-on') );
  },
  function(){
 jQuery(this).removeClass(
this.className.match(/sprite-hover-(\w+)-on/gi) );
// jQuery(this).attr('class',
this.className.replace(/sprite-hover-(\w+)-on/gi,
'sprite-hover-$1-off') );
  }
   );
});

This adds/removes a class. My guess is that replacing the entire class
is causing the hover event to retrigger for some reason, whereas adding
replacing classes does not.

 ~ ~ Dave




[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
Let's slow down a little.  I think this might be much easier than you
imagine.
Let's go over the requirements.

1. You have different shaped buttons.
2. Each button has a "hover".
3. You want to add all the hover handlers using jQuery.

Does this sound correct?  Add to this list, but keep it straightforward.
Can you post some of the other sized button images?

I think I could help whip this up pretty quickly.

Glen


On Dec 4, 2007 6:43 PM, DaveG <[EMAIL PROTECTED]> wrote:

>
> A slightly better working version:
> jQuery(document).ready(function() {
>jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
>   function(){
>  jQuery(this).addClass(
> this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on')
> );
> // jQuery(this).attr('class',
> this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on')
> );
>   },
>   function(){
>  jQuery(this).removeClass(
> this.className.match(/sprite-hover-(\w+)-on/gi) );
> // jQuery(this).attr('class',
> this.className.replace(/sprite-hover-(\w+)-on/gi, 'sprite-hover-$1-off')
> );
>   }
>);
> });
>
> This adds/removes a class. My guess is that replacing the entire class
> is causing the hover event to retrigger for some reason, whereas adding
> replacing classes does not.
>
>  ~ ~ Dave
>


[jQuery] Re: hover and className

2007-12-04 Thread DaveG


A slightly better working version:
jQuery(document).ready(function() {
   jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
  function(){
 jQuery(this).addClass( 
this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on') );
// jQuery(this).attr('class', 
this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on') );

  },
  function(){
 jQuery(this).removeClass( 
this.className.match(/sprite-hover-(\w+)-on/gi) );
// jQuery(this).attr('class', 
this.className.replace(/sprite-hover-(\w+)-on/gi, 'sprite-hover-$1-off') );

  }
   );
});

This adds/removes a class. My guess is that replacing the entire class 
is causing the hover event to retrigger for some reason, whereas adding 
replacing classes does not.


 ~ ~ Dave


[jQuery] Re: hover and className

2007-12-04 Thread DaveG



Do you have a page that has the example?

If you mean an example of the flickering problem, then I'll put one up.

Test: http://solidgone.com/jquery/hover-test.html


[jQuery] Re: hover and className

2007-12-04 Thread DaveG




Glen Lipka wrote:

Do you have a page that has the example?

If you mean an example of the flickering problem, then I'll put one up.

Also, I use jQuery with sprites in multiple methods here.  Some use a 
very powerful matrix approach, which has really clean CSS.
We considered the matrix idea, but in this case the images are all 
different sizes. Even after grouping common sizes in their own sprites, 
we ended up with more sprites than was worth the effort.



In the meantime, I this seems to work. It makes various assumptions 
regarding class positioning, but that can be corrected.


jQuery(document).ready(function() {
   jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
  function(){
 var x=this.className.split(' ');
 jQuery(this).addClass(x[x.length-1].replace('-off','-on'));
 if (this.className == '') this.className = 
x[0].replace('-off','-on');

  },
  function(){
 var x=this.className.split(' ');
 jQuery(this).removeClass(x[x.length-1]);
 if (this.className == '') this.className = 
x[0].replace('-on','-off');

  }
   );
});


[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
Do you have a page that has the example?
Also, I use jQuery with sprites in multiple methods here.  Some use a very
powerful matrix approach, which has really clean CSS.

http://www.commadot.com/jquery/sprites/

Glen

On Dec 4, 2007 5:02 PM, DaveG <[EMAIL PROTECTED]> wrote:

>
>
> Glen Lipka wrote:
> > One way is with a sprite. (Background or foreground)
> > http://learningtheworld.eu/2007/foreground-sprites/
> Actually I'm using sprites, that's why I'm switching from css :hover to
> this :)
>
> We've gone beyond the 'normal' approach of combining over/out images
> into a single sprite, and are combining multiple over/out images into a
> single sprite. We're using a sprite generator, which takes all the
> images, creates a sprite, and provide the background-position classes,
> with classes named the same as the image names, with a prefix.
>
> Because the classes for over/out images are named differently, and now
> have different class names, the css :hover is not easily applied. Thus,
> this jQuery approach.
>
> > There are lots of methods.  The one you have has flicker written all
> > over it. :)
> Any way to stop it, with this method?
>
>
>


[jQuery] Re: hover and className

2007-12-04 Thread DaveG



Glen Lipka wrote:

One way is with a sprite. (Background or foreground)
http://learningtheworld.eu/2007/foreground-sprites/
Actually I'm using sprites, that's why I'm switching from css :hover to 
this :)


We've gone beyond the 'normal' approach of combining over/out images 
into a single sprite, and are combining multiple over/out images into a 
single sprite. We're using a sprite generator, which takes all the 
images, creates a sprite, and provide the background-position classes, 
with classes named the same as the image names, with a prefix.


Because the classes for over/out images are named differently, and now 
have different class names, the css :hover is not easily applied. Thus, 
this jQuery approach.


There are lots of methods.  The one you have has flicker written all 
over it. :)

Any way to stop it, with this method?




[jQuery] Re: hover and className

2007-12-04 Thread Glen Lipka
In general, there are better ways of doing this.

One way is with a sprite. (Background or foreground)
http://learningtheworld.eu/2007/foreground-sprites/

Browsers are very fast at CSS, and not nearly as fast at replacing
graphics.  Many browsers show a flicker.
If you use a sprite then it works faster and smoother.

Another way is to have both images in the dom.  Then change
display:none/block on hover so it shows one or the other.
There are lots of methods.  The one you have has flicker written all over
it. :)

Glen


On Dec 4, 2007 4:10 PM, DaveG <[EMAIL PROTECTED]> wrote:

>
> I'm trying to change an elements class on mouse-over/out. The code below
> seems to fire repeatedly when the mouse moves over the target, even when
> the mouse is stationary, causing a slow (10/sec) flicker effect. What's
> causing the flicker? I was expecting the over/out functions to fire once
> on mouse over, and once on mouse out.
>
> jQuery("[EMAIL PROTECTED]'xxx-']").hover(
>function(){
>   jQuery(this)
>  .attr(
> 'class',
> this.className.replace(/xxx-(\w+)-off/gi, 'xxx-$1-on')
>  );
>},
>function(){
>   jQuery(this)
>  .attr(
> 'class',
> this.className.replace(/xxx-(\w+)-on/gi, 'xxx-$1-off')
>   );
>}
> );
>
>
>
>  ~ ~ David
>


[jQuery] hover and className

2007-12-04 Thread DaveG


I'm trying to change an elements class on mouse-over/out. The code below 
seems to fire repeatedly when the mouse moves over the target, even when 
the mouse is stationary, causing a slow (10/sec) flicker effect. What's 
causing the flicker? I was expecting the over/out functions to fire once 
on mouse over, and once on mouse out.


jQuery("[EMAIL PROTECTED]'xxx-']").hover(
   function(){
  jQuery(this)
 .attr(
'class',
this.className.replace(/xxx-(\w+)-off/gi, 'xxx-$1-on')
 );
   },
   function(){
  jQuery(this)
 .attr(
'class',
this.className.replace(/xxx-(\w+)-on/gi, 'xxx-$1-off')
  );
   }
);



 ~ ~ David


[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread Wizzud

You could try...

$(':input',this).each(function(){
var me = $(this);
if(!me.is(':checkbox, :radio') || this.checked){
  inputs.push(this.name + '=' + unescape(me.val()));
}
  });

On Dec 4, 8:44 am, e2e <[EMAIL PROTECTED]> wrote:
> Changing my function to this solved my problem:
> $("form#profile_form").submit(function() {
> $("#users_profile h1").after('');
> $("#users_profile .errors").remove()
> var inputs = [];
> $(':input', this).each(function() {
> if(this.name == "gender") {
> var val = $("[EMAIL PROTECTED]:checked").val();
> inputs.push(this.name + '=' + unescape(val));
> } else if(this.name == "private") {
> var val = $("[EMAIL PROTECTED]:checked").val();
> inputs.push(this.name + '=' + unescape(val));
> } else {
> inputs.push(this.name + '=' + unescape(this.value));
> }
>
> });
> $.ajax({
> type : "POST",
> data : inputs.join('&'),
> url : "/sp/tasks.php?task=updateprofile",
> success : function(msg) {
> $("#users_profile .loading").remove();
> if(msg == "ok") {
> $("#profile_form").remove();
> $("#users_profile h1").after(' class="message
> m_info">Profiliniz güncellendi!');
> } else {
> $("#users_profile h1").after(msg);
> }
> }
> });
> return false;
> });
>
> If there is a better way please tell me.
>
> On Dec 4, 1:20 am, Wizzud <[EMAIL PROTECTED]> wrote:
>
> > That would be because your $(':input', this) selector is selecting
> > *every* input field in your form and adding it to your inputs array.
> > One solution is to put a test in your each() function to see if the
> > field is a checkbox or radio, and if it is, only add it to your inputs
> > array if it's checked.
>
> > On Dec 3, 11:24 am,e2e<[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I use this function to submit my post requests. But now I have a
> > > problem with radio buttons and checkboxes. It sends all button values
> > > to server, so the last radio buttons' (even it's not checked) value
> > > passes as value. checkboxes are same, even it's not checked, it sends
> > > checked value.
>
> > > $("form#profile_form").submit(function() {
> > > $("#users_profile h1").after(' > > class="loading">');
> > > $("#users_profile .errors").remove()
> > > var inputs = [];
> > > $(':input', this).each(function() {
> > > inputs.push(this.name + '=' + unescape(this.value));
> > > });
> > > $.ajax({
> > > type : "POST",
> > > data : inputs.join('&'),
> > > url : "tasks.php?task=updateprofile",
> > > success : function(msg) {
> > > $("#users_profile .loading").remove();
> > > if(msg == "ok") {
> > > $("#profile_form").remove();
> > > $("#users_profile h1").after(' > > class="message m_info">Profile
> > > updated!');
> > > } else {
> > > $("#users_profile h1").after(msg);
> > > }
> > > }
> > > });
> > > return false;
> > > });


[jQuery] Re: jChess

2007-12-04 Thread Jörn Zaefferer


John Resig schrieb:

I think he's just talking about putting his code in jquery.com/plugins
- for which you just need an account there.
  
Oh, right. In that case just registering is easy enough: 
http://jquery.com/plugins/user/register


Jörn


[jQuery] InGrid Plugin Trouble

2007-12-04 Thread Rey Bango


I'm trying to use InGrid (latest version 0.9.1) w/ jQuery v1.2.1 but I'm 
running into a little trouble:


http://www.intoajax.com/ingrid/index.cfm

It's generating an error in FireBug and when I look at it, it looks like 
it's trying to tell me that the number of table columns between the main 
page and the results being pulled back via XHR aren't the same. In 
looking at both, it looks like the same number.


Can someone take a look and give me a second set of eyes?

Thanks,

Rey


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Glen Lipka
This would make a great page.  Put two selectors in and see which one is
faster.
Glen

On Dec 4, 2007 10:29 AM, sawmac <[EMAIL PROTECTED]> wrote:

>
> >
> > $('p span'): 863ms
> > $('p').find('span'): 3050ms
>
> Wow, that's a big difference.
> Thanks Eric for running this test and thanks Gordon for pointing me to
> the Firebug profiler
>
> cheers
>
> --dave
>


[jQuery] Re: ANNOUNCE: tinyEdit v.1.0 plugin for jQuery released

2007-12-04 Thread Karl Swedberg


I just downloaded it and tried it locally with jQuery 1.2, and I  
didn't see any problems.



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



On Dec 4, 2007, at 5:28 PM, [EMAIL PROTECTED] wrote:



Hi,

were you able to use jtageditor with latest jquery? thnaks.
A.C.

On Nov 14, 2:58 am, Guy Fraser <[EMAIL PROTECTED]> wrote:

Karl Swedberg wrote:

Not sure what Brian's plans are for implementing different types of
tags, but if you need that functionality now, there is another
excellent plugin calledjTagEditor:
http://www.jaysalvat.com/jquery/jtageditor/


Oooh! That's almost exactly what I'm after - it looks like it's  
based on

an old version of jQuery though: 1.1.3.1

I'm going to see if I can merge the two plugins together somehow (and
also try and clone myself in the process as there just aren't enough
hours in the day!) as there are elements of each I really like :)

Guy




[jQuery] Re: ANNOUNCE: tinyEdit v.1.0 plugin for jQuery released

2007-12-04 Thread [EMAIL PROTECTED]

Hi,

were you able to use jtageditor with latest jquery? thnaks.
A.C.

On Nov 14, 2:58 am, Guy Fraser <[EMAIL PROTECTED]> wrote:
> Karl Swedberg wrote:
> > Not sure what Brian's plans are for implementing different types of
> > tags, but if you need that functionality now, there is another
> > excellent plugin calledjTagEditor:
> >http://www.jaysalvat.com/jquery/jtageditor/
>
> Oooh! That's almost exactly what I'm after - it looks like it's based on
> an old version of jQuery though: 1.1.3.1
>
> I'm going to see if I can merge the two plugins together somehow (and
> also try and clone myself in the process as there just aren't enough
> hours in the day!) as there are elements of each I really like :)
>
> Guy


[jQuery] Re: jChess

2007-12-04 Thread John Resig

I think he's just talking about putting his code in jquery.com/plugins
- for which you just need an account there.

--John

On Dec 4, 2007 5:05 PM, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>
> Shawn schrieb:
> > How about a link so we can see it??? :)
> >
> > As for the repository, I *think* you just need to create an account on
> > jQuery.com
> >
> Nope - its now hosted on code.google.com, therefore you need to be a
> member on that google-code project to commit.
>
> Jörn
>


[jQuery] Re: jChess

2007-12-04 Thread Jörn Zaefferer


Shawn schrieb:

How about a link so we can see it??? :)

As for the repository, I *think* you just need to create an account on 
jQuery.com
  
Nope - its now hosted on code.google.com, therefore you need to be a 
member on that google-code project to commit.


Jörn


[jQuery] Re: jQuery List/Demos/Samples

2007-12-04 Thread Glen Lipka
There are lots of examples in http://docs.jquery.com.  Each method has an
example with source code.
Over time, I have made a bunch of quick pages that use jQuery to answer a
specific question: http://www.commadot.com/jquery.
The ajaxrain site is pretty good in it's own right.

This page is really helpful.
http://www.learningjquery.com/2007/11/tutorials-elsewhere#more-81

There really are alot of sources.  I hope this starts you on the right
track.

Glen

On Dec 4, 2007 12:47 PM, Lawk Salih <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> Where can I find a list of demos and live samples that I could test
> drive.  I am looking for something similar to www.ajaxrain.com.
>
> Best, Lawk Salih.
>


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Jörn Zaefferer


Karl Swedberg schrieb:


Hey Jörn,

He is using excanvas as far as I can see. Tried it in IE6, and it 
looked great. He also accounts for it in the plugin:


if (jQuery.browser.msie) // excanvas hack
canvas = window.G_vmlCanvasManager.initElement(canvas)
Interesting. I don't see any canvas in IE6, thats why I posted. It 
doesn't throw any error either.


Jörn


[jQuery] Re: jChess

2007-12-04 Thread Shawn

How about a link so we can see it??? :)

As for the repository, I *think* you just need to create an account on 
jQuery.com

Shawn

aldur wrote:
> does anyone kow how to go about gettnig acces to upload this to the
> JQuery repository


[jQuery] jQuery List/Demos/Samples

2007-12-04 Thread Lawk Salih

Hi,

Where can I find a list of demos and live samples that I could test
drive.  I am looking for something similar to www.ajaxrain.com.

Best, Lawk Salih.


[jQuery] Re: Data containing ? at the start getting converted to jsonp.... by ajax() call

2007-12-04 Thread Ben Bennett

Thanks for thinking about this.  However the items in the data object
are being escaped automatically for me (since I have not set the
processData option to false).  So if I escape it, then it is double
escaped on the wire.

Note that if the ? does not appear at the start of the string then it
is correctly escaped and transmitted across the wire.

Also, the regular expression being used to find the strings to change
looks for both =? and =%3F (the escaped form).

This behavior is present in the latest svn version of the code too:
  http://dev.jquery.com/browser/trunk/jquery/src/ajax.js

-ben

On Dec 4, 2:43 pm, "Scott Trudeau" <[EMAIL PROTECTED]> wrote:
> ? is a reserved character in URLs (it separates the domain from the GET
> parameters) and must be encoded if it's data.
>
> http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
>
> Scott
>
> On Dec 4, 2007 2:00 PM, Ben Bennett <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > This is my first post so I really should thank everyone for a
> > fanatastic library.
>
> > However, I think I have found a bug...
>
> > Using jQuery 1.2.1, if I have:
>
> > $.ajax({
> >  type: "POST",
> >  url: "test.html",
> >  dataType: "json",
> >  data: {query: queryString},
> > });
>
> > When queryString starts with a ? it will get converted to
> > jsonp1231234124...
>
> > This is clearly happening because of the code at line 2226 of the full
> > release version:
> >// Build temporary JSONP function
> >if ( s.dataType == "json" && (s.data &&
> > s.data.match(jsre) || s.url.match(jsre)) ) {
> >jsonp = "jsonp" + jsc++;
>
> >// Replace the =? sequence both in the query
> > string and the data
> >if ( s.data )
> >s.data = s.data.replace(jsre, "=" +
> > jsonp);
> >s.url = s.url.replace(jsre, "=" + jsonp);
>
> > ...
>
> > But I see no way to prevent that from happening.
>
> > Now... one might suggest that I should avoid a leading ? in my option
> > names.  But I am taking them from input boxes and ? is a valid thing
> > for a user to type.  Unfortunately there seems to be no good way to
> > escape the string to prevent this behavior (without teaching the
> > called code how to unescape it).
>
> > Also, the docs don't mention that the =? escaping happens to a json
> > dataType... I see it for jsonp.
>
> > Is this behavior intentional?  If so, there should be a way to
> > suppress it or at a way for the calling code to escape the values to
> > cause a leading ? to be passed to the server.
>
> > -ben
>
> --
> --
> Scott Trudeau
> scott.trudeau AT gmail DOT comhttp://sstrudeau.com/
> AIM: sodthestreets


[jQuery] Re: Bug in jquery-roundcorners-canvas !?

2007-12-04 Thread Olaf Bosch


Hi all,

What i suppossed its right, the script cane not read the CSS correct.
The Script generate the CANVAS, with the Background from the outer
Container (or transparent)

Look at this Screen:
http://olaf-bosch.de/bugs/jquery/corner/screen.jpg

I have in IE 7

canvas{
margin-top:-16px;
}

and then outlined with DevTollBar.

Any ideas?


i try to debug a bad behavior in IE (6+7), i found: This Plugin works
not when the CSS definition is global set on a ContextSelector. My
engl. is to bad to wirte it better, i have setup a Demo of the
problem.

http://olaf-bosch.de/bugs/jquery/corner/




--
Viele Grüße, Olaf

---
[EMAIL PROTECTED]
http://olaf-bosch.de
www.akitafreund.de
---


[jQuery] Re: The click event and Ajax (Problem)

2007-12-04 Thread Glen Lipka
I might be talking out my butt, but maybe create a div inside the one with
the click handler and load into that.
Then the click event is preserved.

Also check out the Live JQuery plugin.  It can add events to dynamically
loaded elements.

Glen

On Dec 4, 2007 3:26 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I am sure this is a pretty basic question but I have the following
> problem.
> When I try to load content into a div container with AJAX, the content
> just loads for a split second and disappears or unloads itself again.
> It seems that the click event only works when the actual click is
> performed. Do I have to use another event or what is the problem?
>
> $(document).ready(function() {
>
>   $("#mylink").click(function(){
>  $("#mydiv").load("content.html");
>   });
>
> });
>
> Thanks.
>
>
> alex
>


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Ken Gregg

Great work. Anxious to play with it.

One suggestion for handling time series is providing x and y axis
label callbacks. When passed a value (number of minutes, hours, days,
etc) the call back could translate the value to label text and the
values would still scale.

On Dec 4, 4:04 am, Ole Laursen <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've just released Flot 0.1, a brand-new plot plugin for jQuery which
> focuses on simple usage, attractive looks and interactive features
> like zooming. It's like plotr and Plotkit, but hopefully a bit more
> intelligent when it comes to auto-adjusting axes.
>
> The project page is here:
>
>  http://code.google.com/p/flot/
>
> And examples are here:
>
>  http://people.iola.dk/olau/flot/examples/
>
> I also posted about the news on my blog:
>
>  http://ole-laursen.blogspot.com/2007/12/flot-01-released.html
>
> I'm in the midst of writing the API documentation, but the examples
> should hopefully get you started and the available settings are
> documented in the source code at the top of the file.
>
> --
> Ole Laursenhttp://people.iola.dk/olau/


[jQuery] Re: Data containing ? at the start getting converted to jsonp.... by ajax() call

2007-12-04 Thread Scott Trudeau
? is a reserved character in URLs (it separates the domain from the GET
parameters) and must be encoded if it's data.

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

Scott

On Dec 4, 2007 2:00 PM, Ben Bennett <[EMAIL PROTECTED]> wrote:

>
> This is my first post so I really should thank everyone for a
> fanatastic library.
>
> However, I think I have found a bug...
>
> Using jQuery 1.2.1, if I have:
>
> $.ajax({
>  type: "POST",
>  url: "test.html",
>  dataType: "json",
>  data: {query: queryString},
> });
>
> When queryString starts with a ? it will get converted to
> jsonp1231234124...
>
> This is clearly happening because of the code at line 2226 of the full
> release version:
>// Build temporary JSONP function
>if ( s.dataType == "json" && (s.data &&
> s.data.match(jsre) || s.url.match(jsre)) ) {
>jsonp = "jsonp" + jsc++;
>
>// Replace the =? sequence both in the query
> string and the data
>if ( s.data )
>s.data = s.data.replace(jsre, "=" +
> jsonp);
>s.url = s.url.replace(jsre, "=" + jsonp);
>
> ...
>
> But I see no way to prevent that from happening.
>
> Now... one might suggest that I should avoid a leading ? in my option
> names.  But I am taking them from input boxes and ? is a valid thing
> for a user to type.  Unfortunately there seems to be no good way to
> escape the string to prevent this behavior (without teaching the
> called code how to unescape it).
>
> Also, the docs don't mention that the =? escaping happens to a json
> dataType... I see it for jsonp.
>
> Is this behavior intentional?  If so, there should be a way to
> suppress it or at a way for the calling code to escape the values to
> cause a leading ? to be passed to the server.
>
> -ben
>



-- 
--
Scott Trudeau
scott.trudeau AT gmail DOT com
http://sstrudeau.com/
AIM: sodthestreets


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Karl Swedberg


Hey Jörn,

He is using excanvas as far as I can see. Tried it in IE6, and it  
looked great. He also accounts for it in the plugin:


if (jQuery.browser.msie) // excanvas hack
canvas = window.G_vmlCanvasManager.initElement(canvas)




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



On Dec 4, 2007, at 2:07 PM, Jörn Zaefferer wrote:



Ole Laursen schrieb:

Hi!

I've just released Flot 0.1, a brand-new plot plugin for jQuery which
focuses on simple usage, attractive looks and interactive features
like zooming. It's like plotr and Plotkit, but hopefully a bit more
intelligent when it comes to auto-adjusting axes.
I love the interactive stuff. That makes it so much more useful then  
any graphing stuff I've seen and used so far.


Please include excanvas on your demo pages. If I understand it  
right, this will make Flot work in IE without any other hassle on  
your side.


I'm looking forward to updates!

Jörn




[jQuery] Data containing ? at the start getting converted to jsonp.... by ajax() call

2007-12-04 Thread Ben Bennett

This is my first post so I really should thank everyone for a
fanatastic library.

However, I think I have found a bug...

Using jQuery 1.2.1, if I have:

$.ajax({
  type: "POST",
  url: "test.html",
  dataType: "json",
  data: {query: queryString},
});

When queryString starts with a ? it will get converted to
jsonp1231234124...

This is clearly happening because of the code at line 2226 of the full
release version:
// Build temporary JSONP function
if ( s.dataType == "json" && (s.data &&
s.data.match(jsre) || s.url.match(jsre)) ) {
jsonp = "jsonp" + jsc++;

// Replace the =? sequence both in the query
string and the data
if ( s.data )
s.data = s.data.replace(jsre, "=" +
jsonp);
s.url = s.url.replace(jsre, "=" + jsonp);

...

But I see no way to prevent that from happening.

Now... one might suggest that I should avoid a leading ? in my option
names.  But I am taking them from input boxes and ? is a valid thing
for a user to type.  Unfortunately there seems to be no good way to
escape the string to prevent this behavior (without teaching the
called code how to unescape it).

Also, the docs don't mention that the =? escaping happens to a json
dataType... I see it for jsonp.

Is this behavior intentional?  If so, there should be a way to
suppress it or at a way for the calling code to escape the values to
cause a leading ? to be passed to the server.

-ben


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Jörn Zaefferer


Ole Laursen schrieb:

Hi!

I've just released Flot 0.1, a brand-new plot plugin for jQuery which
focuses on simple usage, attractive looks and interactive features
like zooming. It's like plotr and Plotkit, but hopefully a bit more
intelligent when it comes to auto-adjusting axes.
I love the interactive stuff. That makes it so much more useful then any 
graphing stuff I've seen and used so far.


Please include excanvas on your demo pages. If I understand it right, 
this will make Flot work in IE without any other hassle on your side.


I'm looking forward to updates!

Jörn


[jQuery] Re: Home page first visit popup window creation

2007-12-04 Thread Jörn Zaefferer


PaulM schrieb:

I would like to create a popup that would come out after visiting my
site for the first time.
How can I do this with jquery?
  
Creating a popup doesn't require jQuery, all you need is window.open: 
http://w3schools.com/htmldom/met_win_open.asp


You don't even need to wait for the ready event to run that code.

To save the state you could use cookies, eg. with the cookie plugin: 
http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/


Jörn


[jQuery] Re: attribute filters for blank string

2007-12-04 Thread Olaf Bosch


JennHi schrieb:

Is there any way to match attributes that are an empty string using
attribute filters?


This works for me:

  $("a[href='']").text("was empty");

match:

hier

--
Viele Grüße, Olaf

---
[EMAIL PROTECTED]
http://olaf-bosch.de
www.akitafreund.de
http://ohorn.info/
---


[jQuery] Re: how to append() to a textarea

2007-12-04 Thread Karl Swedberg


I just tried this in Firebug, and it worked fine, updating the text in  
the textarea:


var tVal = $('textarea').val();
$('textarea').val(tVal + ' it works!');

You'll most likely want to use a selector that is more specific than $ 
('textarea'), and in your script you'll have to wrap a document ready  
around it, but otherwise, it should work. It's not really the same as  
John's code below either, but you can rewrite as a plugin if you want.


Actually, after trying John's code, I see that it works, too. By  
itself, it won't do anything, because it acts as a plugin. So, you'll  
need one more line.


$.fn.appendVal = function(txt) {
   return this.each(function(){
   this.value += txt;
   });
};

// this is the line you need. Modify the selector as you see fit:
$('textarea').appendVal(' hooray!'); //appends ' hooray!' to the value  
of 


Hope that helps.
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Dec 4, 2007, at 12:13 PM, David Serduke wrote:



Using val() won't change the generated source.  It only changes the
current value in the input element.  For example, if you type a letter
in the textarea it doesn't change the generated html even though the
textarea value has changed.  So since your form is hidden maybe it is
changing and you can't see it but are rather checking the generated
source instead which isn't supposed to change.

Try out this example:

http://www.exfer.net/test/jquery/textarea_append_test.html

David

On Dec 4, 8:02 am, cfdvlpr <[EMAIL PROTECTED]> wrote:

OK, I tried $("#utmtrans").val($("#utmtrans").val() + 'test');

Here's the HTML before this gets called:

   
   
   
   

And here's what I see when I "view generated source" with the firefox
add on web developer toolbar.:



   name="utmtrans">  

   

test, does not get appended there.  I actually don't need to append
the text, but I need to simply add it.  .html() didn't seem to work.
Anything else I can try?

On Dec 3, 9:11 pm, David Serduke <[EMAIL PROTECTED]> wrote:




I'd try



$("textarea").val($("textarea").val() + txt);



David



On Dec 3, 4:27 pm, cfdvlpr <[EMAIL PROTECTED]> wrote:


append() doesn't seem to work.   I also tried this function that  
was
mentioned in another thread here by John and that doesn't seem to  
work

for me either.  Anyone else got this to work?  What might I be
missing?



$.fn.appendVal = function(txt) {
   return this.each(function(){
   this.value += txt;
   });



};- Hide quoted text -



- Show quoted text -- Hide quoted text -


- Show quoted text -





[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Andy Matthews

I like the idea of plugin chart components. Have 2 or 3 built in types, then
release additional modules as requested. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ole Laursen
Sent: Tuesday, December 04, 2007 12:22 PM
To: jQuery (English)
Subject: [jQuery] Re: Ann: Flot 0.1 released


On Dec 4, 7:11 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> This is absolutely brilliant stuff here. Wow! I can't tell you how 
> much I love this. At jQueryCamp07, John Resig and Bradley Sepos did a 
> presentation on canvas, and I was blown away by the possibilities.
> This plugin confirms my blown-away-edness. :-)

Thanks. :-)

The canvas is, although simple, quite pleasant to work with.

> Any plans for a pie chart type -- maybe by using arc(x, y, radius, 
> startAngle, endAngle, anticlockwise) ?

Currently not. Mostly because I'm a bit unsure how it would fit in with the
rest of the plugin. If there's almost no code sharing, it's probably better
to somehow separate it out so that those who just want the pie charts don't
have to have the rest of the package and vice versa. I'll give it a thought.

--
Ole Laursen
http://people.iola.dk/olau/




[jQuery] [S] Truncate textstring / result plaintext string

2007-12-04 Thread dfd

Hi,

i was looking how to truncate a simple textstring (no tags), ie. "This
string is too long" to "This string" with a simple call var newString
= $(xyz).truncate(minlength, maxlength, atlength, array(".", ",", "-",
"(", ")", ...);
which will cut the string at the position a char from array exists
between minlength and maxlength, if not, cut it at position atlength.

Any ideas anyone?

TIA, frank


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Jean

Our projects will could be more "desktop" now =D

Thanks a lot!

On Dec 4, 2007 10:04 AM, Ole Laursen <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> I've just released Flot 0.1, a brand-new plot plugin for jQuery which
> focuses on simple usage, attractive looks and interactive features
> like zooming. It's like plotr and Plotkit, but hopefully a bit more
> intelligent when it comes to auto-adjusting axes.
>
> The project page is here:
>
>   http://code.google.com/p/flot/
>
> And examples are here:
>
>   http://people.iola.dk/olau/flot/examples/
>
> I also posted about the news on my blog:
>
>   http://ole-laursen.blogspot.com/2007/12/flot-01-released.html
>
> I'm in the midst of writing the API documentation, but the examples
> should hopefully get you started and the available settings are
> documented in the source code at the top of the file.
>
> --
> Ole Laursen
> http://people.iola.dk/olau/
>



-- 

[]´s Jean
www.suissa.info

   Ethereal Agency
www.etherealagency.com


[jQuery] attribute filters for blank string

2007-12-04 Thread JennHi

Is there any way to match attributes that are an empty string using
attribute filters?

For instance, I might have a lot of anchor tags in a file with an href
of "". How might I write a selector -- ie $("[EMAIL PROTECTED]'null']") -- that
would match this? Unfortunately removing the "null" -- $
("[EMAIL PROTECTED]'']") --ended up matching nothing

Thanks!


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Ole Laursen

On Dec 4, 7:11 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> This is absolutely brilliant stuff here. Wow! I can't tell you how
> much I love this. At jQueryCamp07, John Resig and Bradley Sepos did a
> presentation on canvas, and I was blown away by the possibilities.
> This plugin confirms my blown-away-edness. :-)

Thanks. :-)

The canvas is, although simple, quite pleasant to work with.

> Any plans for a pie chart type -- maybe by using arc(x, y, radius,
> startAngle, endAngle, anticlockwise) ?

Currently not. Mostly because I'm a bit unsure how it would fit in
with the rest of the plugin. If there's almost no code sharing, it's
probably better to somehow separate it out so that those who just want
the pie charts don't have to have the rest of the package and vice
versa. I'll give it a thought.

--
Ole Laursen
http://people.iola.dk/olau/


[jQuery] Re: which query is most efficient?

2007-12-04 Thread sawmac

>
> $('p span'): 863ms
> $('p').find('span'): 3050ms

Wow, that's a big difference.
Thanks Eric for running this test and thanks Gordon for pointing me to
the Firebug profiler

cheers

--dave


[jQuery] Bug in jquery-roundcorners-canvas !?

2007-12-04 Thread Olaf Bosch


Hi all,
i try to debug a bad behavior in IE (6+7), i found:
This Plugin works not when the CSS definition is global set on a
ContextSelector.
My engl. is to bad to wirte it better, i have setup a Demo of the problem.

http://olaf-bosch.de/bugs/jquery/corner/

Please look at this and you see was you get ;)

What is to do? Have any interest to upgrade this Super-Plugin? The Autor
self is not seeing anymore :(

---
By the way:
I have edit the jquery.corner.js to better styling the CANVAS-elements,

if (opts.tl) { var tl = 
$(creatCanvas(this,radius,"tl")).css({left:p_left,top:p_top}).get(0); }
if (opts.tr) { var tr = 
$(creatCanvas(this,radius,"tr")).css({right:p_right,top:p_top}).get(0); }
if (opts.bl) { var bl = 
$(creatCanvas(this,radius,"bl")).css({left:p_left,bottom:p_bottom}).get(0); 
}
if (opts.br) { var br = 
$(creatCanvas(this,radius,"br")).css({right:p_right,bottom:p_bottom}).get(0); 
}


..
var creatCanvas = function(p,radius,olaf) {
..
elm.className = "canvas" + olaf;


This give me (and you) better handel with CSS, spezial in IE6:

http://olaf-bosch.de
www.akitafreund.de
---


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Karl Swedberg


Ole,

This is absolutely brilliant stuff here. Wow! I can't tell you how  
much I love this. At jQueryCamp07, John Resig and Bradley Sepos did a  
presentation on canvas, and I was blown away by the possibilities.  
This plugin confirms my blown-away-edness. :-)


Any plans for a pie chart type -- maybe by using arc(x, y, radius,  
startAngle, endAngle, anticlockwise) ?



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



On Dec 4, 2007, at 7:04 AM, Ole Laursen wrote:



Hi!

I've just released Flot 0.1, a brand-new plot plugin for jQuery which
focuses on simple usage, attractive looks and interactive features
like zooming. It's like plotr and Plotkit, but hopefully a bit more
intelligent when it comes to auto-adjusting axes.

The project page is here:

http://code.google.com/p/flot/

And examples are here:

http://people.iola.dk/olau/flot/examples/

I also posted about the news on my blog:

http://ole-laursen.blogspot.com/2007/12/flot-01-released.html

I'm in the midst of writing the API documentation, but the examples
should hopefully get you started and the available settings are
documented in the source code at the top of the file.

--
Ole Laursen
http://people.iola.dk/olau/





[jQuery] Re: how to append() to a textarea

2007-12-04 Thread David Serduke

Using val() won't change the generated source.  It only changes the
current value in the input element.  For example, if you type a letter
in the textarea it doesn't change the generated html even though the
textarea value has changed.  So since your form is hidden maybe it is
changing and you can't see it but are rather checking the generated
source instead which isn't supposed to change.

Try out this example:

http://www.exfer.net/test/jquery/textarea_append_test.html

David

On Dec 4, 8:02 am, cfdvlpr <[EMAIL PROTECTED]> wrote:
> OK, I tried $("#utmtrans").val($("#utmtrans").val() + 'test');
>
> Here's the HTML before this gets called:
>
> 
> 
> 
> 
>
> And here's what I see when I "view generated source" with the firefox
> add on web developer toolbar.:
>
> 
>
>   
> 
> 
>
> test, does not get appended there.  I actually don't need to append
> the text, but I need to simply add it.  .html() didn't seem to work.
> Anything else I can try?
>
> On Dec 3, 9:11 pm, David Serduke <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'd try
>
> > $("textarea").val($("textarea").val() + txt);
>
> > David
>
> > On Dec 3, 4:27 pm, cfdvlpr <[EMAIL PROTECTED]> wrote:
>
> > > append() doesn't seem to work.   I also tried this function that was
> > > mentioned in another thread here by John and that doesn't seem to work
> > > for me either.  Anyone else got this to work?  What might I be
> > > missing?
>
> > > $.fn.appendVal = function(txt) {
> > > return this.each(function(){
> > > this.value += txt;
> > > });
>
> > > };- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: scope question

2007-12-04 Thread sawmac



> The function assigned to init plus the reference to a variable defined
> outside of it ('me') is called a closure. You'll see people use 'self
> = this' or '$this = $(this)' for this purpose frequently.

Thanks Danny,

Great explanation.

--dave


[jQuery] A secure way to save on unload

2007-12-04 Thread Giovanni Battista Lenoci

Hi, I'm using php and ajax calls to save content of a form and I'm
wondering if there is a secure way to save a form also on the unload
of the page.

>From a book that I have:

the event fires before the document goes away, don't burden the event
handler with
time-consuming tasks, such as generating new objects or submitting a
form. The
document will probably go away before the function completes, leaving
the function
looking for objects and values that no longer exist. The best defense
is to keep
your onUnload event handler processing to a minimum.

There's maybe a workaround?

Thank you



[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Ole Laursen

On Dec 4, 3:11 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> Just off the top of my head.
>
> 1) I'd like to see some sort of background color for the labels in the top
> right. The text overlaps the lines and make it a little tough to read. At
> least an option for it.

One of the loose ends. I've just now committed to SVN support for the
options backgroundColor and backgroundOpacity for the legend. The
default is to use an opacity of 85% and try to guess the color.

I'll fix a couple of other things I'm a bit dissatisfied with when I'm
done writing the API documentation and then make another release.

> That's really it. This is QUITE impressive and I can easily see uses for
> this.

Thanks. :-)

--
Ole Laursen
http://people.iola.dk/olau/


[jQuery] Re: IE not triggering change event on dynamically added html

2007-12-04 Thread m j

I figured it had to be possible some way. Thank you for pointing me in
the right direction.


On Dec 4, 7:55 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> This FAQ topic should help:
>
> http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...
>
> Also, for cloning elements using jQuery 1.2, you can use .clone(true)  
> to copy the events along with the elements. See:
>
> http://docs.jquery.com/Manipulation/clone#true
>
> Hope that helps.
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Dec 4, 2007, at 1:05 AM, m j wrote:
>
>
>
>
>
> > I am using JQuery and JQuery UI. I'm using tabs from the UI part.
>
> > I'm trying to build a form dynamically adding and removing input
> > elements on the fly. I would expect someone else has tried this
> > before, and that there is an existing implementation somewhere that
> > works.
>
> > Here is a page with my example problem:
> >http://www.shelfnet.com/new_tab_form_test/new_tab_form_test.html
>
> > In my examples I've tried doing this three different ways. The third I
> > know I must be doing something wrong because IE at least dumps an
> > error, and so does FireFox. The first two examples work perfectly in
> > FireFox, but when you add a new tab and it clones the HTML from the
> > first tab IE doesn't cooperate with adding the change event to the new
> > HTML.
>
> > With Example 1, this was my first attempt and I noticed some odd
> > behavior on IE where the JQuery call to the element's attribute name
> > returns the new value, but if you try and get the .html() from the
> > element it reflects the change to the name element as not having any
> > effect. I'm not sure what is working and what's not. When I submitted
> > the form it seemed to send the changed names... so I'm guessing JQuery
> > might be doing a few things behind the scenes.
>
> > I thought I'd try changing the name attributes in the HTML before it
> > got added to the DOM, so in Example 2 and 3 I use a regex to modify
> > the name element before the HTML is appended. In the end the affect
> > appears to be good across the board, but it still doesn't trigger the
> > change events on the form elements.
>
> > In Example 3 I made an ATTEMPT, though unsuccessful, to include an
> > onclick attribute in the actual HTML of the select element to call a
> > javascript function, but I must not be referencing the function name
> > correctly. At least IE triggers it though because it spits out an
> > error.- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: jChess

2007-12-04 Thread aldur

does anyone kow how to go about gettnig acces to upload this to the
JQuery repository


[jQuery] Re: jChess

2007-12-04 Thread aldur

still got some work to do rewrote most of it today at lunch time Omega
chess is a bugger to code.  also teh code to checking a Checkmate has
happened has cancelled the ability to add  + on the notation for check
for some reason.


[jQuery] Re: jQuery taking a second or two to load?

2007-12-04 Thread Priest, James (NIH/NIEHS) [C]

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 

> // regular toggle with speed of 'default'
> $('#toggle_atRisk').click(function(){
> $('#atRisk').toggle('default');

'default' is not a valid speed?  

Speed:  A string representing one of the three predefined speeds
("slow", "normal", or "fast") or the number of milliseconds to run the
animation (e.g. 1000).

Event:  http://docs.jquery.com/Events/toggle#fnfn

Effect:  http://docs.jquery.com/Effects/toggle

Jim


[jQuery] jQuery taking a second or two to load?

2007-12-04 Thread [EMAIL PROTECTED]

Hi guys,

Not sure if I'm just being fussy, but I'm running jQuery on an
intranet site, and pages normally load almost instantly, even taking
to account my own shoddy Javascript.

Whilst using jQuery, it takes sometimes up to two seconds to load a
page and I'm not sure why. Could it be because I'm using the
compressed version? Or are my calls to the functions breaking it?

I've got something basic, quite simply:


// initialize the jquery code
 $(document).ready(function(){
//close all the content divs on page load
$('#atRisk').hide();
$('#criteria').hide();

// regular toggle with speed of 'default'
$('#toggle_atRisk').click(function(){
$('#atRisk').toggle('default');
});
// toggles the same div as above when the user clicks the
checkbox
$('#StaffNoOKPart1').click(function(){
$('#atRisk').toggle('default');
});

// regular toggle with speed of 'default'
$('#toggle_criteria').click(function(){
$('#criteria').toggle('default');
});
// toggles the same div as above when the user clicks the
checkbox
$('#StaffNoOKPart2').click(function(){
$('#criteria').toggle('default');
});
});


Am I doing something wrong? Or does jQuery generally take a second or
two to load?

Thanks


[jQuery] IE not triggering change event on dynamically added html

2007-12-04 Thread m j

I am using JQuery and JQuery UI. I'm using tabs from the UI part.

I'm trying to build a form dynamically adding and removing input
elements on the fly. I would expect someone else has tried this
before, and that there is an existing implementation somewhere that
works.

Here is a page with my example problem:
http://www.shelfnet.com/new_tab_form_test/new_tab_form_test.html

In my examples I've tried doing this three different ways. The third I
know I must be doing something wrong because IE at least dumps an
error, and so does FireFox. The first two examples work perfectly in
FireFox, but when you add a new tab and it clones the HTML from the
first tab IE doesn't cooperate with adding the change event to the new
HTML.

With Example 1, this was my first attempt and I noticed some odd
behavior on IE where the JQuery call to the element's attribute name
returns the new value, but if you try and get the .html() from the
element it reflects the change to the name element as not having any
effect. I'm not sure what is working and what's not. When I submitted
the form it seemed to send the changed names... so I'm guessing JQuery
might be doing a few things behind the scenes.

I thought I'd try changing the name attributes in the HTML before it
got added to the DOM, so in Example 2 and 3 I use a regex to modify
the name element before the HTML is appended. In the end the affect
appears to be good across the board, but it still doesn't trigger the
change events on the form elements.

In Example 3 I made an ATTEMPT, though unsuccessful, to include an
onclick attribute in the actual HTML of the select element to call a
javascript function, but I must not be referencing the function name
correctly. At least IE triggers it though because it spits out an
error.


[jQuery] Re: how to append() to a textarea

2007-12-04 Thread cfdvlpr

OK, I tried $("#utmtrans").val($("#utmtrans").val() + 'test');

Here's the HTML before this gets called:






And here's what I see when I "view generated source" with the firefox
add on web developer toolbar.:







test, does not get appended there.  I actually don't need to append
the text, but I need to simply add it.  .html() didn't seem to work.
Anything else I can try?




On Dec 3, 9:11 pm, David Serduke <[EMAIL PROTECTED]> wrote:
> I'd try
>
> $("textarea").val($("textarea").val() + txt);
>
> David
>
> On Dec 3, 4:27 pm, cfdvlpr <[EMAIL PROTECTED]> wrote:
>
> > append() doesn't seem to work.   I also tried this function that was
> > mentioned in another thread here by John and that doesn't seem to work
> > for me either.  Anyone else got this to work?  What might I be
> > missing?
>
> > $.fn.appendVal = function(txt) {
> > return this.each(function(){
> > this.value += txt;
> > });
>
> > };- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Thickbox does not apply css in Safari 3

2007-12-04 Thread [EMAIL PROTECTED]

Hi,

I have a html which has css elements like:


label {margin-bottom:10px;}
input {margin-bottom:10px;}


when this page is popup up with thickbox, it works except the css does
not apply to the related elements, if I display the page without
thickbox, everything works, any idea why? Thanks,

A.C.


[jQuery] Re: Tablesorter 2.0.1 removing rows and resorting

2007-12-04 Thread Adam Kroll

Figured my problem out.  I placed in the wrong place in my code.
Happy to say it works perfectly when I put it where it's supposed to
go.


[jQuery] Re: jChess

2007-12-04 Thread Rey Bango


I would love to see this app. :)

Rey

aldur wrote:

I've written a jQuery app that will draw a chess board and let you
play chess currently requires two players on the same computer.  will
be updating it to use a server via AJAX to allow you to challenge
friends to a game online.

Current games available {standard chess:8x8, Omega chess:10x10 & Grand
chess:10x10}  check out wikipedia  for what they are.

I'll soon be wanting to release the first version of the plugin which
lets you choose what type of game you want to play but I would love to
upload to the jQuery repository.




[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Stefan Petre
Swt and useful . I like it so much.

2007/12/4, Ole Laursen <[EMAIL PROTECTED]>:
>
>
> Hi!
>
> I've just released Flot 0.1, a brand-new plot plugin for jQuery which
> focuses on simple usage, attractive looks and interactive features
> like zooming. It's like plotr and Plotkit, but hopefully a bit more
> intelligent when it comes to auto-adjusting axes.
>
> The project page is here:
>
>   http://code.google.com/p/flot/
>
> And examples are here:
>
>   http://people.iola.dk/olau/flot/examples/
>
> I also posted about the news on my blog:
>
>   http://ole-laursen.blogspot.com/2007/12/flot-01-released.html
>
> I'm in the midst of writing the API documentation, but the examples
> should hopefully get you started and the available settings are
> documented in the source code at the top of the file.
>
> --
> Ole Laursen
> http://people.iola.dk/olau/
>


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Andy Matthews

Just off the top of my head.

1) I'd like to see some sort of background color for the labels in the top
right. The text overlaps the lines and make it a little tough to read. At
least an option for it.

That's really it. This is QUITE impressive and I can easily see uses for
this.

Thanks for releasing it to the community!


andy matthews

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ole Laursen
Sent: Tuesday, December 04, 2007 6:04 AM
To: jQuery (English)
Subject: [jQuery] Ann: Flot 0.1 released


Hi!

I've just released Flot 0.1, a brand-new plot plugin for jQuery which
focuses on simple usage, attractive looks and interactive features like
zooming. It's like plotr and Plotkit, but hopefully a bit more intelligent
when it comes to auto-adjusting axes.

The project page is here:

  http://code.google.com/p/flot/

And examples are here:

  http://people.iola.dk/olau/flot/examples/

I also posted about the news on my blog:

  http://ole-laursen.blogspot.com/2007/12/flot-01-released.html

I'm in the midst of writing the API documentation, but the examples should
hopefully get you started and the available settings are documented in the
source code at the top of the file.

--
Ole Laursen
http://people.iola.dk/olau/




[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Feed

AWESOME work, congratulations and thanks for sharing.

On Dec 4, 9:04 am, Ole Laursen <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've just released Flot 0.1, a brand-new plot plugin for jQuery which
> focuses on simple usage, attractive looks and interactive features
> like zooming. It's like plotr and Plotkit, but hopefully a bit more
> intelligent when it comes to auto-adjusting axes.
>
> The project page is here:
>
>  http://code.google.com/p/flot/
>
> And examples are here:
>
>  http://people.iola.dk/olau/flot/examples/
>
> I also posted about the news on my blog:
>
>  http://ole-laursen.blogspot.com/2007/12/flot-01-released.html
>
> I'm in the midst of writing the API documentation, but the examples
> should hopefully get you started and the available settings are
> documented in the source code at the top of the file.
>
> --
> Ole Laursenhttp://people.iola.dk/olau/


[jQuery] Re: :empty pseudo-class and whitespaces

2007-12-04 Thread Karl Swedberg


On Dec 4, 2007, at 12:23 AM, Christoph Roeder wrote:



Thanks, I think this is much better.

Chris

On Dec 3, 3:03 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:

Does that help clarify it? If not, feel free to edit it directly in
the wiki or reply to this with a suggestion for revision.


excellent. Glad to help.


[jQuery] Re: Problem in delete cookie with jQuery Cookie plugin

2007-12-04 Thread Klaus Hartl

On 4 Dez., 14:01, Leandro Vieira Pinho <[EMAIL PROTECTED]>
wrote:
> Yes Klaus,
>
> The code is ok, but the cookie isn´t deleting, and I don´t know why?

I don't know either. Works for me. Maybe something is wrong with the
cookie name. Or some JavaScript error on the page. I can only guess...

--Klaus


[jQuery] Re: IE not triggering change event on dynamically added html

2007-12-04 Thread Karl Swedberg


This FAQ topic should help:

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

Also, for cloning elements using jQuery 1.2, you can use .clone(true)  
to copy the events along with the elements. See:


http://docs.jquery.com/Manipulation/clone#true

Hope that helps.


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



On Dec 4, 2007, at 1:05 AM, m j wrote:



I am using JQuery and JQuery UI. I'm using tabs from the UI part.

I'm trying to build a form dynamically adding and removing input
elements on the fly. I would expect someone else has tried this
before, and that there is an existing implementation somewhere that
works.

Here is a page with my example problem:
http://www.shelfnet.com/new_tab_form_test/new_tab_form_test.html

In my examples I've tried doing this three different ways. The third I
know I must be doing something wrong because IE at least dumps an
error, and so does FireFox. The first two examples work perfectly in
FireFox, but when you add a new tab and it clones the HTML from the
first tab IE doesn't cooperate with adding the change event to the new
HTML.

With Example 1, this was my first attempt and I noticed some odd
behavior on IE where the JQuery call to the element's attribute name
returns the new value, but if you try and get the .html() from the
element it reflects the change to the name element as not having any
effect. I'm not sure what is working and what's not. When I submitted
the form it seemed to send the changed names... so I'm guessing JQuery
might be doing a few things behind the scenes.

I thought I'd try changing the name attributes in the HTML before it
got added to the DOM, so in Example 2 and 3 I use a regex to modify
the name element before the HTML is appended. In the end the affect
appears to be good across the board, but it still doesn't trigger the
change events on the form elements.

In Example 3 I made an ATTEMPT, though unsuccessful, to include an
onclick attribute in the actual HTML of the select element to call a
javascript function, but I must not be referencing the function name
correctly. At least IE triggers it though because it spits out an
error.




[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Jeferson Koslowski
Wow, looks nice. Great work.

On Dec 4, 2007 11:48 AM, Richard D. Worth <[EMAIL PROTECTED]> wrote:

> Beautiful stuff. Nice work! I'll be using this for sure.
>
> - Richard
>
>
> On Dec 4, 2007 7:04 AM, Ole Laursen <[EMAIL PROTECTED]> wrote:
>
> >
> > Hi!
> >
> > I've just released Flot 0.1, a brand-new plot plugin for jQuery which
> > focuses on simple usage, attractive looks and interactive features
> > like zooming. It's like plotr and Plotkit, but hopefully a bit more
> > intelligent when it comes to auto-adjusting axes.
> >
> > The project page is here:
> >
> >  http://code.google.com/p/flot/
> >
> > And examples are here:
> >
> >  http://people.iola.dk/olau/flot/examples/
> >
> > I also posted about the news on my blog:
> >
> >   http://ole-laursen.blogspot.com/2007/12/flot-01-released.html
> >
> > I'm in the midst of writing the API documentation, but the examples
> > should hopefully get you started and the available settings are
> > documented in the source code at the top of the file.
> >
> > --
> > Ole Laursen
> > http://people.iola.dk/olau/
> >
>
>


[jQuery] Re: Ann: Flot 0.1 released

2007-12-04 Thread Richard D. Worth
Beautiful stuff. Nice work! I'll be using this for sure.

- Richard

On Dec 4, 2007 7:04 AM, Ole Laursen <[EMAIL PROTECTED]> wrote:

>
> Hi!
>
> I've just released Flot 0.1, a brand-new plot plugin for jQuery which
> focuses on simple usage, attractive looks and interactive features
> like zooming. It's like plotr and Plotkit, but hopefully a bit more
> intelligent when it comes to auto-adjusting axes.
>
> The project page is here:
>
>  http://code.google.com/p/flot/
>
> And examples are here:
>
>  http://people.iola.dk/olau/flot/examples/
>
> I also posted about the news on my blog:
>
>  http://ole-laursen.blogspot.com/2007/12/flot-01-released.html
>
> I'm in the midst of writing the API documentation, but the examples
> should hopefully get you started and the available settings are
> documented in the source code at the top of the file.
>
> --
> Ole Laursen
> http://people.iola.dk/olau/
>


[jQuery] Ann: Flot 0.1 released

2007-12-04 Thread Ole Laursen

Hi!

I've just released Flot 0.1, a brand-new plot plugin for jQuery which
focuses on simple usage, attractive looks and interactive features
like zooming. It's like plotr and Plotkit, but hopefully a bit more
intelligent when it comes to auto-adjusting axes.

The project page is here:

  http://code.google.com/p/flot/

And examples are here:

  http://people.iola.dk/olau/flot/examples/

I also posted about the news on my blog:

  http://ole-laursen.blogspot.com/2007/12/flot-01-released.html

I'm in the midst of writing the API documentation, but the examples
should hopefully get you started and the available settings are
documented in the source code at the top of the file.

--
Ole Laursen
http://people.iola.dk/olau/


[jQuery] jChess

2007-12-04 Thread aldur

I've written a jQuery app that will draw a chess board and let you
play chess currently requires two players on the same computer.  will
be updating it to use a server via AJAX to allow you to challenge
friends to a game online.

Current games available {standard chess:8x8, Omega chess:10x10 & Grand
chess:10x10}  check out wikipedia  for what they are.

I'll soon be wanting to release the first version of the plugin which
lets you choose what type of game you want to play but I would love to
upload to the jQuery repository.



[jQuery] Re: passing parameter to anonymous function ( frameready )

2007-12-04 Thread polutan

hello... please help me... :)
thx u..

2007/12/4, Linspirell <[EMAIL PROTECTED]>:
>
> Hello everyone :) i'am a newcomer here :)
> i have a problem with using JQuery and frameready plugin.
> i need to modify dom elemen especially the css. i have a iframe in my
> main document.
>
> this is my javascript code with jquery and frameready plugin
>
> function changeColor(evt) {
> var color = evt.value;
> $.frameReady(function() {
> $('h2.pagetitle').css('color', color);
> }, "common");
> }
> "common" is my iframe name
> this link is about frameready plugin 
> http://ideamill.synaptrixgroup.com/?page_id=18
>
> i need to pass a color value that i got from here :
>  size="10" maxlength="15" onfocus="changeColor(this);"/>
>
> but the error console always showing message ' color is not defined'
>
> thx you...
>


[jQuery] The click event and Ajax (Problem)

2007-12-04 Thread [EMAIL PROTECTED]

Hi,

I am sure this is a pretty basic question but I have the following
problem.
When I try to load content into a div container with AJAX, the content
just loads for a split second and disappears or unloads itself again.
It seems that the click event only works when the actual click is
performed. Do I have to use another event or what is the problem?

$(document).ready(function() {

   $("#mylink").click(function(){
  $("#mydiv").load("content.html");
   });

});

Thanks.


alex


[jQuery] Automatically reading out the plugins used on a page

2007-12-04 Thread C.P.A.

Dear reader,

I would like to know if there is a solution for the following:

Suppose I have within one website 15 plugin's I used. However, not
each page uses all 15 of them, on average let's say each page uses 2
or 3 plugin's only. It would be wonderful if jquery determined which
plugins it needs for the current page and writes out which plugin's to
include afore loading the page any further.

Thus instead of writing out all the ... jquery does
so for you - managing http requests much more effectively and reducing
the page load drastically.

Who can advise me about this? - and if you do know a solution, please
inform me where to get it.

Yours sincerely,

CPA


[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread e2e

On Dec 4, 1:20 am, Wizzud <[EMAIL PROTECTED]> wrote:
> That would be because your $(':input', this) selector is selecting
> *every* input field in your form and adding it to your inputs array.
> One solution is to put a test in your each() function to see if the
> field is a checkbox or radio, and if it is, only add it to your inputs
> array if it's checked.
Is there a simple way to do that?

> On Dec 3, 11:24 am,e2e<[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I use this function to submit my post requests. But now I have a
> > problem with radio buttons and checkboxes. It sends all button values
> > to server, so the last radio buttons' (even it's not checked) value
> > passes as value. checkboxes are same, even it's not checked, it sends
> > checked value.
>
> > $("form#profile_form").submit(function() {
> > $("#users_profile h1").after('');
> > $("#users_profile .errors").remove()
> > var inputs = [];
> > $(':input', this).each(function() {
> > inputs.push(this.name + '=' + unescape(this.value));
> > });
> > $.ajax({
> > type : "POST",
> > data : inputs.join('&'),
> > url : "tasks.php?task=updateprofile",
> > success : function(msg) {
> > $("#users_profile .loading").remove();
> > if(msg == "ok") {
> > $("#profile_form").remove();
> > $("#users_profile h1").after(' > class="message m_info">Profile
> > updated!');
> > } else {
> > $("#users_profile h1").after(msg);
> > }
> > }
> > });
> > return false;
> > });


[jQuery] WYMeditor: placing cursor in editor frame

2007-12-04 Thread Hydro007

Hi,

I want my WYMeditor instance to have the cursor placed in the
beginning of the editor, currently you must click the content before
the cursor gets added. Does anyone know is this is possible and how?

kind regards,
Lex


[jQuery] Re: dataType & POST

2007-12-04 Thread Jean-Sébastien

please i really need help, i can't tottally remove prototype.js from
my rails app if i can't send ajax request with datatype: 'script' and
type POST. i just want to know if it's possible or not.

On Dec 3, 4:00 pm, "Jean-Sébastien" <[EMAIL PROTECTED]>
wrote:
> (i post this message again i've posted it 2 hours ago but it didn't
> appear yet.)
>
> in jquery doc is written : warning "script" will turn posts into gets
> so, is there a way to send POST or DELETE or PUT ajax query with
> datatype: 'script'?
>
>   regards


[jQuery] Re: calling ajax with url parameter

2007-12-04 Thread Yılmaz Uğurlu
Here is simple solution.


$(document).ready(function() {
$('#item1').click(function() {
// access href attribute of clicked link => process.php?a=1&b=2
var params = $(this).attr("href");
// split href content at ? sign => process.php and a=1&b=2
params  = params.split("?");
// first element file name, second element url parameters
$('#result').load( params[0] , { params[1] } );
return false;
});
});


I make it out quickly, maybe someone write better than this. But i think
this is good for you :-)
2007/12/4, dimmex <[EMAIL PROTECTED]>:
>
>
> Hello,
>
> I'm pretty new to jQuery and want to implement some ajax.
>
> I have a html like this:
> click here
> 
>
> After learning jQuery a little while, I got the way to call ajax
> something like this:
>
> $(document).ready(function() {
> $('#item1').click(function() {
> $('#result').load('process.php', {parameters will be passed here});
> return false;
> });
> });
>
> from what I learnt, the parameters will be passed in format: {'a' :
> value, 'b': value}
>
> My question, can I get the href part or specifically only the
> parameter (only 'a=1&b=2') and passing it and in my process.php I can
> access it just like $_POST variables ( $_POST['a'] and
> $_POST['b'] ) ?  what jQuery function do I need to do that? what I'm
> thinking is something like $('#result').load('process.php',
> extract(getparameter(url)));
>
> I hope my question is clear enough :) any help is appreciated.
>
> Thanks.
> Dimm
>



-- 
Yılmaz Uğurlu ~ jabber : [EMAIL PROTECTED]  ~ http://www.2nci.com ~ İzmir


[jQuery] Documentation of datatype map

2007-12-04 Thread Mario Wolff

Hello all,
i'm new to jquery and i'm very happy with it! Thaks to the developers!

I have a "missing documentation hint". The datatype "map", for example
used in $.get(url,data,callback) for data, is documented as "Key/value
pairs that will be sent to the server.". What is missing is the
possibility to us an array as value. Looking thru the code told me,
that in this case the key will be repeated.
Using PHP at the serverside you can use the "[]" to declare the key as
array - known from checkboxes and multiple-selects.

Using:

var data={'key[]':["foo","bar"]}

in jquery, would be:

$_GET['key'][0]="foo"; $_GET['key'][0]="bar";

in PHP.

Maybe that hint is useful for someone or get's included to the documentation.

Regards,
Mario Wolff


[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread e2e

Changing my function to this solved my problem:
$("form#profile_form").submit(function() {
$("#users_profile h1").after('');
$("#users_profile .errors").remove()
var inputs = [];
$(':input', this).each(function() {
if(this.name == "gender") {
var val = $("[EMAIL PROTECTED]:checked").val();
inputs.push(this.name + '=' + unescape(val));
} else if(this.name == "private") {
var val = $("[EMAIL PROTECTED]:checked").val();
inputs.push(this.name + '=' + unescape(val));
} else {
inputs.push(this.name + '=' + unescape(this.value));
}

});
$.ajax({
type : "POST",
data : inputs.join('&'),
url : "/sp/tasks.php?task=updateprofile",
success : function(msg) {
$("#users_profile .loading").remove();
if(msg == "ok") {
$("#profile_form").remove();
$("#users_profile h1").after('Profiliniz güncellendi!');
} else {
$("#users_profile h1").after(msg);
}
}
});
return false;
});

If there is a better way please tell me.

On Dec 4, 1:20 am, Wizzud <[EMAIL PROTECTED]> wrote:
> That would be because your $(':input', this) selector is selecting
> *every* input field in your form and adding it to your inputs array.
> One solution is to put a test in your each() function to see if the
> field is a checkbox or radio, and if it is, only add it to your inputs
> array if it's checked.
>
> On Dec 3, 11:24 am,e2e<[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I use this function to submit my post requests. But now I have a
> > problem with radio buttons and checkboxes. It sends all button values
> > to server, so the last radio buttons' (even it's not checked) value
> > passes as value. checkboxes are same, even it's not checked, it sends
> > checked value.
>
> > $("form#profile_form").submit(function() {
> > $("#users_profile h1").after('');
> > $("#users_profile .errors").remove()
> > var inputs = [];
> > $(':input', this).each(function() {
> > inputs.push(this.name + '=' + unescape(this.value));
> > });
> > $.ajax({
> > type : "POST",
> > data : inputs.join('&'),
> > url : "tasks.php?task=updateprofile",
> > success : function(msg) {
> > $("#users_profile .loading").remove();
> > if(msg == "ok") {
> > $("#profile_form").remove();
> > $("#users_profile h1").after(' > class="message m_info">Profile
> > updated!');
> > } else {
> > $("#users_profile h1").after(msg);
> > }
> > }
> > });
> > return false;
> > });


[jQuery] Re: Ajax seems to be running fine, but is running the 'error' function. What am I doing wrong?

2007-12-04 Thread Shawn

I was getting a similar problem when asking for a JSON response 
(dataType: "json").  My issue was either that I had a subtle bug in the 
success function, or my resulting JSON wasn't quite right.  I've been 
able to avoid the problem by making sure my JSON property names are in 
quotes (i.e. { "name" : "bob" }  ).  I also had to make sure that the 
data I was pulling from my database wasn't inserting hidden characters 
in my strings (unicode, carriage returns, etc.).  Luckily I'm using PHP 
and Cold Fusion so can use addslashes() and jsstringformat() respectively.

In your particular case, it looks like you are getting HTML back.  Are 
you sure your HTML is valid?  Did you remove everything from your 
success function and just put in an alert("hello"); type statement? (see 
if you are even getting there).  If that alert doesn't go, then you KNOW 
the problem is in your results.  If you see the alert, then you can then 
try to alert(msg), and see what you get.  (basically, start the process 
of figuring out if it's your function, or your resulting data).  Chances 
are it's in the data though.  I don't see any glaring errors in your code.

HTH some

Shawn

Chris - Implied By Design wrote:
> I have an Ajax function I'm using to test right now. When the function
> is called (upon a click), it runs the function, but displays the
> "Error, please try again" message. In Firebug, it looks like the
> function is returning the correct msg. I was using 1.0.2 (I think)
> where it worked, minus the replaceWith function, and then I upgraded
> to 1.1.2 and now it's showing the error message.
> 
> Here's the function below, any ideas on what I'm doing wrong?
> 
> function testAjax(id,page,sort) {
>   $.ajax({
>   url: 'ajaxtable/refresh',
>   type: 'GET',
>   data: 'id=' + id + '&page=' + page + 
> '&sort=' + sort,
>   error: function(){
>   alert('Error, please 
> try again');
>   },
>   success: function(msg){
>   
> $('div').replaceWith('Test' );
>   alert(msg);
> 
>   }
>   });
>   }
> 
> 
> Thanks!


[jQuery] Home page first visit popup window creation

2007-12-04 Thread PaulM

I would like to create a popup that would come out after visiting my
site for the first time.
How can I do this with jquery?

Thanks


[jQuery] Re: Problem in delete cookie with jQuery Cookie plugin

2007-12-04 Thread Leandro Vieira Pinho

Yes Klaus,

The code is ok, but the cookie isn´t deleting, and I don´t know why?

I have tried in FF and IE 6

Regards

On Dec 4, 8:16 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> On 4 Dez., 00:34, Wizzud <[EMAIL PROTECTED]> wrote:
>
> > Try setting expires to a negative number to delete the cookie.
>
> If the value is null, the value of expires doesn't matter at all. Of
> course it is obsolete in the function call.
>
> That's strange. I can't see anything wrong with the code and it
> couldn't reproduce a bug.
>
> --Klaus


[jQuery] Re: getScript making multiple calls

2007-12-04 Thread Feed

Thanks for the link Jörn, but I solved my problem... let me explain
again what the problem was: after loading new ajax content I had to
run the script in this newly loaded content, but instead of
duplicating the code and put as the FAQ suggested I wanted to run ALL
THE SCRIPT again, so I thought about loading the SAME file again in
the SUCCESS hook, but for some reason the script was being run
multiple times, the more I clicked the more the script was run...

1st click = run 1 time
2nd click = run 2 times
3rd click = run 4 times
4th click = run 8 times

and so on...

What I did to solve this is that I added an unbind command in the end
of my script, something like this, suppose this file is called
"scripts.js"

$(".button").click(function () {
var job = $(this).attr("id");
$.ajax({
  type: "GET",
  url: "results.asp",
  data: "job="+job,
  success: function(html){
  $("div#load").empty().append(html);
  $.getScript("scripts.js");  <-- HERE I RUN THIS
SAME FILE AGAIN ONCE THE CONTENT IS LOADED
  }
});
$(this).unbind('click');  <-- I HAD TO UNBIND THE CLICK TO
PREVENT MULTIPLE EXECUTION
});

Well, it worked as I wanted, the script it being run only one time per
request now but I STILL have no idea why the script was being run
multiple times each time I clicked, can someone explain the logic to
me please?

On Dec 3, 5:36 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Feed schrieb:> What am I doing wrong and how can I run the script on the part 
> of the
> > site which has been loaded by ajax?
>
> This should answer your 
> question:http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...
>
> Jörn


[jQuery] Re: using blockUI to block a select/dropdown list

2007-12-04 Thread Tom

Hi Mike

I figured as much from messing about with it but thanks for the
confirmation and the heads up re 'span'. It had slipped my mind and
will fit my needs more nicely than 'div'.

Thanks
Tom


On Dec 4, 1:09 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote:
> Hi Tom,
>
> That won't work with the current implementation of blockUI.  If you had a
> div or span around the select box then you could block that element.
>
> Mike
>
> On Dec 4, 2007 6:07 AM, Tom <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi
>
> > I am trying to use blockUI to block a select/dropdown list named
> > 'srv_voice' when an AJAX request is being processed.
>
> > Code is simply
>
> > $('select[name=srv_voice]').block();
>
> > I have used
>
> > $().ajaxStart($.blockUI).ajaxStop($.unblockUI);
>
> > to block the whole page so that part of the plugin works. Likewise I
> > have also blocked other div elements on the page. Why can I not block
> > this select box?
>
> > Does this plugin only support certain elements?
>
> > Thanks
> > Tom


[jQuery] Re: using blockUI to block a select/dropdown list

2007-12-04 Thread Mike Alsup
Hi Tom,

That won't work with the current implementation of blockUI.  If you had a
div or span around the select box then you could block that element.

Mike


On Dec 4, 2007 6:07 AM, Tom <[EMAIL PROTECTED]> wrote:

>
> Hi
>
> I am trying to use blockUI to block a select/dropdown list named
> 'srv_voice' when an AJAX request is being processed.
>
> Code is simply
>
> $('select[name=srv_voice]').block();
>
> I have used
>
> $().ajaxStart($.blockUI).ajaxStop($.unblockUI);
>
> to block the whole page so that part of the plugin works. Likewise I
> have also blocked other div elements on the page. Why can I not block
> this select box?
>
> Does this plugin only support certain elements?
>
> Thanks
> Tom
>


[jQuery] Re: Tablesorter 2.0.1 removing rows and resorting

2007-12-04 Thread Christian Bach
Nope, nothing wrong in what you are doing.

Just make sure that trigger is called on the table and not the row.

Ex.

$("table").trigger("update");

/c


2007/12/3, Adam Kroll <[EMAIL PROTECTED]>:
>
>
> I'm having problems with tablesorter 2.0.1 and removing rows.  I'm
> allowing users to remove rows, and after a removing a row using a call
> to remove() I'm calling trigger("update"), but if I remove a row and
> then resort it brings back the row I just removed.
>
> It looks like trigger("update") rebuilds the cache which should ignore
> the row I just removed, but it always comes back.
>
> Any ideas, or am I just totally missing something here?
>


[jQuery] using blockUI to block a select/dropdown list

2007-12-04 Thread Tom

Hi

I am trying to use blockUI to block a select/dropdown list named
'srv_voice' when an AJAX request is being processed.

Code is simply

$('select[name=srv_voice]').block();

I have used

$().ajaxStart($.blockUI).ajaxStop($.unblockUI);

to block the whole page so that part of the plugin works. Likewise I
have also blocked other div elements on the page. Why can I not block
this select box?

Does this plugin only support certain elements?

Thanks
Tom


[jQuery] Re: calling ajax with url parameter

2007-12-04 Thread Feijó


I like to set my own attributes, like that


click here



$(document).ready(function() {
 $('#item1').click(function() {
   $('#result').load('process.php', {a: $(this).attr('a'), b: 
$(this).attr('b') });

return false;
 });
});



hugs
Feijó


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

To: "jQuery (English)" 
Sent: Tuesday, December 04, 2007 3:53 AM
Subject: [jQuery] calling ajax with url parameter




Hello,

I'm pretty new to jQuery and want to implement some ajax.

I have a html like this:
click here


After learning jQuery a little while, I got the way to call ajax
something like this:

$(document).ready(function() {
$('#item1').click(function() {
$('#result').load('process.php', {parameters will be passed here});
return false;
});
});

from what I learnt, the parameters will be passed in format: {'a' :
value, 'b': value}

My question, can I get the href part or specifically only the
parameter (only 'a=1&b=2') and passing it and in my process.php I can
access it just like $_POST variables ( $_POST['a'] and
$_POST['b'] ) ?  what jQuery function do I need to do that? what I'm
thinking is something like $('#result').load('process.php',
extract(getparameter(url)));

I hope my question is clear enough :) any help is appreciated.

Thanks.
Dimm




[jQuery] Re: Problem in delete cookie with jQuery Cookie plugin

2007-12-04 Thread Klaus Hartl

On 4 Dez., 00:34, Wizzud <[EMAIL PROTECTED]> wrote:
> Try setting expires to a negative number to delete the cookie.

If the value is null, the value of expires doesn't matter at all. Of
course it is obsolete in the function call.

That's strange. I can't see anything wrong with the code and it
couldn't reproduce a bug.


--Klaus


[jQuery] Re: which query is most efficient?

2007-12-04 Thread Erik Beeson
console.time("$('p span')");
for(var i = 0; i < 1000; i++) $('p span');
console.timeEnd("$('p span')");

console.time("$('p').find('span')");
for(var i = 0; i < 1000; i++) $('p').find('span');
console.timeEnd("$('p').find('span')");

$('p span'): 863ms
$('p').find('span'): 3050ms

And from the profiler:

$('p span'): 390 function calls $('p').find('span'): 830 function calls

Though the function is always "e", so it isn't very useful for actual
profiling, but at least it gives you an idea of how much work is being done.

--Erik


On 12/4/07, Gordon <[EMAIL PROTECTED]> wrote:
>
>
> I couldn't tell you which one is faster, but if you want to find out
> for yourself then you can use the profiler in FireBug.  It's an addon
> for FireFox that has some powerful javascrip tools included.  Write a
> short script with a function that runs the selector you want to
> profile in a loop, say 100 iterations, and then call it while the
> profiler is running.
>
> On Dec 3, 10:58 pm, sawmac <[EMAIL PROTECTED]> wrote:
> > is there a difference in performance for these two:
> >
> > $('p span')
> >
> > $('p').find('span')
> >
> > while, I'm on the subject, what's a good way to test performance of
> > queries (and scripts in general)
> >
> > thanks
> >
> > --dave
>


  1   2   >