[jQuery] Re: Using setTimeout()

2007-09-03 Thread barophobia

On 9/2/07, Michael Geary [EMAIL PROTECTED] wrote:
  Is that the wrong progression?

 Yes. You left out the setTimeout, which is never canceled. (And step 4
 doesn't happen either - nobody cancels the ajaxStart - that function has
 already been called.)

 Assume the AJAX request takes 75 milliseconds. Then, the code in
 http://www.pastebin.ca/678318 goes like this:

Great. Thanks for the explanation.



Chris.


[jQuery] Re: Using setTimeout()

2007-09-02 Thread barophobia

On 9/1/07, Michael Geary [EMAIL PROTECTED] wrote:

 Also, it looks like you have a race condition. What happens if the entire
 AJAX request completes in less than 100 milliseconds?

I assumed that $.ajaxStart() would be canceled and $.ajaxStop() would execute.

I looked over your code but I don't see how the flag (called active)
changes anything. Would you explain?


Thanks,
Chris.


[jQuery] Using setTimeout()

2007-09-01 Thread barophobia

Hello,

I'm trying to delay the appearance of $.ajaxStart() using setTimeout()
but I've been unable to get it to work.

I've used it once before in something else and I'm basically just
trying to copy that for $.ajaxStart().

http://www.pastebin.ca/678318

When I run that code I get t has no properties,
jquery-1.1.4-compressed.js line 11.

How do I do this properly?


On a related note, what would be really great is a delay option for
$.ajaxStart() itself. My goal is simply to delay the appearance of the
Loading... div until the ajax calls runs beyond a set time limit.


Thanks,
Chris.


[jQuery] Re: Why is the + being turned into a space?

2007-08-27 Thread barophobia

On 8/26/07, Erik Beeson [EMAIL PROTECTED] wrote:
 The reason this is happening to you when you use ajax is because when
 you pass a String as the data parameter, it is assumed that it's
 already escaped. When you don't use ajax, the browser takes care of
 escaping the + for you (it is escaped as %2B). To fix your problem,
 you need to change line 9 and wrap this.value in
 encodeURIComponent(this.value).

Thanks. That did it.



Chris.


[jQuery] Why is the + being turned into a space?

2007-08-26 Thread barophobia

Hello,

I'm having a weird issue with data being passed through $.ajax. If I
submit my form through normal means I do not witness the unexpected
behavior. Only when I submit the form through $.ajax does it happen.

The problem is that I'm trying to submit an email address with a +
sign in it. Firebug even says that I'm submitting
[EMAIL PROTECTED] but PHP says that I've submitted email
[EMAIL PROTECTED].

It would seem that this is PHP's fault since Firebug reports the
correct data. But that's why this is so weird. When I take $.ajax out
of the loop PHP says that I have submitted [EMAIL PROTECTED].

Here is the jQuery code I am working with:

http://www.pastebin.ca/671971

Maybe it's really simple and I just don't see it?



Thanks,
Chris.


[jQuery] Re: Fwd: jQuery and UTF8

2007-08-23 Thread barophobia

Just wanted to let everyone know that I finally got this solved.

And thanks to everyone for the help. There were several issues pointed
out in this thread that helped me to build a more solid UTF-8
compliant app.

So... the MAJOR problem I was having was in the jQuery code itself. It
was the reason data was being stored as %u55DC (and things that looked
like that). I got some code from a site that had some precautionary
escaping going on. Once I removed the escape() function I started to
see things being stored correctly.


Thanks again!
Chris.


[jQuery] Re: Fwd: jQuery and UTF8

2007-08-21 Thread barophobia

On 8/21/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote:

I had work with lot of UTF-8 and had no problem:
 1. You don't have font?
 2. or Your current charset is different from one that is been loaded?
 3. or Do you have any link for me to check?

1. I do have the font. It appears correctly when not being loaded through AJAX.
2. UTF-8 is the charset of the data.
3. Thanks for trying to help me with this but unfortunately I don't
have a link I can provide.

I'll just have to do some more experiments when I get home. I'm pretty
certain the answer is going to be rather simple and I'm just
overlooking it right now.



Chris.


[jQuery] Re: Fwd: jQuery and UTF8

2007-08-20 Thread barophobia

On 8/20/07, Bil Corry [EMAIL PROTECTED] wrote:

 Your server should be sending this as the content-type if serving UTF-8:

   text/html; charset=UTF-8

 Otherwise, you're leaving it up to the browser to decipher the charset.

Thanks for the info but I have some questions still.

1. Why do you think the standard pages work fine?
2. What about the issue I'm having sending the data? How do I get the
UTF-8 text to be recorded properly when submitted via an AJAX call?


Thanks again for your response!
Chris.


[jQuery] Re: Fwd: jQuery and UTF8

2007-08-20 Thread barophobia

On 8/20/07, Bil Corry [EMAIL PROTECTED] wrote:

 barophobia wrote on 8/20/2007 11:58 AM:
  1. Why do you think the standard pages work fine?

 Do you have a meta tag defining the charset?  Most likely that wouldn't be 
 present in an AJAX call but would tell the browser the correct charset.

You're right about that. I have:

meta http-equiv=content-type content=text/html; charset=UTF-8/

  2. What about the issue I'm having sending the data? How do I get the
  UTF-8 text to be recorded properly when submitted via an AJAX call?

 I believe jQuery sends the data as UTF-8; the issue as I understand it is 
 when you want to send something other than UTF-8, as per this thread:

   
 http://groups.google.com/group/jquery-en/browse_thread/thread/5fc0bd4e73d41e03/#anchor_94c6c9cd173ae26d


 You said you're using Japanese characters, are you sure you're using UTF-8 or 
 could you be using SHIFT_JIS?  Do you have an example page?

Actually I'm using UTF-8 for that exact reason. This application will
be (at some point) translated into as many languages as I can get.

Based on your information I think my problems will be solved once I
get the server to serve PHP as UTF-8 (I think I can do this via
.htaccess).


Thanks for your help with this!
Chris.


[jQuery] jQuery and UTF8

2007-08-15 Thread barophobia

Hello,

I've got some Japanese text in my MySQL database that shows up
correctly through phpMyAdmin as well as when it is loaded directly as
HTML.

However, when I load it through .load() it only shows up as question marks.

Is there an obvious solution? I couldn't find any good info on jQuery
and UTF8 when searching.

Also, when I try to add Japanese through AJAX it is saved (and
returned from the db) like %uD0A4%uC544.



Thanks,
Chris.


[jQuery] Do my emails make it to the list?

2007-08-15 Thread barophobia

I can see my emails in the Gmail interface but it doesn't seem that
they're actually making it to everyone else.

Please respond (off list).



Thanks,
Chris.


[jQuery] Fwd: jQuery and UTF8

2007-08-15 Thread barophobia

I'm forwarding this email again as it seems that it may not have made
its way to the list the first time.

-- Forwarded message --
From: barophobia [EMAIL PROTECTED]
Date: Tue, 14 Aug 2007 20:02:52 -0700
Subject: jQuery and UTF8
To: jquery-en@googlegroups.com

Hello,

I've got some Japanese text in my MySQL database that shows up
correctly through phpMyAdmin as well as when it is loaded directly as
HTML.

However, when I load it through .load() it only shows up as question marks.

Is there an obvious solution? I couldn't find any good info on jQuery
and UTF8 when searching.

Also, when I try to add Japanese through AJAX it is saved in correctly
in the db (as well as returned) as things like %uD0A4%uC544. It works
fine when I enter foreign languages through a regular form and no
AJAX.



Thanks,
Chris.


[jQuery] Re: Fwd: jQuery and UTF8

2007-08-15 Thread barophobia

On 8/15/07, pd [EMAIL PROTECTED] wrote:

 I can't be sure this will help, but does your server side script
 return the document with specifically with a utf8 charset header?

Well, hopefully this is the right way...

According to Firebug, the Response Headers for the document that is
loaded through .load() are:

Response Headers
DateThu, 16 Aug 2007 04:13:42 GMT
Server  Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e
mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
X-Powered-ByPHP/5.2.2
Expires Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma  no-cache
VaryAccept-Encoding
Content-Encodinggzip
Content-Length  427
Keep-Alive  timeout=15, max=86
Connection  Keep-Alive
Content-Typetext/html

Does that give you a clue?



Thanks,
Chris.


[jQuery] Re: What am I missing from this plugin?

2007-07-24 Thread barophobia

On 7/23/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote:
 Making it be unobtrusive would be up the developer. The easy way to do this
 would be for the user to hide the button via CSS and show it after attach
 your plug-in.

 The developer could also make their button be able to automatically generate
 a password by submitting back to the server and generate a password for user
 via server-side processing and reserve the page with the new password.

 The problem with generating the button automatically is that there's no way
 to control the position of the development--which is important for UI.

I see. Thanks.


[jQuery] Re: What am I missing from this plugin?

2007-07-23 Thread barophobia

On 7/18/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote:
 Also, I think I'd change the plug-in a bit. IMO, I would make more sense to
 use like:

 $(#button).generate_password(#passwordField, iLength);

 That way you can attach the behavior to any element. Also, by using a
 selector for the field to update, you could update multiple fields with the
 same value (in those cases where you had both a password and confirm
 password fields.)

So are you saying that #button will have already been created by the
user in their HTML and that #passwordField is where the generated text
should be placed? And beyond that #passwordField could be something
like .place_generated so that when #button is clicked it sticks the
generated text into all boxes that have a class of .place_generated?

This sounds like a fine idea except that I wanted it to be
unobtrusive. If someone doesn't have JS enabled I don't want to have a
lame-duck button sitting there.

Can it still be unobtrusive but use your suggestion at the same time?



Thanks,
Chris.


[jQuery] Re: What am I missing from this plugin?

2007-07-21 Thread barophobia

On 7/18/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote:
 You need to var the generate_to variable in the click handler. Currently
 it's a global variable, which makes the second instance overwrite the first
 instance. Change:

 generate_to = $(this).attr('for');

 to:

 var generate_to = $(this).attr('for');

Thanks. This works perfectly.

 Also, I think I'd change the plug-in a bit. IMO, I would make more sense to
 use like:

 $(#button).generate_password(#passwordField, iLength);

 That way you can attach the behavior to any element. Also, by using a
 selector for the field to update, you could update multiple fields with the
 same value (in those cases where you had both a password and confirm
 password fields.)

I think I understand but how do I handle the #passwordField part
within the plugin?



Thanks,
Chris.


[jQuery] Re: addClass() not executing until cursor enters confirm() box.

2007-07-18 Thread barophobia

On Jul 11, 6:31 am, Richard D. Worth [EMAIL PROTECTED] wrote:
 Chris,

Hi Richard,

I thought my message never made it through so I'm surprised to see
your response!

I reposted the code (I don't think I've changed it at all since my
first post) at http://www.pastebin.ca/624311


Thanks for your effort.

Chris.



[jQuery] What am I missing from this plugin?

2007-07-18 Thread barophobia

I am trying to make a plugin that will be used to generate a password.
After many days of deliberation I decided to call it
generate_password(). Now that I've got the name out of the way I'm
having a bit of trouble getting it to work right.

You can see the behavior here:

http://www.heyareyoulistening.com/generate_password/

Clearly, I don't want both generate buttons to generate text in the same box.


Any help is appreciated.

Thanks,
Chris.


[jQuery] addClass() not executing until cursor enters confirm() box.

2007-07-08 Thread barophobia

Hello,

I have the following code:

http://www.pastebin.ca/609684

When someone clicks the appropriate element I want the row of that
element to change its background. But what happens is that when they
click the link the confirm box is created but the row for that element
doesn't change until the mouse enters the bounds of the confirm() box.

Why? Shouldn't it change before the box appears?


Thanks,
Chris.


[jQuery] Re: Help with stopping event propagation.

2007-06-20 Thread barophobia

I don't quite understand.

As you can see in the code I posted, there are no submit buttons in
the tr that has the event bound to it so I'm not sure what your
example is trying to show me.

Are you suggesting that I need to specifically negate the action of an
event on everything that I don't want it to happen on???



Chris.

On 6/20/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote:

 You may be looking after event.stopPropagation();

  $(form).bind(submit, function(event){
event.stopPropagation();
  });


 http://docs.jquery.com/Events


 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of barophobia
 Sent: mercredi 20 juin 2007 8:41
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Help with stopping event propagation.


 (I saw another email come through but not this one and it's been about 30
 minutes since I originally sent. Apologies if you see this twice.)

 Hi.

 I am applying a click() event to a tr but I only want the event to fire if
 someone clicks on empty space or plain text. With the help of the IRC
 channel I've only been able to get the click event to stop working on a form
 element but nothing else.

 Anyone have any ideas?


 Here's my JS:

 $('tr.customer').click( function(e) {

if($(e.target).is(:input)) return; // this works
if($(e.target).is(:input, a)) return; // this doesn't work
if($(e.target).is(a)) return; // this doesn't work
if($(e.target).is(:a)) return; // this doesn't work

// get the customer's id
customer_id = $(this).attr('customer_id');

alert('you clicked me! my number is '+customer_id+'!'); });

 Here's my HTML:

 tr class=customer is_admin customer_id=1
   td class=checkbox
 input type=checkbox name=customer_id[] value=1/
   /td
   td class=name
 a href=customers_add.php?customer_id=1Chris/a
   /td
   td class=delete
 a href=javascript:alert('not yet!')
   img src=../lib/admin/img/delete.png/
 /a
   /td
 /tr



 Thanks!
 Chris.

 Ce message Envoi est certifié sans virus connu.
 Analyse effectuée par AVG.
 Version: 7.5.472 / Base de données virus: 269.9.1/854 - Date: 19/06/2007
 13:12