Re: [jQuery] Re: Argh!! IE8!

2010-01-12 Thread Jonathan Vanherpe (T T NV)

RobG wrote:



On Jan 12, 5:51 am, Valerijvaleri...@gmail.com  wrote:

Hey guys, I have this popup menu that works.. great! In Chrome,
Safari, Firefox AND it USED to work in IE8, until I added just 1 div.

[...]


This works in all the browsers great even after I added this div, but
in IE8 it suddenly stopped.

a id=acc class=baritem href=javascript:void(0);div
class=textupMy Account/div/a


Your markup is invalid, div elements don't belong inside a elements.

[...]

Is there a fix for this?


Start with valid markup:URL: http://validator.w3.org/


Also, if it's not a link, don't use an a element.

Jonathan
--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Find array key of value

2010-01-12 Thread knal
Hi there,

I'm trying to build a custom slideshow (which doesn't loop) but i seem
to be unable to iterate through the array of images correctly.

Content looks like

div class=images
img src=1.jpg
img src=2.jpg
etc
/div

I create an array of images as follows

$( .images img ).each( function() {
imgArray.push( $(this).attr( src ) );
});

All images except for img:first are hidden, and to change slides i
change img:first's src-attribute with a fade (hope it's clear).
Now i'd like to check img:first's current src-attribute and then
define it's key in the array.

I hope this kind of makes sense. Any help will be greatly appreciated!

Thanks,
Knal


[jQuery] Re: long-term browser support strategy

2010-01-12 Thread mikewse
Thanks for sharing your opinions, RobG and Nathan.

Though, opinions aside, the question still remains; what is jQuery's
strategy for keeping/deprecating support for browsers such as IE6?


Re: [jQuery] any help on this!!!

2010-01-12 Thread Peter Edwards
You need a hash symbol for your button selector, and change the toggle 
to click:


$(#dt-link1).click(function() {
  $('#jqdt').find('ol li:eq(0)').css(color,Blue);
  return false;
});

on 11/01/2010 22:45 JQueryNewbie said::

I cant get my color  change on my listitem. any help would be
appreciated. Thanks in advance.

head
title/title

script src=scripts/jquery-1.3.2.js type=text/javascript/
script
script type=text/javascript
$(document).ready(function() {
$(dt-link1).toggle(function() {
$('#jqdt').find('ol li:eq(0)').css(color,Blue);
   return false;
});
});
/script

/head
body

div id=jqdt
ol
lilist item 1 with dummy link to silly.pdf /li
lilist item 2 with class=goofy /li
lilist item 3 SURPRISE! /li
lilist item 4 with silly link to silly.pdf /li
/ol
/div

br/
   button id=dt-link1 type=buttontoggle first list item/button
   button id=dt-link2 type=buttontoggle first li even/button

/body



[jQuery] Jquery form and validation plugins

2010-01-12 Thread none
Hi everyone.
Immediately apologize: to be a lot of code…

I have a form to add users:
form action=http://localhost/ci_doctrine/signup/submit;
method=post id=myForm

plabel for=usernameUsername: em/em/label
input type=text name=username value= id=username  /   /p

plabel for=passwordPassword: em/em/label
input type=password name=password value= id=password  /   /p

plabel for=passconfConfirm Password: em/em/label
input type=password name=passconf value= id=passconf  /   /p

plabel for=emailE-mail: em/em/label
input type=text name=email value= id=email  / /p

pinput type=submit name=submit value=Create my account  / /
p
/form

Nothing special…

Respectively included:
script type=text/javascript src=js/jquery-1.3.2.min.js/script
script type=text/javascript src=js/jquery.form.js/script
script type=text/javascript src=js/jquery.validate.js/script
script type=text/javascript src=js/signup.js/script

And my js-file signup.js
$(document).ready(
function()
{
var options = {
timeout: 3000,
clearForm: true,
success: function(data) {
$(#output).text(data);
 }

};

$(#myForm).validate({
submitHandler: function(form) {
$(form).ajaxSubmit(options);
},
debug: true,
focusInvalid: false,
focusCleanup: true,
rules: {
username: {
required: true,
minlength: 6,
maxlength: 12,
remote: {
url: userCheck/,
type: post,
data: {
  username: function() {
return $(#username).val();
  }
}
}

},
password: {
required: true,
rangelength: [6, 24]
},
passconf: {
required: true,
rangelength: [6, 24],
equalTo: #password
},
email: {
required: true,
email: true
}
},
messages: {
  some messages
},
errorPlacement: function(error, element) {
var er = element.attr(name);
error.appendTo( element.parent().find(label
[for=' + er + ']).find(em) );

});
}
 );
The problem is that when I click the submit button that runs a script
usercheck from remote rule. I see it in Firebug. And nothing is
added to the database.
How can now send data to the server? Why doesn’t work submitHandler??

Thanks for any help


[jQuery] Re: long-term browser support strategy

2010-01-12 Thread RobG


On Jan 12, 1:24 pm, Nathan Klatt n8kl...@gmail.com wrote:
  IE 6 use is 3 times that of Safari (all versions) depending on whose
  statistics you believe. Why not drop support for Safari while you're
  at it? And Opera and Chrome?

 Because you don't have to do anything to support Safari or Chrome or
 Opera

There are at least 5 Safari-specific quirks catered for in jQuery (I
just searched for Safari in comments), there are likely others.
Admittedly that's far fewer than are required for IE, but since IE 6
is now about 10 years old, surely it's quirks are well known and
catered for?

 - they actually work. To stop supporting them you'd have to stop
 supporting standards.

Browsers will continue to evolve. If appropriate feature detection is
already in place and effective alternatives provided to handle quirks,
you may find that you are handling some new quirks without having to
write a single line of code. :-)

For example, while the bit in jQuery that checks if the event.target
is a textNode is meant for Safari (pre version 3 I think), it will
work for any browser that has such behaviour. Safari's behaviour was
actually compliant with the spec, the far more common behaviour (i.e.
that event.target is always a nodeType 1) is not compliant.


  I work with several clients that do
  not want to lead the way in this respect, and need to support IE6 as
  long as it has a fair usage share, which may be for several more
  years.]

  That is a sensible decision

 Anyone clinging to IE6, at this point, has gone wy beyond not
 leading the way!

If w3schools' statistics are at all accurate, there are about the same
number of people using IE 6 as either IE 7 or 8.

Of course support might mean whether new functionality is provided
for old browsers and whether they continue to be part of a test suite.
New functions that aren't tested in old browsers can simply be marked
in the documentation, or simply features add after version x.y have
not been tested in browser X so users know not to use them.

--
Rob


Re: [jQuery] Find array key of value

2010-01-12 Thread brian
I'm not sure that I follow that but one thing that might help is to
store JSON objects in the array instead of just the src:

$( .images img ).each( function(i) {
   imgArray.push(
src: $(this).attr( src ),
key: i
 );
});

Then, when retrieving the new src you can also get the key/index.

On Tue, Jan 12, 2010 at 3:30 AM, knal knalp...@gmail.com wrote:
 Hi there,

 I'm trying to build a custom slideshow (which doesn't loop) but i seem
 to be unable to iterate through the array of images correctly.

 Content looks like

 div class=images
    img src=1.jpg
    img src=2.jpg
    etc
 /div

 I create an array of images as follows

 $( .images img ).each( function() {
    imgArray.push( $(this).attr( src ) );
 });

 All images except for img:first are hidden, and to change slides i
 change img:first's src-attribute with a fade (hope it's clear).
 Now i'd like to check img:first's current src-attribute and then
 define it's key in the array.

 I hope this kind of makes sense. Any help will be greatly appreciated!

 Thanks,
 Knal



[jQuery] Re: Find array key of value

2010-01-12 Thread Šime Vidas

How does the user select which image he wants to view?


[jQuery] Re: jcarousel issues

2010-01-12 Thread Šime Vidas
The link doesn't seem to work...


[jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread youradds
Mmm, maybe that didn't work :/

  jQuery.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
application/json; charset=ISO-8859-1});
  jQuery.post(/cgi-bin/unterricht/review.cgi, {
Review_Rating: the_rating,
ID:  theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID

  }, function(response){

jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
  });

The script is called ok, but it doesn't pass any of the paramaters -
the POST values passed in are simple $VAR1 = {};  (i.e nothing was
passed it?)

TIA

Andy



On Jan 11, 3:54 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 actually, putting this once somewhere in your script should fix it:
 $.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
 application/json; charset=ISO-8859-1});

 but still, you'll make your life easier if you just go for a completely
 utf-8 workflow.

 Jonathan

 Jonathan Vanherpe (T  T NV) wrote:



  this seems to answer your question somewhat:
 http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs...

  although I'd personally recommend to just use utf-8 for everything (so
  making your website and database use utf-8)

  Jonathan

  youradds wrote:
  Anyone got any suggestions? This is the last bug I've gotta squish :/

  TIA

  Andy

  On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com wrote:
  I found a way to do this in the .cgi script - but obviously I'd prefer
  to do it vai the AJAX submission, instead of having to encode it
  properly at the server end :)

  my $contents = $IN-param('Review_Contents');
  $contents =~ s/([\200-\377]+)/from_utf8({ -string = $1, -
  charset = 'ISO-8859-1'})/eg;
  $IN-param('Review_Contents' = $contents );

  TIA

  Andy

  On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com wrote:

  Hi,

  Got a bit of a weird one here :/

  The following code works fine:

  jQuery.post(/cgi-bin/review.cgi, {
  Review_Rating: the_rating,
  ID: theID,
  add_this_review: 1,
  Review_Contents: contents,
  Review_Subject: subject,
  Review_ByLine: byline,
  Review_GuestName: guestname,
  Review_GuestEmail: guestemail,
  add_review: 1,
  SecurityImage: SecurityImage,
  SessionID: SessionID
  }, function(response){

  jQuery('#ajax_rate_indicator').fadeOut();
  setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
  });

  ...*appart* from the fact stuff like:

  =
  =
  =

  ..gets converted to:

  ö =
  ä =
  ü =

  I did a little bit of research, and found something about adding this
  (but this seems to really be for a different jQuery function - which
  is probably why its not working);

  contentType: application/x-www-form-
  urlencoded;charset=ISO-8859-15,

  Can anyone suggest how I could fix this issue with foreign
  charachters?

  TIA

  Andy

 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


Re: [jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread Andreas Möller





[jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread youradds
Hi,

Was there mean't to be a reply here? =)

Cheers

Andy

On Jan 12, 12:24 pm, Andreas Möller localhe...@l8m.de wrote:



[jQuery] Re: Find array key of value

2010-01-12 Thread knal
@Sime
The user is going to click 'Previous'  'Next' links...

@Brian
I have my images in an array (retrieved from the source, thanks for
the tip)
When i read the SRC from the current image, i want to know it's
location in the array.
This way i could either subtract 1 or add 1 to the current indexkey so
i know what image
was before or comes next.

Hope it's kind of clear, i don't completely know how to explain...

On Jan 12, 1:14 pm, Šime Vidas sime.vi...@gmail.com wrote:
 How does the user select which image he wants to view?


Re: [jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread Jonathan Vanherpe (T T NV)
maybe it's because of the application/json part. I guess that should be 
application/x-www-form-urlencoded or something. Just play with the 
options you find here:

http://docs.jquery.com/Ajax/jQuery.ajaxSetup

Jonathan

youradds wrote:

Mmm, maybe that didn't work :/

  jQuery.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
application/json; charset=ISO-8859-1});
  jQuery.post(/cgi-bin/unterricht/review.cgi, {
Review_Rating: the_rating,
ID:  theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID

  }, function(response){

jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
  });

The script is called ok, but it doesn't pass any of the paramaters -
the POST values passed in are simple $VAR1 = {};  (i.e nothing was
passed it?)

TIA

Andy



On Jan 11, 3:54 pm, Jonathan Vanherpe (T  T NV)jonat...@tnt.be
wrote:

actually, putting this once somewhere in your script should fix it:
$.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
application/json; charset=ISO-8859-1});

but still, you'll make your life easier if you just go for a completely
utf-8 workflow.

Jonathan

Jonathan Vanherpe (T  T NV) wrote:




this seems to answer your question somewhat:
http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs...



although I'd personally recommend to just use utf-8 for everything (so
making your website and database use utf-8)



Jonathan



youradds wrote:

Anyone got any suggestions? This is the last bug I've gotta squish :/



TIA



Andy



On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com  wrote:

I found a way to do this in the .cgi script - but obviously I'd prefer
to do it vai the AJAX submission, instead of having to encode it
properly at the server end :)



my $contents = $IN-param('Review_Contents');
$contents =~ s/([\200-\377]+)/from_utf8({ -string =  $1, -
charset =  'ISO-8859-1'})/eg;
$IN-param('Review_Contents' =  $contents );



TIA



Andy



On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com  wrote:



Hi,



Got a bit of a weird one here :/



The following code works fine:



jQuery.post(/cgi-bin/review.cgi, {
Review_Rating: the_rating,
ID: theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID
}, function(response){



jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
});



...*appart* from the fact stuff like:



=
=
=



..gets converted to:



ö =
ä =
ü =



I did a little bit of research, and found something about adding this
(but this seems to really be for a different jQuery function - which
is probably why its not working);



contentType: application/x-www-form-
urlencoded;charset=ISO-8859-15,



Can anyone suggest how I could fix this issue with foreign
charachters?



TIA



Andy


--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be





--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread youradds
Mmm, changing to that works - but the error is still there with the
unlat charachters :(

On Jan 12, 12:40 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 maybe it's because of the application/json part. I guess that should be
 application/x-www-form-urlencoded or something. Just play with the
 options you find here:http://docs.jquery.com/Ajax/jQuery.ajaxSetup

 Jonathan



 youradds wrote:
  Mmm, maybe that didn't work :/

               jQuery.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
  application/json; charset=ISO-8859-1});
           jQuery.post(/cgi-bin/unterricht/review.cgi, {
             Review_Rating: the_rating,
                     ID:  theID,
                     add_this_review: 1,
                     Review_Contents: contents,
                     Review_Subject: subject,
                     Review_ByLine: byline,
                     Review_GuestName: guestname,
                     Review_GuestEmail: guestemail,
                     add_review: 1,
                     SecurityImage: SecurityImage,
                     SessionID:     SessionID

           }, function(response){

             jQuery('#ajax_rate_indicator').fadeOut();
             setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
           });

  The script is called ok, but it doesn't pass any of the paramaters -
  the POST values passed in are simple $VAR1 = {};  (i.e nothing was
  passed it?)

  TIA

  Andy

  On Jan 11, 3:54 pm, Jonathan Vanherpe (T  T NV)jonat...@tnt.be
  wrote:
  actually, putting this once somewhere in your script should fix it:
  $.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
  application/json; charset=ISO-8859-1});

  but still, you'll make your life easier if you just go for a completely
  utf-8 workflow.

  Jonathan

  Jonathan Vanherpe (T  T NV) wrote:

  this seems to answer your question somewhat:
 http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs...

  although I'd personally recommend to just use utf-8 for everything (so
  making your website and database use utf-8)

  Jonathan

  youradds wrote:
  Anyone got any suggestions? This is the last bug I've gotta squish :/

  TIA

  Andy

  On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com  wrote:
  I found a way to do this in the .cgi script - but obviously I'd prefer
  to do it vai the AJAX submission, instead of having to encode it
  properly at the server end :)

  my $contents = $IN-param('Review_Contents');
  $contents =~ s/([\200-\377]+)/from_utf8({ -string =  $1, -
  charset =  'ISO-8859-1'})/eg;
  $IN-param('Review_Contents' =  $contents );

  TIA

  Andy

  On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com  wrote:

  Hi,

  Got a bit of a weird one here :/

  The following code works fine:

  jQuery.post(/cgi-bin/review.cgi, {
  Review_Rating: the_rating,
  ID: theID,
  add_this_review: 1,
  Review_Contents: contents,
  Review_Subject: subject,
  Review_ByLine: byline,
  Review_GuestName: guestname,
  Review_GuestEmail: guestemail,
  add_review: 1,
  SecurityImage: SecurityImage,
  SessionID: SessionID
  }, function(response){

  jQuery('#ajax_rate_indicator').fadeOut();
  setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
  });

  ...*appart* from the fact stuff like:

  =
  =
  =

  ..gets converted to:

  =
  =
  =

  I did a little bit of research, and found something about adding this
  (but this seems to really be for a different jQuery function - which
  is probably why its not working);

  contentType: application/x-www-form-
  urlencoded;charset=ISO-8859-15,

  Can anyone suggest how I could fix this issue with foreign
  charachters?

  TIA

  Andy

  --
  Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be

 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


Re: [jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread Jonathan Vanherpe (T T NV)
I'm not sure what else there is, I never change character sets and set 
everything to UTF-8 just to avoid the mess you're having.


The only advice I can give you is to make sure everything's set to the 
same character set (your html, your js, your database, your php source 
files, ...)


Then try to figure out where the conversion happens with firebug (set 
some console.log(var) markers in your code, look at the headers, etc...


Or post a link to a test case that shows the problem so we can have a 
direct look at it.


Jonathan

youradds wrote:

Mmm, changing to that works - but the error is still there with the
unlat charachters :(

On Jan 12, 12:40 pm, Jonathan Vanherpe (T  T NV)jonat...@tnt.be
wrote:

maybe it's because of the application/json part. I guess that should be
application/x-www-form-urlencoded or something. Just play with the
options you find here:http://docs.jquery.com/Ajax/jQuery.ajaxSetup

Jonathan



youradds wrote:

Mmm, maybe that didn't work :/



  jQuery.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
application/json; charset=ISO-8859-1});
  jQuery.post(/cgi-bin/unterricht/review.cgi, {
Review_Rating: the_rating,
ID:  theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID



  }, function(response){



jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
  });



The script is called ok, but it doesn't pass any of the paramaters -
the POST values passed in are simple $VAR1 = {};  (i.e nothing was
passed it?)



TIA



Andy



On Jan 11, 3:54 pm, Jonathan Vanherpe (TT NV)jonat...@tnt.be
wrote:

actually, putting this once somewhere in your script should fix it:
$.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
application/json; charset=ISO-8859-1});



but still, you'll make your life easier if you just go for a completely
utf-8 workflow.



Jonathan



Jonathan Vanherpe (TT NV) wrote:



this seems to answer your question somewhat:
http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs...



although I'd personally recommend to just use utf-8 for everything (so
making your website and database use utf-8)



Jonathan



youradds wrote:

Anyone got any suggestions? This is the last bug I've gotta squish :/



TIA



Andy



On Jan 11, 9:18 am, youraddsandy.ne...@gmail.comwrote:

I found a way to do this in the .cgi script - but obviously I'd prefer
to do it vai the AJAX submission, instead of having to encode it
properly at the server end :)



my $contents = $IN-param('Review_Contents');
$contents =~ s/([\200-\377]+)/from_utf8({ -string =$1, -
charset ='ISO-8859-1'})/eg;
$IN-param('Review_Contents' =$contents );



TIA



Andy



On Jan 11, 8:15 am, youraddsandy.ne...@gmail.comwrote:



Hi,



Got a bit of a weird one here :/



The following code works fine:



jQuery.post(/cgi-bin/review.cgi, {
Review_Rating: the_rating,
ID: theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID
}, function(response){



jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
});



...*appart* from the fact stuff like:



=
=
=



..gets converted to:



=
=
=



I did a little bit of research, and found something about adding this
(but this seems to really be for a different jQuery function - which
is probably why its not working);



contentType: application/x-www-form-
urlencoded;charset=ISO-8859-15,



Can anyone suggest how I could fix this issue with foreign
charachters?



TIA



Andy



--
Jonathan Vanherpe - TallieuTallieu NV - jonat...@tnt.be


--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be





--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Foreign charachters in .post()

2010-01-12 Thread youradds
Mmm, well the page type is:

meta http-equiv=content-type content=text/html;
charset=ISO-8859-1 /

Not sure what the DB is (its a mySQL DB) ... and I'm sure thats ok,
cos if I convert the charachters via a few lines of perl code, then it
works fine...

I think I'm just gonna have to admit defeat, and just use the perl
code I worked out the other day - not the ideal solution though :(

Thanks for trying though!

Cheers

Andy



On Jan 12, 1:08 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 I'm not sure what else there is, I never change character sets and set
 everything to UTF-8 just to avoid the mess you're having.

 The only advice I can give you is to make sure everything's set to the
 same character set (your html, your js, your database, your php source
 files, ...)

 Then try to figure out where the conversion happens with firebug (set
 some console.log(var) markers in your code, look at the headers, etc...

 Or post a link to a test case that shows the problem so we can have a
 direct look at it.

 Jonathan



 youradds wrote:
  Mmm, changing to that works - but the error is still there with the
  unlat charachters :(

  On Jan 12, 12:40 pm, Jonathan Vanherpe (T  T NV)jonat...@tnt.be
  wrote:
  maybe it's because of the application/json part. I guess that should be
  application/x-www-form-urlencoded or something. Just play with the
  options you find here:http://docs.jquery.com/Ajax/jQuery.ajaxSetup

  Jonathan

  youradds wrote:
  Mmm, maybe that didn't work :/

                jQuery.ajaxSetup({ scriptCharset: ISO-8859-1 , 
  contentType:
  application/json; charset=ISO-8859-1});
            jQuery.post(/cgi-bin/unterricht/review.cgi, {
              Review_Rating: the_rating,
                      ID:  theID,
                      add_this_review: 1,
                      Review_Contents: contents,
                      Review_Subject: subject,
                      Review_ByLine: byline,
                      Review_GuestName: guestname,
                      Review_GuestEmail: guestemail,
                      add_review: 1,
                      SecurityImage: SecurityImage,
                      SessionID:     SessionID

            }, function(response){

              jQuery('#ajax_rate_indicator').fadeOut();
              setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
            });

  The script is called ok, but it doesn't pass any of the paramaters -
  the POST values passed in are simple $VAR1 = {};  (i.e nothing was
  passed it?)

  TIA

  Andy

  On Jan 11, 3:54 pm, Jonathan Vanherpe (T    T NV)jonat...@tnt.be
  wrote:
  actually, putting this once somewhere in your script should fix it:
  $.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
  application/json; charset=ISO-8859-1});

  but still, you'll make your life easier if you just go for a completely
  utf-8 workflow.

  Jonathan

  Jonathan Vanherpe (T    T NV) wrote:

  this seems to answer your question somewhat:
 http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs...

  although I'd personally recommend to just use utf-8 for everything (so
  making your website and database use utf-8)

  Jonathan

  youradds wrote:
  Anyone got any suggestions? This is the last bug I've gotta squish :/

  TIA

  Andy

  On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com    wrote:
  I found a way to do this in the .cgi script - but obviously I'd prefer
  to do it vai the AJAX submission, instead of having to encode it
  properly at the server end :)

  my $contents = $IN-param('Review_Contents');
  $contents =~ s/([\200-\377]+)/from_utf8({ -string =    $1, -
  charset =    'ISO-8859-1'})/eg;
  $IN-param('Review_Contents' =    $contents );

  TIA

  Andy

  On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com    wrote:

  Hi,

  Got a bit of a weird one here :/

  The following code works fine:

  jQuery.post(/cgi-bin/review.cgi, {
  Review_Rating: the_rating,
  ID: theID,
  add_this_review: 1,
  Review_Contents: contents,
  Review_Subject: subject,
  Review_ByLine: byline,
  Review_GuestName: guestname,
  Review_GuestEmail: guestemail,
  add_review: 1,
  SecurityImage: SecurityImage,
  SessionID: SessionID
  }, function(response){

  jQuery('#ajax_rate_indicator').fadeOut();
  setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
  });

  ...*appart* from the fact stuff like:

  =
  =
  =

  ..gets converted to:

  =
  =
  =

  I did a little bit of research, and found something about adding this
  (but this seems to really be for a different jQuery function - which
  is probably why its not working);

  contentType: application/x-www-form-
  urlencoded;charset=ISO-8859-15,

  Can anyone suggest how I could fix this issue with foreign
  charachters?

  TIA

  Andy

  --
  Jonathan Vanherpe - Tallieu    Tallieu NV - jonat...@tnt.be

  --
  Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be

 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] getScript - Site does not finish loading?

2010-01-12 Thread chricke
hi all,

as i understand the getScript function should be asyncronous, but when
i use it the website won't finish loading (in firefox).

my code:

jQuery(document).ready(function(){
function get_url_param( name )
{
name = name.replace(/[\[]/,\\\[).replace(/[\]]/,\\\]);

var regexS = [\\?]+name+=([^#]*);
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );

if ( results == null )
return ;
else
return results[1];
}

function getCounter(){
jQuery.getScript('http://example.com/counter?id='+get_url_param
('id'), function(){
jQuery('#counterfu_online_count').text(count);
getCounter();
});
}

getCounter();
});

getCounter() calls itself so the counter this script is used for is
updated - all works well, just the page keeps loading...

so whats the problem here? why does the website not finish loading?


[jQuery] blockUI: allowBodyStretch not working

2010-01-12 Thread kongo09
Unfortunately, the wonderful blockUI plugin doesn't grey out the full
background on short pages. I tried the
$.blockUI.defaults.allowBodyStretch = true; but that doesn't help
(FireFox 3.5.7 on Ubuntu 9.10).

Digging a bit deeper with Firebug, I noticed that the grey overlay
carries a property of position: absolute while other tools that grey
out the background (like. e.g., UserVoice) use position: fixed.
Consequently, I tried $.blockUI.defaults.overlayCSS.position = 'fixed'
but that doesn't find its way down to the style used.

Can anyone help?


[jQuery] Help with solution to place audio player in overlay at top of web page

2010-01-12 Thread djtonyz
I'm not a developer, but a Product Manager looking to put an audio
player at the top of a web page inside an overlay, such that if I
navigate between pages, the overlay and subsequently the audio player
stay constant at the very top of the page.

I'm not sure if I have the language correct when I say overlay. I
mean at the very top of the web page, there would be like a 30 pixel
bar that runs across the top of the page that stays constant, while
the user navigates the site. I'd like to put an audio player in that
bar.

Can anyone point me in the right direction? I'm going to use
SoundManager for the player, I just need to know where to get the plug-
in or what the code is to put a nice thin bar at the top of the page
that stays static.

Thanks in advance.

Tony Z.


[jQuery] show/hide

2010-01-12 Thread tabu
Hello,
I'm new to javascript and jquery library, I have script running which
functions fine only problem I have with it is that I want to close
other divs when another is selected, I guess like an accordion style
but using the toggle, slide fade-in functions. The problem I have is
that once each button that controls the relevant div is clicked once,
on subsequent clicks it requires double clicking to show the
containing div, where i want a single.
I imagine it is a very simple solution but I have tried a number of
ways without success, any help would be great, thanks

Here is the script Im using:


   $(document).ready(function() {
 $('div.me').hide();
 $('div.who').toggle(function() {
 $(this).siblings('div.me').fadeIn(900);
 $('div.view').hide();
  $('div.callme').hide();
   $('div.imagesview').hide();
 }, function() {
 $(this).siblings('div.me').fadeOut(500);
 return false;

 });

 });

 $(document).ready(function() {

 $('div.view').hide();
 $('div.slide').toggle(function() {
 $(this).siblings('div.view').fadeIn(900);
   $('div.me').hide();
 $('div.callme').hide();
   $('div.imagesview').hide();
 }, function() {
 $(this).siblings('div.view').fadeOut(500);
 return false;

 });
 });

  $(document).ready(function() {
 $('div.showwork').hide();
 $('div.work').toggle(function() {
 $(this).siblings('div.showwork').fadeIn(900);
 }, function() {
 $(this).siblings('div.showwork').fadeOut(500);
 return false;

 });
 });

   $(document).ready(function() {
 $('div.callme').hide();
 $('div.call').toggle(function() {
 $(this).siblings('div.callme').fadeIn(900);
 $('div.view').hide();
   $('div.me').hide();
 $('div.imagesview').hide();
 }, function() {
 $(this).siblings('div.callme').fadeOut(500);
 return false;

 });
 });

$(document).ready(function() {
 $('div.imagesview').hide();
 $('div.images').toggle(function() {
 $(this).siblings('div.imagesview').fadeIn(900);
 $('div.view').hide();
   $('div.me').hide();
$('div.callme').hide();
 }, function() {
 $(this).siblings('div.imagesview').fadeOut(500);
 return false;

 });
 });


[jQuery] added form elements not sent using Firefox

2010-01-12 Thread Eric Cope
Hello all,
I am using jquery to copy a DIV containing some form elements. The
copy is appended to the DIV in another DIV to allow an unlimited
number of form elements to be sent. The problem is that none of the
copy DIVs are being sent by the browser (Firefox). There is some
chatter via google, but nothing conclusive. I see the DIVs show up in
Firebug. Could this be jquery related?
Thanks in advance!

Eric


[jQuery] jQuery tab menus with Simple jQuery accordion

2010-01-12 Thread drizzy
Hey Everyone,

Basically I used these two jQuery plugins to achieve this, but I'm
having troubles...

http://www.queness.com/post/106/jquery-tabbed-interfacetabbed-structure-menu-tutorial

http://css-tricks.com/snippets/jquery/simple-jquery-accordion/


I took it out the simple jquery accordion code, to show you guys what
I have so far;
here's the link to my site;
http://starcoac.ipower.com/sites/Toronto/Toronto-DoubleDeckerTour.html

As you can see there are headings; and under each heading theres
subheadings like a FAQ.
I'm basically trying to have it so when  you click What your
CitySightseeing Toronto ticket gets you it drops down and reveals the
answer.


and here's the link to the site using both jquery tab menu and Simple
jQuery Accordion;
http://starcoac.ipower.com/sites/Toronto/Toronto-DoubleDeckerTourTest2.html

if take a look at the site in IE at the bottom part of the tab menu
theres a gap that I have no clue why its there and at the footer at
the bottom shows a red gap as well in

if you click on the FAQ button all the sections keep gettting bigger
and bigger in text


I also noticed that a lot of my my div id's become invalid when I use
this code more then once in the
whole tabbed menu; dl id=accordion

but if I take it out, that section won't work.



I hope I'm explaining this properly, can anyone show me what I'm doing
wrong please

Thanks in advance...

drizzy

Posts: 40
Joined: Tue Nov 17, 2009 3:33 pm
Top


[jQuery] Altering cloned HTML's ID values

2010-01-12 Thread Sloan Thrasher
Hi,

I've got a table where I'm adding rows using clone and appendTo. After cloning, 
I need to change the ID of elements in the cloned HTML.

How can I do that?

Sloan


[jQuery] Re: long-term browser support strategy

2010-01-12 Thread Thomas
Here's a post from John's blog in which he touches the topic of a
general strategy for browser support: 
http://ejohn.org/blog/the-browsers-of-2009/

He also briefly writes about it in his (latest?) book: 
http://www.manning.com/resig/

Finally, John's (and thus jQuery's) testing strategy is to test
against the previous, the current, and the upcoming (nightly build)
version of supported browsers. [citation needed] :p



P.S.: When I write 'John', it's probably really the whole team behind
jQuery that worked out those approaches.


On Jan 12, 12:41 pm, RobG rg...@iinet.net.au wrote:
 On Jan 12, 1:24 pm, Nathan Klatt n8kl...@gmail.com wrote:

   IE 6 use is 3 times that of Safari (all versions) depending on whose
   statistics you believe. Why not drop support for Safari while you're
   at it? And Opera and Chrome?

  Because you don't have to do anything to support Safari or Chrome or
  Opera

 There are at least 5 Safari-specific quirks catered for in jQuery (I
 just searched for Safari in comments), there are likely others.
 Admittedly that's far fewer than are required for IE, but since IE 6
 is now about 10 years old, surely it's quirks are well known and
 catered for?

  - they actually work. To stop supporting them you'd have to stop
  supporting standards.

 Browsers will continue to evolve. If appropriate feature detection is
 already in place and effective alternatives provided to handle quirks,
 you may find that you are handling some new quirks without having to
 write a single line of code. :-)

 For example, while the bit in jQuery that checks if the event.target
 is a textNode is meant for Safari (pre version 3 I think), it will
 work for any browser that has such behaviour. Safari's behaviour was
 actually compliant with the spec, the far more common behaviour (i.e.
 that event.target is always a nodeType 1) is not compliant.

   I work with several clients that do
   not want to lead the way in this respect, and need to support IE6 as
   long as it has a fair usage share, which may be for several more
   years.]

   That is a sensible decision

  Anyone clinging to IE6, at this point, has gone wy beyond not
  leading the way!

 If w3schools' statistics are at all accurate, there are about the same
 number of people using IE 6 as either IE 7 or 8.

 Of course support might mean whether new functionality is provided
 for old browsers and whether they continue to be part of a test suite.
 New functions that aren't tested in old browsers can simply be marked
 in the documentation, or simply features add after version x.y have
 not been tested in browser X so users know not to use them.

 --
 Rob


Re: [jQuery] added form elements not sent using Firefox

2010-01-12 Thread brian
If you have multiple inputs with the same name be sure to add square
brackets to the name so that the browser sends an array of values.

single:
input type=text name=foo /

multiple:
input type=text name=foo[] /
input type=text name=foo[] /

Also, fyi (and most likely unrelated), when copying DOM elements, make
sure that you don't end up with multiple elements with the same ID (as
opposed to name).

On Tue, Jan 12, 2010 at 2:49 AM, Eric Cope eric.c...@gmail.com wrote:
 Hello all,
 I am using jquery to copy a DIV containing some form elements. The
 copy is appended to the DIV in another DIV to allow an unlimited
 number of form elements to be sent. The problem is that none of the
 copy DIVs are being sent by the browser (Firefox). There is some
 chatter via google, but nothing conclusive. I see the DIVs show up in
 Firebug. Could this be jquery related?
 Thanks in advance!

 Eric



Re: [jQuery] Altering cloned HTML's ID values

2010-01-12 Thread brian
See this thread:

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

On Tue, Jan 12, 2010 at 10:15 AM, Sloan Thrasher
sl...@sloanthrasher.com wrote:
 Hi,

 I've got a table where I'm adding rows using clone and appendTo. After
 cloning, I need to change the ID of elements in the cloned HTML.

 How can I do that?

 Sloan



Re: [jQuery] Re: Find array key of value

2010-01-12 Thread Karl Swedberg


On Jan 12, 2010, at 7:32 AM, knal wrote:


@Brian
I have my images in an array (retrieved from the source, thanks for
the tip)
When i read the SRC from the current image, i want to know it's
location in the array.
This way i could either subtract 1 or add 1 to the current indexkey so
i know what image
was before or comes next.

Hope it's kind of clear, i don't completely know how to explain...



You could use $.inArray()

something like:
$.inArray('/some/src/value.jpg', imgSrc);

more info:
http://api.jquery.com/jQuery.inArray/


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] Re: Altering cloned HTML's ID values

2010-01-12 Thread bill

jQuery(this).attr(id,newId);



On Jan 12, 10:15 am, Sloan Thrasher sl...@sloanthrasher.com wrote:
 Hi,

 I've got a table where I'm adding rows using clone and appendTo. After 
 cloning, I need to change the ID of elements in the cloned HTML.

 How can I do that?

 Sloan


[jQuery] Re: show/hide

2010-01-12 Thread bill
without the corresponding html, it is hard to tell if this answer is
completely correct. however, think about trying this approach, where
these few lines replace ALL of your code:

$(function() {
$('div').click(function() {
$('div').hide(slow); // first, for simplification 
hide any
open divs (change specificity for your needs)
$(this).show(slow);   // second, open the selected div
});
});

On Jan 12, 8:17 am, tabu ces...@googlemail.com wrote:
 Hello,
 I'm new to javascript and jquery library, I have script running which
 functions fine only problem I have with it is that I want to close
 other divs when another is selected, I guess like an accordion style
 but using the toggle, slide fade-in functions. The problem I have is
 that once each button that controls the relevant div is clicked once,
 on subsequent clicks it requires double clicking to show the
 containing div, where i want a single.
 I imagine it is a very simple solution but I have tried a number of
 ways without success, any help would be great, thanks

 Here is the script Im using:

    $(document).ready(function() {
  $('div.me').hide();
  $('div.who').toggle(function() {
  $(this).siblings('div.me').fadeIn(900);
  $('div.view').hide();
   $('div.callme').hide();
    $('div.imagesview').hide();
  }, function() {
  $(this).siblings('div.me').fadeOut(500);
  return false;

  });

  });

  $(document).ready(function() {

  $('div.view').hide();
  $('div.slide').toggle(function() {
  $(this).siblings('div.view').fadeIn(900);
    $('div.me').hide();
      $('div.callme').hide();
    $('div.imagesview').hide();
  }, function() {
  $(this).siblings('div.view').fadeOut(500);
  return false;

  });
  });

   $(document).ready(function() {
  $('div.showwork').hide();
  $('div.work').toggle(function() {
  $(this).siblings('div.showwork').fadeIn(900);
  }, function() {
  $(this).siblings('div.showwork').fadeOut(500);
  return false;

  });
  });

    $(document).ready(function() {
  $('div.callme').hide();
  $('div.call').toggle(function() {
  $(this).siblings('div.callme').fadeIn(900);
  $('div.view').hide();
    $('div.me').hide();
      $('div.imagesview').hide();
  }, function() {
  $(this).siblings('div.callme').fadeOut(500);
  return false;

  });
  });

     $(document).ready(function() {
  $('div.imagesview').hide();
  $('div.images').toggle(function() {
  $(this).siblings('div.imagesview').fadeIn(900);
  $('div.view').hide();
    $('div.me').hide();
     $('div.callme').hide();
  }, function() {
  $(this).siblings('div.imagesview').fadeOut(500);
  return false;

  });
  });


[jQuery] jQuery Form Processing

2010-01-12 Thread Seth
Hello,

I'm trying to use this method to process a form and return an alert
without navigating to a new page for the form processing.

http://jquery.malsup.com/form/#getting-started

I have this in my head statement:
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript src=js/jquery.form.js/script

script type=text/javascript
$(document).ready(function() {
$('#autoSumForm').ajaxForm(function() {
alert(Thank you for your comment!);
});
});
/script

And this is the form:
form name=autoSumForm action=posttime.php method=post
...
input type=submit name=submit id=submit value=Submit /
/form

When I click the submit button though, it takes me to posttime.php,
and doesn't give the alert.

What did I do wrong?


[jQuery] Re: added form elements not sent using Firefox

2010-01-12 Thread MorningZ
Could this be jquery related? 

Do you have any example code to build an answer upon?


On Jan 12, 2:49 am, Eric Cope eric.c...@gmail.com wrote:
 Hello all,
 I am using jquery to copy a DIV containing some form elements. The
 copy is appended to the DIV in another DIV to allow an unlimited
 number of form elements to be sent. The problem is that none of the
 copy DIVs are being sent by the browser (Firefox). There is some
 chatter via google, but nothing conclusive. I see the DIVs show up in
 Firebug. Could this be jquery related?
 Thanks in advance!

 Eric


Re: [jQuery] jQuery Form Processing

2010-01-12 Thread Karl Swedberg

Your selector is for an ID: $('#autoSumForm')

But your form has no ID: form name=autoSumForm  
action=posttime.php method=post


Try adding an ID to the form:
form name=autoSumForm id=name=autoSumForm action=posttime.php  
method=post


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jan 12, 2010, at 9:49 AM, Seth wrote:


Hello,

I'm trying to use this method to process a form and return an alert
without navigating to a new page for the form processing.

http://jquery.malsup.com/form/#getting-started

I have this in my head statement:
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript src=js/jquery.form.js/script

script type=text/javascript
$(document).ready(function() {
$('#autoSumForm').ajaxForm(function() {
alert(Thank you for your comment!);
});
});
/script

And this is the form:
form name=autoSumForm action=posttime.php method=post
...
input type=submit name=submit id=submit value=Submit /
/form

When I click the submit button though, it takes me to posttime.php,
and doesn't give the alert.

What did I do wrong?




[jQuery] Re: Specific type of menu action

2010-01-12 Thread Glen_H
was hoping someone can help me out.  Than you andrei for the link. I
have been messing around with it all morning and I think it should be
working, but its not lol. maybe someone can find something that I
oversaw.

here is my site:

www.glenhealy.com

in firebug I am getting the error that the function is not a function,
i put it in exactly how the plug in says to do it. is there something
wrong with that maybe?


thanks in advance to anyone who can help.

On Jan 10, 2:03 pm, Andrei Eftimie k3liu...@gmail.com wrote:
  here is the site:http://www.webdesignblog.gr/archives/

  at the top the menu and the way the hover slides from button to
  button, thats what I am trying to go for. anyone have any idea what it
  is called so I can look for a tutorial or plug in?

 Its called 
 Lavalamphttp://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/

 --
 Andrei Eftimiehttp://eftimie.com
 +40 758 833 281

 Puncthttp://designpunct.ro


[jQuery] Re: jQuery Form Processing

2010-01-12 Thread Seth
Thanks. That worked.

On Jan 12, 10:12 am, Karl Swedberg k...@englishrules.com wrote:
 Your selector is for an ID: $('#autoSumForm')

 But your form has no ID: form name=autoSumForm  
 action=posttime.php method=post

 Try adding an ID to the form:
 form name=autoSumForm id=name=autoSumForm action=posttime.php  
 method=post

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Jan 12, 2010, at 9:49 AM, Seth wrote:

  Hello,

  I'm trying to use this method to process a form and return an alert
  without navigating to a new page for the form processing.

 http://jquery.malsup.com/form/#getting-started

  I have this in my head statement:
  script type=text/javascript src=js/jquery-1.3.2.js/script
  script type=text/javascript src=js/jquery.form.js/script

  script type=text/javascript
     $(document).ready(function() {
             $('#autoSumForm').ajaxForm(function() {
                     alert(Thank you for your comment!);
             });
     });
  /script

  And this is the form:
  form name=autoSumForm action=posttime.php method=post
  ...
  input type=submit name=submit id=submit value=Submit /
  /form

  When I click the submit button though, it takes me to posttime.php,
  and doesn't give the alert.

  What did I do wrong?


Re: [jQuery] getScript - Site does not finish loading?

2010-01-12 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 3:53 AM, chricke c.beckm...@vectan.de wrote:
 as i understand the getScript function should be asyncronous, but when
 i use it the website won't finish loading (in firefox).
snip
        function getCounter(){
                jQuery.getScript('http://example.com/counter?id='+get_url_param
 ('id'), function(){
                        jQuery('#counterfu_online_count').text(count);
                        getCounter();
                });
        }
        getCounter();
 });

 getCounter() calls itself so the counter this script is used for is
 updated - all works well, just the page keeps loading...

 so whats the problem here? why does the website not finish loading?

Okay, you acknowledge you've got a recursive function there (sorta -
is there a special term for recursion through a callback like that?
Anyone?) but do you admit to infinite recursion? If so, could you
point us to a page that causes the problem? Or expound on what you
mean by the page keeps loading? 'Cause, yeah, it's gonna do that as
written. :) You need an exit case for the recursion, possibly
something like the below, though it's hard to comment when I'm not
sure what the reason is to get the same script two times.

var getCounterCount = 0;
function getCounter() {
++getCounterCount;
jQuery.getScript(
'http://example.com/counter?id='+get_url_param('id'),
function() {
jQuery('#counterfu_online_count').text(count);
if (getCounterCount  2) getCounter();
});
}

Nathan


[jQuery] Accessing an objects array from an $.ajax call

2010-01-12 Thread Matthias
Hey everyone

I am fairly new to JavaScript and JQuery, so please forgive any
obvious errors.

I have an object with a member function that changes something on the
objects state. This works perfectly fine in the easy case. But when I
use an $.ajax call within the function it doesn't work.

Here is the example code and failing QUnit tests: http://pastie.org/774900

Thanks in advance
Matthias


Re: [jQuery] Looping help

2010-01-12 Thread John Arrowwood
Before we start, note this:
http://www.w3schools.com/tags/att_standard_id.asp which says that an ID must
begin with a letter.  So you are going to need to modify your HTML so that
your ID values are letter then number.  Chances are, this is your whole
problem.

var list = /* JSON array */

for ( var i = 0 ; i  list.length ; i++ ) {
  var id = 'img' + ( i + 1 );  // assumes div ID's are 'img1' and 'img2' and
so forth.  Adjust accordingly
  var img = document.createElement( 'img' );
  $(img).attr('src') = list[i];
  $('#filmstrip ' + id).append( img );
}

There are many ways to do this, the above code is just a clean, instructive
way of doing it.

On Mon, Jan 11, 2010 at 9:30 PM, Randall Morgan rmorga...@gmail.com wrote:

 Here is a print out of the Json array returned from my php script.


 [http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0853.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0855.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0856.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0857.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0858.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0860.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0859.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0861.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0862.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0863.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0864.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0847.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0849.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0851.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0845.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0846.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0850.JPG,http:\/\/localhost\/f-stopart2\/photoshoots\/n\/PICT0848.JPG]

 Thank you for you help

 On Mon, Jan 11, 2010 at 10:25 PM, John Arrowwood jarro...@gmail.com
 wrote:
  What does your JSON array look like?
 
  On Mon, Jan 11, 2010 at 9:23 PM, Randall Morgan rmorga...@gmail.com
 wrote:
 
  Hello,
 
  I'm still pretty new to JQuery and I need to figure out how to loop
  over a json array and assign the array values to each of a list of
  divs. What I need to do is fill each filmstrip-cell with an image tag
  and set the source to the current value in the array. The array
  contains urls for each of 35 images.
 
  My code is similar to:
 
  div id=filmstrip class=filmstrip
div id=1 class=filmstrip-cell
/div
   div id=2 class=filmstrip-cell
/div
   div id=3 class=filmstrip-cell
/div
   div id=4 class=filmstrip-cell
/div
...
   div id=35 class=filmstrip-cell
/div
  /div
 
 
  --
  If you ask me if it can be done. The answer is YES, it can always be
  done. The correct questions however are... What will it cost, and how
  long will it take?
 
 
 
  --
  John Arrowwood
  John (at) Irie (dash) Inc (dot) com
  John (at) Arrowwood Photography (dot) com
  John (at) Hanlons Razor (dot) com
  --
  http://www.irie-inc.com/
  http://arrowwood.blogspot.com/
 



 --
 If you ask me if it can be done. The answer is YES, it can always be
 done. The correct questions however are... What will it cost, and how
 long will it take?




-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://www.irie-inc.com/
http://arrowwood.blogspot.com/


Re: [jQuery] Re: Specific type of menu action

2010-01-12 Thread Karl Swedberg
You're trying to access the easing and lavalamp plugins at the wrong  
location, so they're returning 404 page not found errors.


http://www.glenhealy.com/jquery.easing.min.js
http://www.glenhealy.com/jquery.lavalamp.min.js

Make sure those paths are correct and try again.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jan 12, 2010, at 10:20 AM, Glen_H wrote:


was hoping someone can help me out.  Than you andrei for the link. I
have been messing around with it all morning and I think it should be
working, but its not lol. maybe someone can find something that I
oversaw.

here is my site:

www.glenhealy.com

in firebug I am getting the error that the function is not a function,
i put it in exactly how the plug in says to do it. is there something
wrong with that maybe?


thanks in advance to anyone who can help.

On Jan 10, 2:03 pm, Andrei Eftimie k3liu...@gmail.com wrote:

here is the site:http://www.webdesignblog.gr/archives/



at the top the menu and the way the hover slides from button to
button, thats what I am trying to go for. anyone have any idea  
what it

is called so I can look for a tutorial or plug in?


Its called 
Lavalamphttp://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/

--
Andrei Eftimiehttp://eftimie.com
+40 758 833 281

Puncthttp://designpunct.ro




[jQuery] Re: Find array key of value

2010-01-12 Thread knal
Great!! That has to solve my quest!

On Jan 12, 3:31 pm, Karl Swedberg k...@englishrules.com wrote:
 On Jan 12, 2010, at 7:32 AM, knal wrote:

  @Brian
  I have my images in an array (retrieved from the source, thanks for
  the tip)
  When i read the SRC from the current image, i want to know it's
  location in the array.
  This way i could either subtract 1 or add 1 to the current indexkey so
  i know what image
  was before or comes next.

  Hope it's kind of clear, i don't completely know how to explain...

 You could use $.inArray()

 something like:
 $.inArray('/some/src/value.jpg', imgSrc);

 more info:http://api.jquery.com/jQuery.inArray/

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com


[jQuery] Re: Specific type of menu action

2010-01-12 Thread Glen_H
wow,


thank you. I must have looked at that a hundred times and not seen it.
thank you so much.

glen

On Jan 12, 10:37 am, Karl Swedberg k...@englishrules.com wrote:
 You're trying to access the easing and lavalamp plugins at the wrong  
 location, so they're returning 404 page not found errors.

 http://www.glenhealy.com/jquery.easing.min.jshttp://www.glenhealy.com/jquery.lavalamp.min.js

 Make sure those paths are correct and try again.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Jan 12, 2010, at 10:20 AM, Glen_H wrote:

  was hoping someone can help me out.  Than you andrei for the link. I
  have been messing around with it all morning and I think it should be
  working, but its not lol. maybe someone can find something that I
  oversaw.

  here is my site:

 www.glenhealy.com

  in firebug I am getting the error that the function is not a function,
  i put it in exactly how the plug in says to do it. is there something
  wrong with that maybe?

  thanks in advance to anyone who can help.

  On Jan 10, 2:03 pm, Andrei Eftimie k3liu...@gmail.com wrote:
  here is the site:http://www.webdesignblog.gr/archives/

  at the top the menu and the way the hover slides from button to
  button, thats what I am trying to go for. anyone have any idea  
  what it
  is called so I can look for a tutorial or plug in?

  Its called 
  Lavalamphttp://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/

  --
  Andrei Eftimiehttp://eftimie.com
  +40 758 833 281

  Puncthttp://designpunct.ro


[jQuery] Re: long-term browser support strategy

2010-01-12 Thread MorningZ
 If w3schools' statistics are at all accurate, there are about the same
 number of people using IE 6 as either IE 7 or 8

Stats like that are nice, but I'd be curious to see what kinds of
browser stats there are for other people running a (relatively) busy
site? real people, like on this list... not some website who have no
idea where they get their numbers from

While even today IE is still a large chunk of browser usage out there
thanks to the hoards of people who don't know better (like for
instance, my parents), my primary side is like 40% FF, %38 IE (of
which i find amazingly, half of those are IE8.. only 10% IE6), 10%
Safari, 7% Chrome  and that's out of 230,000 unique visits in the
past 30 days..  10% of 38% of IE6 (almost 9,000 visitors) is still
a headache to deal with at this point, thankfully jQuery still makes
it less of a headache  :-)  and it's much appreciated

I'd lve to just say screw IE6.. IE7 for that matter too.
but unfortunately for one reason or another the masses aren't helping
that thinking becoming reality any time soon


On Jan 12, 9:15 am, Thomas thpick...@googlemail.com wrote:
 Here's a post from John's blog in which he touches the topic of a
 general strategy for browser 
 support:http://ejohn.org/blog/the-browsers-of-2009/

 He also briefly writes about it in his (latest?) 
 book:http://www.manning.com/resig/

 Finally, John's (and thus jQuery's) testing strategy is to test
 against the previous, the current, and the upcoming (nightly build)
 version of supported browsers. [citation needed] :p

 P.S.: When I write 'John', it's probably really the whole team behind
 jQuery that worked out those approaches.

 On Jan 12, 12:41 pm, RobG rg...@iinet.net.au wrote:

  On Jan 12, 1:24 pm, Nathan Klatt n8kl...@gmail.com wrote:

IE 6 use is 3 times that of Safari (all versions) depending on whose
statistics you believe. Why not drop support for Safari while you're
at it? And Opera and Chrome?

   Because you don't have to do anything to support Safari or Chrome or
   Opera

  There are at least 5 Safari-specific quirks catered for in jQuery (I
  just searched for Safari in comments), there are likely others.
  Admittedly that's far fewer than are required for IE, but since IE 6
  is now about 10 years old, surely it's quirks are well known and
  catered for?

   - they actually work. To stop supporting them you'd have to stop
   supporting standards.

  Browsers will continue to evolve. If appropriate feature detection is
  already in place and effective alternatives provided to handle quirks,
  you may find that you are handling some new quirks without having to
  write a single line of code. :-)

  For example, while the bit in jQuery that checks if the event.target
  is a textNode is meant for Safari (pre version 3 I think), it will
  work for any browser that has such behaviour. Safari's behaviour was
  actually compliant with the spec, the far more common behaviour (i.e.
  that event.target is always a nodeType 1) is not compliant.

I work with several clients that do
not want to lead the way in this respect, and need to support IE6 as
long as it has a fair usage share, which may be for several more
years.]

That is a sensible decision

   Anyone clinging to IE6, at this point, has gone wy beyond not
   leading the way!

  If w3schools' statistics are at all accurate, there are about the same
  number of people using IE 6 as either IE 7 or 8.

  Of course support might mean whether new functionality is provided
  for old browsers and whether they continue to be part of a test suite.
  New functions that aren't tested in old browsers can simply be marked
  in the documentation, or simply features add after version x.y have
  not been tested in browser X so users know not to use them.

  --
  Rob


[jQuery] Re: show/hide

2010-01-12 Thread tabu
Thanks for your quick response, but this doesn't seem to work.

I've pasted all the code in bellow, thanks for your help

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titlestripy divs/title

style type=text/css
@importcss/stripy_simple.css;
/style


script type=text/javascript src=jquery-1.3.2.min.js
/script

!--script type=text/javascript
$(function() {
$('div').click(function() {
$('div').hide(slow); // first, for
simplification hide any
open divs (change specificity for your needs)
$(this).show(slow);   // second, open the
selected div
});
});
/script--

script type=text/javascript

   $(document).ready(function() {
 $('div.me').hide();
 $('div.who').toggle(function() {
 $(this).siblings('div.me').fadeIn(900);
 $('div.view').hide();
  $('div.callme').hide();
   $('div.imagesview').hide();
 }, function() {
 $(this).siblings('div.me').fadeOut(500);
 return false;

 });

 });

 $(document).ready(function() {

 $('div.view').hide();
 $('div.slide').toggle(function() {
 $(this).siblings('div.view').fadeIn(900);
   $('div.me').hide();
 $('div.callme').hide();
   $('div.imagesview').hide();
 }, function() {
 $(this).siblings('div.view').fadeOut(500);
 return false;

 });
 });

  $(document).ready(function() {
 $('div.showwork').hide();
 $('div.work').toggle(function() {
 $(this).siblings('div.showwork').fadeIn(900);
 }, function() {
 $(this).siblings('div.showwork').fadeOut(500);
 return false;

 });
 });

   $(document).ready(function() {
 $('div.callme').hide();
 $('div.call').toggle(function() {
 $(this).siblings('div.callme').fadeIn(900);
 $('div.view').hide();
   $('div.me').hide();
 $('div.imagesview').hide();
 }, function() {
 $(this).siblings('div.callme').fadeOut(500);
 return false;

 });
 });

$(document).ready(function() {
 $('div.imagesview').hide();
 $('div.images').toggle(function() {
 $(this).siblings('div.imagesview').fadeIn(900);
 $('div.view').hide();
   $('div.me').hide();
$('div.callme').hide();
 }, function() {
 $(this).siblings('div.imagesview').fadeOut(500);
 return false;

 });
 });

 /script

script language=javascriptAC_FL_RunContent = 0;/script
script src=js/AC_RunActiveContent.js language=javascript/
script

/head

body

div id=container

div id=subframe

div id=contentpane

div id=header
script language=javascript
if (AC_FL_RunContent == 0) {
alert(This page requires AC_RunActiveContent.js.);
} else {
AC_FL_RunContent(
'codebase', 
'http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=9,0,0,0',
'width', '550',
'height', '48',
'src', 'stripy_ident',
'quality', 'high',
'pluginspage', 
'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'transparent',
'devicefont', 'false',
'id', 'stripy_ident',
'bgcolor', '#ff',
'name', 'stripy_ident',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'stripy_ident',
'salign', ''
); //end AC code
}
/script
noscript
object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=9,0,0,0 width=550 height=48 id=stripy_ident
align=middle
param name=allowScriptAccess value=sameDomain /
param name=allowFullScreen value=false /
param name=movie value=stripy_ident.swf /param name=quality
value=high /param name=wmode value=transparent /param
name=bgcolor value=#ff /   embed src=stripy_ident.swf
quality=high bgcolor=#ff width=550 height=48
name=stripy_ident align=middle allowScriptAccess=sameDomain
allowFullScreen=false type=application/x-shockwave-flash
pluginspage=http://www.macromedia.com/go/getflashplayer; /
/object
/noscript
/div

!--div id=stripes
/div--

div id=sidebar
GRAPHIC DESIGN
/div


div id=workhide class=work
/div

!--ABOUT--
div id=about class=who
/div

div id=history class=me divs
h4 class=headingWINK/h4
pSTRIPY EYE is a one person design compendium, Im an individual
working on a freelance basis.
My experience spans roughly ten years working in a variety of
backgrounds from exhibition, print and web based media, to teaching at
FE level and recently working in flash and 3d 

[jQuery] Re: Does anybody know when jquery 1.3.3 or 1.4 will be released?

2010-01-12 Thread MorningZ
Just to follow up on this, looks like the RC1 version of 1.4 is
close... really close :-)

Damn IE6 !!

From: http://twitter.com/jeresig

# Grrr, phantom bug popped up in IE 6 just as I was about to push
1.4rc1 live.
# Need sleep in order to fight, 1.4rc1 tomorrow.
# - about 11 hours ago   from web


[jQuery] Re: Argh!! IE8!

2010-01-12 Thread Valerij
Alright, I've changed the as that are not links to divs, page is
fully valid now, but same thing happens! Just that nows its totally
impossible to open ANY of popup while it works in all other browsers!

On Jan 12, 9:19 am, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 RobG wrote:

  On Jan 12, 5:51 am, Valerijvaleri...@gmail.com  wrote:
  Hey guys, I have this popup menu that works.. great! In Chrome,
  Safari, Firefox AND it USED to work in IE8, until I added just 1 div.
  [...]

  This works in all the browsers great even after I added this div, but
  in IE8 it suddenly stopped.

  a id=acc class=baritem href=javascript:void(0);div
  class=textupMy Account/div/a

  Your markup is invalid, div elements don't belong inside a elements.

  [...]
  Is there a fix for this?

  Start with valid markup:URL:http://validator.w3.org/

 Also, if it's not a link, don't use an a element.

 Jonathan
 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Argh!! IE8!

2010-01-12 Thread MorningZ
What makes it hard to follow your code,

what is d?$(document).click(function(d){

why is is about clicking on the document?

what is a?if($(#acc+a).is(:visible)){

also, have you considered moving away from :visible?  it's got it's
quirks and niches going across browsers...  maybe using CSS classes
and hasClass, addClass, removeClass instead?


On Jan 12, 11:31 am, Valerij valeri...@gmail.com wrote:
 Alright, I've changed the as that are not links to divs, page is
 fully valid now, but same thing happens! Just that nows its totally
 impossible to open ANY of popup while it works in all other browsers!

 On Jan 12, 9:19 am, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
 wrote:

  RobG wrote:

   On Jan 12, 5:51 am, Valerijvaleri...@gmail.com  wrote:
   Hey guys, I have this popup menu that works.. great! In Chrome,
   Safari, Firefox AND it USED to work in IE8, until I added just 1 div.
   [...]

   This works in all the browsers great even after I added this div, but
   in IE8 it suddenly stopped.

   a id=acc class=baritem href=javascript:void(0);div
   class=textupMy Account/div/a

   Your markup is invalid, div elements don't belong inside a elements.

   [...]
   Is there a fix for this?

   Start with valid markup:URL:http://validator.w3.org/

  Also, if it's not a link, don't use an a element.

  Jonathan
  --
  Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Argh!! IE8!

2010-01-12 Thread Valerij
Yeah, sorry for that, I've compressed the code, then changed the HTML
when It suddenly stopped working, thats why JS is like this.
d is event, $(document).click(function(event){
var a=_menu;

What this does is that it checks if any of the popups are open, if one
of them is open, b will be sett to the name of the div that is open,
then I add the _menu and see if click came outside the, for example,
#acc_menu, (which is open), If it came outside this, the pop up will
close itself.


I've upgraded the code to addClass, removeClass and hasClass like you
said, it works better. In IE the menu starts opening and the start
closing, I guess its because In my code there is 2 triggers, 1 when
you click the button it starts showing, and then there is a function
that analyses each click. Whats weird is that it again works in all
browsers but IE.

This is the JS at this point:
http://ferok.com/labs/global.js

I thought it was enough to add this return false for it to stop
reading?


On Jan 12, 5:43 pm, MorningZ morni...@gmail.com wrote:
 What makes it hard to follow your code,

 what is d?    $(document).click(function(d){

 why is is about clicking on the document?

 what is a?    if($(#acc+a).is(:visible)){

 also, have you considered moving away from :visible?  it's got it's
 quirks and niches going across browsers...  maybe using CSS classes
 and hasClass, addClass, removeClass instead?

 On Jan 12, 11:31 am, Valerij valeri...@gmail.com wrote:



  Alright, I've changed the as that are not links to divs, page is
  fully valid now, but same thing happens! Just that nows its totally
  impossible to open ANY of popup while it works in all other browsers!

  On Jan 12, 9:19 am, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
  wrote:

   RobG wrote:

On Jan 12, 5:51 am, Valerijvaleri...@gmail.com  wrote:
Hey guys, I have this popup menu that works.. great! In Chrome,
Safari, Firefox AND it USED to work in IE8, until I added just 1 div.
[...]

This works in all the browsers great even after I added this div, but
in IE8 it suddenly stopped.

a id=acc class=baritem href=javascript:void(0);div
class=textupMy Account/div/a

Your markup is invalid, div elements don't belong inside a elements.

[...]
Is there a fix for this?

Start with valid markup:URL:http://validator.w3.org/

   Also, if it's not a link, don't use an a element.

   Jonathan
   --
   Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Make BlockUI synchronous

2010-01-12 Thread Vince
Hello all,

I have this form and a submit button.

I then try the following inside my document ready:

$(#btnSubmit).click(function() {

$.blockUI({
theme: true,
title: 'My title',
message: 'pMy message.../p',
timeout: 8000
});

return true;
});

Unfortunately the form is being submitted and completely disregards
the timout attribut I've set.
So I'm assuming there isn't a way to make blockUI synchronous and
really wait the timeout time and then, submit the form.

The reason I'm asking is because I'm having the exact same scenario as
this post:
http://osdir.com/ml/jQuery/2009-02/msg02094.html

I'm using both IE and FF


In a nutshell, between the blockUI and the return true I make an ajax
call. The time it takes varies a lot...it can be really quick like it
can take 15 seconds...

When the call is quick, the users barely has the time to view the
blockUI and read what's inside...the form gets submitted but they are
like...What happened? What was written there? I didn't have enough
time to read...

So to avoid, this, I always want a minimum of time for the blockUI to
appear even if the ajax call is quick.

As for what happens if the ajax call is lets say...15 seconds...well
that's another story!
I'd first like to know if this is even possible...to NOT make my form
submit until it has reached the timeout attribute I've set inside the
blockUI parameters.

Thanks in advance
Sincerely

Vince


[jQuery] form not submitting

2010-01-12 Thread Ayicho
I am using this plugin in here: 
http://www.overset.com/2008/07/31/jval--jquery-form-field-validation-plugin/
The form works for all the fancy validaiton, but i cannot submit.
after it passes validation, it stays on the same screen, it doesnt
submit to my form post function?

any ideas?

thanks


[jQuery] Re: Accessing an objects array from an $.ajax call

2010-01-12 Thread Scott Sauyet
On Jan 12, 10:27 am, Matthias matthias.lueb...@gmail.com wrote:
 I have an object with a member function that changes something on the
 objects state. This works perfectly fine in the easy case. But when I
 use an $.ajax call within the function it doesn't work.

 Here is the example code and failing QUnit tests:http://pastie.org/774900

There are two different problems here.  One is that unless your code
is running at www.google.de, cross-site scripting restrictions will
not allow you to AJAX in content from there.  Since this is clearly a
simple test, just checking if an AJAX call returns with any content,
you can set the url for now to document.location.href.

The main problem, though, is with the ordering of your asynchronous
code.

This is what you have:

test('testing MyObject2 async', function() {
var o2 = new MyObject2();
stop();
setTimeout(function(){
o2.myfunction(function(){start()});
}, 100);
equals(o2.mycollection.length, 1); //== fails
});

I think this might have been copied from the examples and modified
incorrectly.  In that case, the setTimeout call was supposed to be the
asynchronous call in question, as that's simpler to demonstrate than
actual AJAX calls.

The order of execution here is as follows:

1. o2 is created
2. stop is called, so no tests will be executed
3. setTimeout is called
4. equals is called, being passed the values 0 and 1.  It defers
actually running the QUnit test because stop had been called.
5. (100ms later) the argument to setTimeout is started
6. o2.myfunction is called
7. an AJAX request is made, initiating an HTTP request
8. The HTTP request completes
9. The AJAX callback pushes test onto o2's mycollection.  Only
now does the length change
   10. Your anonymous callback function is called, which calls start
   11. QUint checks if the two parameters supplied earlier are equal.
This fails.

This can be fixed relatively easily:

test('testing MyObject2 async', function() {
var o2 = new MyObject2();
stop();
o2.myfunction(function() {
equals(o2.mycollection.length, 1); //== works now
start();
});
});

This moves the call to equals *inside* the callback.  Although the
equals test is now earlier in the source code, it is executed later,
after the value you're checking has actually been updated.

I've posted an example of this to

http://jsbin.com/oxegu (code http://jsbin.com/oxegu/edit)

Good luck,

  -- Scott


[jQuery] Download file via silent mode

2010-01-12 Thread m.ugues
Hallo all.
I need to contact a server side component sending some parameters and
open on the user browser the dialog box for opening or saving the
file.
The file that the server side component creates is a PDF.

So i create clien side this function that contacts the requested url:

executePostAction: function(url) {
if (url != undefined) {
jQuery('form id=postAction action='+ url +'
method=post/form').appendTo('body');
jQuery(#postAction).submit().remove();
}
},

and this is the code where i call the function

jQuery.executePostAction('/script/PDFServlet');

Everithing works great on all browsers except ie6 (g damned bill 
steve).

Anyway I tried to get the file via ajax call in this way

jQuery.ajax({
async: false,
url: /script/PDFServlet,
type: POST,
success: function(data){
alert(data);
},
error:function(msg) {
alert(msg);
}
});

And the file is downloaded and prompted at the user as toString of the
binary.

Server side the servlet creates the header response this way

   response.setContentType(application/pdf);
   response.setHeader(Cache-Control, cache);
   response.setHeader(Pragma, cache);
   response.setHeader(Content-Disposition,
attachment;filename=document.pdf);

Any idea how to fix this problem on ie6?

Kind regards

Massimo


[jQuery] Function help

2010-01-12 Thread Dave Maharaj :: WidePixels.com
I have this function:
 
$('#new').live('click', addRecord);
 
 
 function addRecord() {
 
 var data = $('#add').serialize();
 
 $.ajax({
  type: post,
 url: /manage/add,
 data: data,
 dataType: 'json',
 success: function(response){
   if (response.status === true) {
alert(response.status);

  });
   } else {
alert(response.status);
   }
  }
 });
}

So it works fine but I have this in 5 pages on the site and was wondering
how can I turn this into a standard function and call it like:

addRecord(form_id);

So I only need to place this on the page rather thanthe same script all over
the site.

Thanks
 
Dave 



[jQuery] Re: background-color always returns transparent

2010-01-12 Thread John
Sorry, I have to come back for this question. I have really wired
problem.

I implemented the getColor similar to the jQuery color plugin as
follows,

function getColor(elem, cssName){
  var color = null;

  if (elem != null) {
   var parent = elem.parentNode;

   while (parent != null) {
   color = $(parent).css(cssName);
  //or
  // color = jQuery.curCSS(parent, cssName);
   if (color != ''  color != 'transparent' || jQuery.nodeName
(parent, body))
   break;
   parent = parent.parentNode;
   }
   }

  return color;
};

If I use the background color inline such as
html
head
/head
body

div class=categories
div class=content
div class=body
  ul id=category-list
  li class=division
  ul
  li class=category selected style=background-
color:red;
  div class=title
  a href=/suv class=category-
suvSUVs (6)/a
  /div

  /li

  li class=category category_69564
  div class=title
  a href=/4by4 class=category-
general4x4 (6)/a
  /div

  /li
  li class=category category_73293
  div class=title
  a href=/hybrid
class=category-hybridHybrid/a
  /div
  /li
 /ul
  /li
   /ul
/div
/div
/div

/body
/html

I can get back the background color of the element li
class=category selected  correctly, i.e.,
rgb(255,0,0). However, if I move the css style to the head as follows,

html
head
style type=text/css
.content .division .category.selected {
background-color: red;
}
/style
/head

I always get back the value transparent even with the getColor
method. I couldn't figure out
what was wrong and please help me with this. How can I get back the
background-color as
rgb(255,0,0) or red in the latter case.

Thanks in advance,

John


 On Jan 11, 2:31 pm, John Arrowwood jarro...@gmail.com wrote:

  As a QA tester with a lot of test automation experience, a bit of advice:
  Ask if the product would not ship if it wasn't red.  If the answer is no,
  then you might not want to waste your time.  Unless you have automated
  everything else about the functionality of the application, and are looking
  for things to automate, but I would be surprised if you had gotten that far
  already! :)

  There are some other things you can do, too, to make it easier or faster.
  If you want to discuss it off-list, email me at j...@irie-inc.com.

  On Mon, Jan 11, 2010 at 9:54 AM, John john.jian.f...@gmail.com wrote:
   Thanks for your reply. I will try to see if the background color on
   the parent works or not.

   As for checking the red color, I need to do a UI test and check if
   the background color
   is set correctly. That is to say, I am testing other people's code and
   web page.

   Thanks,

   John

   On Jan 11, 12:41 pm, John Arrowwood jarro...@gmail.com wrote:
The short answer is because the background color of the item you have
selected is in fact transparent.

Your style makes the li tag red.  Then you query on a child element
   that
has no color specified.  The background color of the child element is
'transparent' which means that the color of something up the tree is 
what
you will see.

You will never see 'red' by looking at the child element.  But what you
   can
do (and jquery.color.js does this) is while you get 'transparent' then
   you
can look at the parent object.  You can walk up the tree until you get
   what
you are looking for.

But before you go down that road, why are you looking to see the color 
of
the element?  If you can describe what you are trying to do in more
   general
terms, someone may be able to give a better suggestion on how to
   accomplish
it.

On Mon, Jan 11, 2010 at 7:39 AM, John john.jian.f...@gmail.com wrote:
 Hi,

 I used jQuery 1.3.2 and Firefox for the following html

 html
 head
 style type=text/css
 .content .division .category.selected {
 background: red;
 }

 /style
 /head
 body

 div class=categories
 div class=content
 div class=body
       ul id=category-list
               li class=division
                       ul
                       li class=category selected
                               div class=title
                                       a href=/suv class=category-
 suvSUVs (6)/a
                               /div

                       /li

                           li class=category category_69564
                               div class=title
                                       a 

[jQuery] Re: Function help

2010-01-12 Thread MorningZ
$('#new').live('click', function() {
 addRecord($(this).closest(form).attr(id));
});

function addRecord(form_id) {
.. stuff ...
});


Re: [jQuery] Function help

2010-01-12 Thread admin
If I understand you write you need to make you own js page and the link that to 
each page. The you only have the 
function in one place.
script type=text/javascript src=js/myjavascript.js/script

You can place all of your own function in this js page and then call them as 
you want from the individual page. Or 
you can have the script called automatically by adding a class that is observed.

$(document).ready(function(){
  if($(.addRecord).length) {
  addRecord();
  }
});

  ---Original Message---
  From: Dave Maharaj :: WidePixels.com d...@widepixels.com
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Function help
  Sent: Jan 12 '10 11:59
  
  I have this function:
  
  $('#new').live('click', addRecord);
  
  
  function addRecord() {
  
  var data = $('#add').serialize();
  
  $.ajax({
    type: post,
   url: /manage/add,
   data: data,
   dataType: 'json',
   success: function(response){
     if (response.status === true) {
  alert(response.status);
  
    });
     } else {
  alert(response.status);
     }
    }
  });
  }
  
  So it works fine but I have this in 5 pages on the site and was wondering
  how can I turn this into a standard function and call it like:
  
  addRecord(form_id);
  
  So I only need to place this on the page rather thanthe same script all over
  the site.
  
  Thanks
  
  Dave
  
  


[jQuery] Re: show/hide

2010-01-12 Thread bill


the jquery:

script type=text/javascript
$(function() {
$('.sectionTitle').click(function() {
$('.sectionBody').hide(slow);
$(this).next(div).show(slow);
});
});

the clickable parts:

it is unclear what you want the visitors to click on to
hide/show your sections, so i created an h1 element and
gave it a class of .sectionBody for the task. you can
certainly use whatever you like.

the content:

i wrapped the content following the h1 class=sectionTitle
elements in 'div class=contentBody/div' so
that you could easily show/hide the content.

the cleanup:

remove all of your jquery code referencing your divs.

the working example:

below is your code with the new code added in:
(please note that i removed some of your flash code as it was
aborting in my environment. you will need to add it back in.)



!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titlestripy divs/title

style type=text/css
@importcss/stripy_simple.css;
/style

script type=text/javascript src=jquery-1.3.2.min.js/script

script type=text/javascript
$(function() {
$('.sectionTitle').click(function() {
$('.sectionBody').hide(slow);
$(this).next(div).show(slow);
});
});

/script


/head

body

div id=container

div id=subframe

div id=contentpane

div id=header
noscript
object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=9,0,0,0 width=550 height=48 id=stripy_ident
align=middle
param name=allowScriptAccess value=sameDomain /
param name=allowFullScreen value=false /
param name=movie value=stripy_ident.swf /param
name=quality
value=high /param name=wmode value=transparent /param
name=bgcolor value=#ff /embed src=stripy_ident.swf
quality=high bgcolor=#ff width=550 height=48
name=stripy_ident align=middle allowScriptAccess=sameDomain
allowFullScreen=false type=application/x-shockwave-flash
pluginspage=http://www.macromedia.com/go/getflashplayer; /
/object
/noscript
/div

!--div id=stripes
/div--

div id=sidebar
GRAPHIC DESIGN
/div

div id=workhide class=work
/div
-
who
h1 class='sectionTitle'WHO/h1
div class='sectionBody'
!--ABOUT--
div id=about class=whothere is something here now/div
/div


-
me
h1 class='sectionTitle'Me/h1
div style='display: none;' class='sectionBody'
div id=history class=me divs
h4 class=headingWINK/h4
pSTRIPY EYE is a one person design compendium, Im an individual
working on a freelance basis.
My experience spans roughly ten years working in a variety of
backgrounds from exhibition, print and web based media, to teaching at
FE level and recently working in flash and 3d rendering.
br /
The site contains a selection of my work, illustrating a broad range
of skills in communication media.
br /
br /
If you wish to talk or simply seek advice about a project please
contact me
br /

t...@stripyeye.com
br /br /

If you would like further information about me, my cv is available as
a download
/p
/div

!--PROCESS--
div id=processbutton class=slide
/div
/div

-
view
h1 class='sectionTitle'VIEW/h1
div style='display: none;' class='sectionBody'

div id=main class=view

h4 class=heading PROCESS/h4

div class=divfloats
bMind/bbr /
Our perceptions of something can be both enlightening and perplexing.
We can present something that will communicate different things to
different people. Unifying the perceptions of an idea is an important
process that requires thought and a guiding hand on how it is
received. It requires someone who can take the idea in hand and enrich
it, so that it resonates in the receivers mind.
/div

div class=divfloats
bEars/bbr /
Listening to what you have to say about your design needs is of utmost
importance.
My approach is about listening to your needs and aspirations for the
design and how best to launch it in the public domain. Without
listening there is no presenting.
/div

div class=divfloats
bMouth/bbr /
Discussion and partnership through the process is equally important.
It's essential to communicate and discuss each stage of the process
and maintain constant correspondence throughout the implementation,
ensuring the project grows in the right way for you.
/div

div class=divfloats
bEyes/bbr /
The work is there for all to see, so if we get the first three right
the eyes will have it.

Help me to help you present your idea to the world.
/div

/div

!--CONTACT--
div id=contact class=call
/div
/div
-

[jQuery] Disable Submit

2010-01-12 Thread Dave Maharaj :: WidePixels.com
I have a form i am submitting via Ajax. So after submit while its waiting
for response i have my little spinner so user knows something is happening.
But how can i disable the submit while its thinking waiting for a response
so the user is not sitting there clicking submit over and over.
 
Using this for my js as of now;
 
$('#new_set').live('click', addRecord);
 
 
 function addRecord() {
 
 var data = $('#add').serialize();
 
 $(#add).slideToggle('fast');
 $('.flash').prepend('div class=saving/div');
 //$('#new_set').die('click');
 $.ajax({
  type: post,
 url: /manage/awards/add,
 data: data,
 dataType: 'json',
 success: function(response){
   if (response.status === true) {
alert(response.status);

 $('.saving').remove();

   } else {
//$('#new_set').live('click');
alert(response.status);
$('.saving').remove();

 
   }
  }
 });
}

I tried adding $('#new_set').die('click'); but then it never submitted.
 
Thanks
 
Dave



[jQuery] Re: Accessing an objects array from an $.ajax call

2010-01-12 Thread Matthias
Hey Scott

oh I thought stop() would actually hold the execution of the test...

Well thanks a lot for the superb and detailed answer. You helped me a
lot.

Matthias

On Jan 12, 6:17 pm, Scott Sauyet scott.sau...@gmail.com wrote:
 On Jan 12, 10:27 am, Matthias matthias.lueb...@gmail.com wrote:

  I have an object with a member function that changes something on the
  objects state. This works perfectly fine in the easy case. But when I
  use an $.ajax call within the function it doesn't work.

  Here is the example code and failing QUnit tests:http://pastie.org/774900

 There are two different problems here.  One is that unless your code
 is running atwww.google.de, cross-site scripting restrictions will
 not allow you to AJAX in content from there.  Since this is clearly a
 simple test, just checking if an AJAX call returns with any content,
 you can set the url for now to document.location.href.

 The main problem, though, is with the ordering of your asynchronous
 code.

 This is what you have:

     test('testing MyObject2 async', function() {
         var o2 = new MyObject2();
         stop();
         setTimeout(function(){
             o2.myfunction(function(){start()});
         }, 100);
         equals(o2.mycollection.length, 1); //== fails
     });

 I think this might have been copied from the examples and modified
 incorrectly.  In that case, the setTimeout call was supposed to be the
 asynchronous call in question, as that's simpler to demonstrate than
 actual AJAX calls.

 The order of execution here is as follows:

     1. o2 is created
     2. stop is called, so no tests will be executed
     3. setTimeout is called
     4. equals is called, being passed the values 0 and 1.  It defers
 actually running the QUnit test because stop had been called.
     5. (100ms later) the argument to setTimeout is started
     6. o2.myfunction is called
     7. an AJAX request is made, initiating an HTTP request
     8. The HTTP request completes
     9. The AJAX callback pushes test onto o2's mycollection.  Only
 now does the length change
    10. Your anonymous callback function is called, which calls start
    11. QUint checks if the two parameters supplied earlier are equal.
 This fails.

 This can be fixed relatively easily:

     test('testing MyObject2 async', function() {
         var o2 = new MyObject2();
         stop();
         o2.myfunction(function() {
             equals(o2.mycollection.length, 1); //== works now
             start();
         });
     });

 This moves the call to equals *inside* the callback.  Although the
 equals test is now earlier in the source code, it is executed later,
 after the value you're checking has actually been updated.

 I've posted an example of this to

    http://jsbin.com/oxegu(codehttp://jsbin.com/oxegu/edit)

 Good luck,

   -- Scott


[jQuery] Get Value. Please, is kind of urgent. Thanks.

2010-01-12 Thread shapper
Hello,

I have the following on my script:

$(document).ready(function() {

  if (GBrowserIsCompatible()) {
$.getJSON(/Google/Map, Initialise);
  } // Initialize Google Map

}

And in my HTML I have:
  input id=Place name=Place type=hidden value=3 /

I want to run the JS code only if GBrowserIsCompatible() is defined.

If it is and if Place hidden value is not  then I want to call:
$.getJSON(/Google/Map/{hidden_value}, Initialise);

In this case hidden value is 3.

If hidden value is  then just call:
$.getJSON(/Google/Map, Initialise);

Please, could someone help me out?

Thanks,
Miguel


[jQuery] Re: Selecting a value with up down keys

2010-01-12 Thread m.sirin
Hi, I used your code but still it's the same problem: If the box
appears the up and down keys will do nothing.
It would be nice, if you take a quick look at
http://igf-project.igf.uos.de/~bhempen/index_tomaten.html where you
can see the problem.

regards
m.sirin

On 11 Jan., 01:27, Šime Vidas sime.vi...@gmail.com wrote:
 Actually, this is right...

 $().keydown(function(e) {
         var $item = $(.selected);
                 if (e.keyCode === 40) { // bottom
                         if ($item.next().is(li)) {
                                 $item.removeClass(selected).next
 ().addClass(selected);
                                 alert($item.get(0).innerHTML);
                         }
                 } else if (e.keyCode === 38) {
                         if ($item.prev().is(li)) {
                                 $item.removeClass(selected).prev
 ().addClass(selected);
                                 alert($item.get(0).innerHTML);
                         }
                 }
         });

 });

[jQuery] Re: Disable Submit

2010-01-12 Thread MorningZ
Personally i suggest using BlockUI to overlay the whole form... that
way
1) not possible for your user to resubmit
2) gives dead obvious indication something is going on
3) simple as can be to use

On Jan 12, 2:49 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I have a form i am submitting via Ajax. So after submit while its waiting
 for response i have my little spinner so user knows something is happening.
 But how can i disable the submit while its thinking waiting for a response
 so the user is not sitting there clicking submit over and over.

 Using this for my js as of now;

 $('#new_set').live('click', addRecord);

  function addRecord() {

  var data = $('#add').serialize();

  $(#add).slideToggle('fast');
  $('.flash').prepend('div class=saving/div');
  //$('#new_set').die('click');
  $.ajax({
   type: post,
          url: /manage/awards/add,
          data: data,
          dataType: 'json',
          success: function(response){
    if (response.status === true) {
     alert(response.status);

      $('.saving').remove();

    } else {
                 //$('#new_set').live('click');
     alert(response.status);
     $('.saving').remove();

    }
   }
  });
     }

 I tried adding $('#new_set').die('click'); but then it never submitted.

 Thanks

 Dave


Re: [jQuery] Get Value. Please, is kind of urgent. Thanks.

2010-01-12 Thread Nathan Klatt
Like so?

if (GBrowserIsCompatible()) {
   var gmapsUrl = /Google/Map;
   if ($(#Place).val())
  gmapsUrl += /+$(#Place).val();
   $.getJSON(gmapsUrl, Initialise);
}


RE: [jQuery] Re: Disable Submit

2010-01-12 Thread Dave Maharaj :: WidePixels.com
Ok thanks.sounds good to me.

Will check it out.

Dave 

-Original Message-
From: MorningZ [mailto:morni...@gmail.com] 
Sent: January-12-10 4:42 PM
To: jQuery (English)
Subject: [jQuery] Re: Disable Submit

Personally i suggest using BlockUI to overlay the whole form... that way
1) not possible for your user to resubmit
2) gives dead obvious indication something is going on
3) simple as can be to use

On Jan 12, 2:49 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I have a form i am submitting via Ajax. So after submit while its 
 waiting for response i have my little spinner so user knows something is
happening.
 But how can i disable the submit while its thinking waiting for a 
 response so the user is not sitting there clicking submit over and over.

 Using this for my js as of now;

 $('#new_set').live('click', addRecord);

  function addRecord() {

  var data = $('#add').serialize();

  $(#add).slideToggle('fast');
  $('.flash').prepend('div class=saving/div');
  //$('#new_set').die('click');
  $.ajax({
   type: post,
          url: /manage/awards/add,
          data: data,
          dataType: 'json',
          success: function(response){
    if (response.status === true) {
     alert(response.status);

      $('.saving').remove();

    } else {
                 //$('#new_set').live('click');
     alert(response.status);
     $('.saving').remove();

    }
   }
  });
     }

 I tried adding $('#new_set').die('click'); but then it never submitted.

 Thanks

 Dave
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/12/10
04:05:00



[jQuery] Re: Accessing an objects array from an $.ajax call

2010-01-12 Thread Scott Sauyet
On Jan 12, 2:50 pm, Matthias matthias.lueb...@gmail.com wrote:
 oh I thought stop() would actually hold the execution of the test...

It does.  However the parameters passed in to the equals call are
evaluated immediately, as they are in most programming languages.
(Haskell is an exception, and other languages might allow it as
well.)  So you've essentially delayed the execution of comparing 0 and
1.

 Well thanks a lot for the superb and detailed answer. You helped me a
 lot.

Glad to hear it.  You're welcome.

  -- Scott


[jQuery] Re: Disable Submit

2010-01-12 Thread MorningZ
Dave

here's a quick 2 minute example of this topic and the other topic

http://jsbin.com/efona/edit (code)
http://jsbin.com/efona (run)

very little jQuery to wire that up :-)


[jQuery] Re: Disable Submit

2010-01-12 Thread MorningZ
btw, i forgot to add return false; to the end of both button
events there, that would be needed


[jQuery] Re: Disable Submit

2010-01-12 Thread Scott Sauyet
On Jan 12, 2:49 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I have a form i am submitting via Ajax. So after submit while its waiting
 for response i have my little spinner so user knows something is happening.
 But how can i disable the submit while its thinking waiting for a response
 so the user is not sitting there clicking submit over and over.

MorningZ's suggestion is good, but there is another approach that is
always worth considering for any long-running function that you don't
want started while it's already running.

function myLongRunningFunc() {
if (arguments.callee.running) return;
arguments.callee.running = true;

// your processing here

arguments.callee.running = false;
}

This is simpler than you need, if you have multiple forms to submit,
so you'd have to store the running flag in the form, not the function,
but it's not too hard to modify.

Here's a modification of MorningZ's page:

http://jsbin.com/upilo (code http://jsbin.com/upilo/edit)

I think this is incomplete, because a form can be submitted in other
ways than by the click of a particular button, but some variation of
this might do.

It's not that I think this is a better solution than blockUI, but it's
a useful technique in its own right.

Cheers,

  -- Scott


RE: [jQuery] Re: Disable Submit

2010-01-12 Thread Dave Maharaj :: WidePixels.com
Looks good .

Thanks will try to add that to my site and see how it goes.

Dave 

-Original Message-
From: Scott Sauyet [mailto:scott.sau...@gmail.com] 
Sent: January-12-10 6:06 PM
To: jQuery (English)
Subject: [jQuery] Re: Disable Submit

On Jan 12, 2:49 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I have a form i am submitting via Ajax. So after submit while its 
 waiting for response i have my little spinner so user knows something is
happening.
 But how can i disable the submit while its thinking waiting for a 
 response so the user is not sitting there clicking submit over and over.

MorningZ's suggestion is good, but there is another approach that is always
worth considering for any long-running function that you don't want started
while it's already running.

function myLongRunningFunc() {
if (arguments.callee.running) return;
arguments.callee.running = true;

// your processing here

arguments.callee.running = false;
}

This is simpler than you need, if you have multiple forms to submit, so
you'd have to store the running flag in the form, not the function, but it's
not too hard to modify.

Here's a modification of MorningZ's page:

http://jsbin.com/upilo (code http://jsbin.com/upilo/edit)

I think this is incomplete, because a form can be submitted in other ways
than by the click of a particular button, but some variation of this might
do.

It's not that I think this is a better solution than blockUI, but it's a
useful technique in its own right.

Cheers,

  -- Scott
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/12/10
04:05:00



[jQuery] Re: Get Value. Please, is kind of urgent. Thanks.

2010-01-12 Thread shapper
And is there a way to check if GBrowserCompatible is valid?

When I am not using google maps I don't load the Google maps script.
However this code is always present.

Thank You,
Miguel

On Jan 12, 8:13 pm, Nathan Klatt n8kl...@gmail.com wrote:
 Like so?

 if (GBrowserIsCompatible()) {
    var gmapsUrl = /Google/Map;
    if ($(#Place).val())
       gmapsUrl += /+$(#Place).val();
    $.getJSON(gmapsUrl, Initialise);

 }




[jQuery] What software distributes jQuery?

2010-01-12 Thread justintr
I know that MS Visual Studio 2010 will ship with jQuery. Are there any
products that currently distribute jQuery? For instance, Adobe
Dreamweaver ships with Adobe's framework, Spry. My inquiry regards an
Application Server or an IDE.


[jQuery] How to set errorContainer in jQuery validation dynamically?

2010-01-12 Thread John
Can I dynamically set errorContainer in jQuery validation, which means
showing different error container base on the button clicked.

I have posted question on stackoverflow
http://stackoverflow.com/questions/2052200/how-to-set-errorcontainer-in-jquery-validation-dynamically



[jQuery] simplemodal, want function to run upon $(document).ready

2010-01-12 Thread Domanique Alicia
Hello all,

I wonder if anyone can shed some light on my problem.

I am updating a site that uses the simplemodal plug in (http://
www.ericmmartin.com/projects/simplemodal/) to create a lightbox-esque
effect when opening included php files.

Now then, the plug-in uses a function that is called when the item in
the DOM is clicked:

$('#__SELECTED_ELEMENT__:eq(0)').click(function (e) {
e.preventDefault();
$.get(__FILE.PHP__, function(data){
$(data).modal({
close: false,
overlayId: 'modalOverlay',
containerId: 'miniProteanContainer',
onOpen: site_terms.open,
onClose: site_terms.close
});
});
});


Essentially, I want this function to run as soon at the document is
loaded.

I have tried:
1. Seeing if I could change the event type to LOAD (thinking I would
be tricky and bypass the whole click) and I can only change the event
type to hover.

2. Setting this function in the $(document).ready(function(){} at the
root, assuming the function would run after the document was loaded.
(see the following example)

$(document).ready(function(e){
e.preventDefault();
$.get(__FILE.PHP__, function(data){
$(data).modal({
close: false,
overlayId: 'modalOverlay',
containerId: 'miniProteanContainer',
onOpen: site_terms.open,
onClose: site_terms.close
});
});
});



Has anyone else encountered this? Any recommendations on how I should
attack the problem?

Thanks,
Domanique


[jQuery] old problem - not solved yet

2010-01-12 Thread coccolino
I use superfish menu with joomla.
On my computer (IE8) it works great. But users of my homepage tell me,
the superfish menu is UNERNETH the main content. I also read the FAQ
on the developpers homepage.
This problem was also explained there:
http://webdemar.com/webdesign/superfish-jquery-menu-ie-z-index-bug/

As I am a newbie in CSS, I don't know where to put the mentioned
changes (which *.css file).

Can you help me?

Thank you in advance.
Best regards
Coccolino


[jQuery] Re: Autocomplete selection blanks out input field

2010-01-12 Thread Marty Jones
I had the same issue.  The mustMatch flag causes the second request
to validate the text that was set.  Make sure that the selected input
value can successfully be submitted to your ajax request and come back
with a hit.  If a match is not found the the text's input field will
be cleared.

On Jan 11, 2:58 pm, j...@verax joti.bis...@gmail.com wrote:
 Hi,

 I have been using the jquery autocomplete plug-in for some time now
 and find it very useful. Lately I have come across the following
 problem in one of my JSP pages.

 The autocomplete suggestions are displayed and formatted properly. But
 when I select the one that I want, the result briefly appears in the
 input field and disappears. Simultaneously, the entered result
 automatically triggers another jquery search.

 The contents of my JSP page is given below. The same jquery code works
 perfectly well with other JSPs. Can anyone help ?

 --JSP
 code---­-

 %@ include file=../common/include.jsp %
 script
                         var cols = []; // column mappings : 0=Last name, 
 1=First Name,
 2=Title, 3 = Employee ID
                         $().ready(function() {
                                 $('input#employeeLastName').flushCache();
                                 
 $(#employeeLastName).autocomplete(jsp/common/getData.jsp?
 dataType=EmployeeName,{
                                         minChars: 1,
                                         max: 1000,
                                         width: 400,
                                         delay: 1000,
                                         selectFirst: false,
                                         autoFill: false,
                                         cacheLength: 20,
                                         matchContains: false,
                                         matchSubset: true,
                                         mustMatch: true,
                                         matchCase: true,
                                         formatItem: function(row, i, max) {
                                                 cols = row[0].split(%);
                                                 return i + / + max + :  + 
 cols[0] + ,  + cols[1] +  ( +
 cols[2] + );
                                         },
                                         formatMatch: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1];
                                         },
                                         formatResult: function(row) {
                                                 cols = row[0].split(%);
                                                 return cols[0] + ,  + 
 cols[1] +  ( + cols[2] + );
                                         }
                                 });
                                 $(#employeeLastName).result(function(event, 
 row, formatted) {
                                         if (row) {
                                                 cols = row[0].split(%);
                                                 $(this).next().val(cols[3]);
                                         }
                                 });
                         });
 /script

 tiles:importAttribute name=task /
 tiles:importAttribute name=action /
 tiles:importAttribute name=displayAction /
 tiles:importAttribute name=showArchived /

 style type=text/css
         @import ${pageContext.request.contextPath}/css/employee/select.css;
 /style

 h1
         fmt:message key=employee.label.title.select /
 /h1
 hr /

 div id=employeeSelect
         tiles:insert definition=successMessages /
         tiles:insert definition=failureMessages /
         ccrd:errors /

         html:form action=${action} method=post 

                 label for=employee id=employeeLbl 
                         fmt:message key=employee.text.selectEmployee /
                         span class=taskfmt:message key=${task} 
 /:/span
                 /label

                 html:text styleId=employeeLastName property=lastName
 size=100
                         maxlength=200
                 /html:text
                 html:hidden property=employeeId /
                 BR/ BR/
                 div class=buttons
                         html:submit property=submit 
 styleId=submitButtonfmt:message
 key=button.submit//html:submit
                         html:submit property=cancel 
 styleId=cancelButtonfmt:message
 key=button.cancel//html:submit
                 /div

         /html:form
 /div

 ---end of jsp
 code---­---


[jQuery] Learn jQuery in 120 minutes - Arabic book

2010-01-12 Thread mukhtar sayed saleh
I have written an Arabic book About jQuery which title is :
Learn jQuery in 120 minutes


http://www.abokamal.net/jQuery120minute.gif

can you support me ?



[jQuery] Is treeview plugin using some other plugin for cookie persistence

2010-01-12 Thread epitka
If so, which plugin is it using? I cannot find anything in docs.



Re: [jQuery] Re: Get Value. Please, is kind of urgent. Thanks.

2010-01-12 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 3:42 PM, shapper mdmo...@gmail.com wrote:
 And is there a way to check if GBrowserCompatible is valid?

From http://www.idealog.us/2007/02/check_if_a_java.html:

if (typeof(yourFunctionName) == 'function') yourFunctionName();

Nathan


[jQuery] Re: Function help

2010-01-12 Thread Scott Sauyet
On Jan 12, 1:59 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I have this function:
 [ ... ]
 So it works fine but I have this in 5 pages on the site and was wondering
 how can I turn this into a standard function and call it like:

 addRecord(form_id);

There are several ways to do this.  The simplest is as follows:

function internalAddRecord() {
var data = $('#add').serialize();
$.ajax({
// ...
});
}

function addRecord(formId) {
$('#' + formId).live('click', internalAddRecord);
}

addRecord('myForm');

This is straightforward.  But it has one issue in that it pollutes the
global namespace with the internalAddRecord function, which presumably
shouldn't be used anywhere else.  You could make the function
anonymous, like this:

function addRecord(formId) {
$('#' + formId).live('click', function() {
var data = $('#add').serialize();
$.ajax({
// ...
});
});
}

But if that's not to your taste but you don't want to pollute the
global scope, you will need to store that internal function in some
other scope.  One technique stores it inside your main function like
this:

function addRecord(formId) {
function internalAddRecord() {
var data = $('#add').serialize();
$.ajax({
// ...
});
}

$('#' + formId).live('click', internalAddRecord);
}

addRecord('myForm');

This works; you expose only the addRecord function.  But it is a
little wasteful of memory as it creates a new copy of the
internalAddRecord function for every call to addRecord.  Another
variation which is syntactically more complex, but which saves you
that overhead would store the internal function inside a closure, as
such:

var addRecord = (function() {
function internalAddRecord() {
var data = $('#add').serialize();
$.ajax({
// ...
});
}
return function(formId) {
$('#' + formId).live('click', internalAddRecord);
}
})()

addRecord('myForm');

An alternative method involves creating a jQuery plug-in for your
functionality, so that you could use it like this:

$(#myForm).addRecord().hide().fadeIn('slow');

That would have some advantages, but is probably not worth the
effort.  If you're interested, Mike Alsup's tutorial is excellent:

http://www.learningjquery.com/2007/10/a-plugin-development-pattern

None of these are tested, of course.

Good luck,

  -- Scott


[jQuery] Append prepend?

2010-01-12 Thread Dave Maharaj :: WidePixels.com
I cant seem to understand the logic behind these functions. append prepend
appendTo, prependTo
 
I have:
 
div id=sortable
 *** add new li from response here ***
licontent/li
licontent/li
licontent/li
/div
 
so i get my response from the server and trying to get it to appear at the
top of all the other li's and slide down with the hi-lighted effect. All i
get is above the div id=sortable or under the last li.
 
$('#sortable').append(response.html).slideDown('slow').highlightFade({speed:
3000});
  
$(response.html).hide().append('#sortable').slideDown('slow').highlightFade(
{speed:3000});
 
Ideas where i went wrong?
 
Dave


Re: [jQuery] Append prepend?

2010-01-12 Thread Nathan Klatt
On Tue, Jan 12, 2010 at 4:36 PM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I cant seem to understand the logic behind these functions. append prepend
 appendTo, prependTo

Methinks you're very close! This what you're getting at?

http://jsbin.com/elaja/edit

Nathan


[jQuery] Validation

2010-01-12 Thread Seth
Hello,

I'm using jquery with the form and validation plugins. I have this:

script type=text/javascript
$(document).ready(function() {
$(#autoSumForm).validate({
rules: {
p1001: {number: true},
p1002: {number: true}
},
messages: {
p1001: ,
p1002: 
}
});

$('#autoSumForm').ajaxForm(function() {
alert(Time submitted.);
});
});
/script

The validation and the form submit both work, but the form submits
even if not valid. How do I combine the two?

Thanks.


[jQuery] Re: show/hide

2010-01-12 Thread tabu
Wow, thanks for your work on this.
Sorry but it's a little confusing as to what is happening in the
preview, I have uploaded the pages I've done before just so you can
visualize what I'm going for.
1.
http://www.democraticunionfordesign.com/test/index_refresh.html

2.
http://www.democraticunionfordesign.com/test/index_simple.html

Number 1 is really how I'd like it the content to slide in and out but
as you'll see the process div leaves a latent image for some reason
and also it shifts the menu down too, I figure the shifting menu is a
div positioning problem.

What I'm actually after is simply a single click on and off when each
div is called.
Really appreciate what you've done, I'll try and work through it a
little more see if I can make more sense of it.

Thanks again.


On Jan 12, 7:42 pm, bill ozzi...@gmail.com wrote:
 the jquery:

 script type=text/javascript
 $(function() {
         $('.sectionTitle').click(function() {
                 $('.sectionBody').hide(slow);
                 $(this).next(div).show(slow);
         });

 });

 the clickable parts:

 it is unclear what you want the visitors to click on to
 hide/show your sections, so i created an h1 element and
 gave it a class of .sectionBody for the task. you can
 certainly use whatever you like.

 the content:

 i wrapped the content following the h1 class=sectionTitle
 elements in 'div class=contentBody/div' so
 that you could easily show/hide the content.

 the cleanup:

 remove all of your jquery code referencing your divs.

 the working example:

 below is your code with the new code added in:
 (please note that i removed some of your flash code as it was
 aborting in my environment. you will need to add it back in.)

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 titlestripy divs/title

 style type=text/css
 @importcss/stripy_simple.css;
 /style

 script type=text/javascript src=jquery-1.3.2.min.js/script

 script type=text/javascript
 $(function() {
         $('.sectionTitle').click(function() {
                 $('.sectionBody').hide(slow);
                 $(this).next(div).show(slow);
         });

 });

 /script

 /head

 body

 div id=container

 div id=subframe

 div id=contentpane

 div id=header
 noscript
         object classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354
 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/
 swflash.cab#version=9,0,0,0 width=550 height=48 id=stripy_ident
 align=middle
         param name=allowScriptAccess value=sameDomain /
         param name=allowFullScreen value=false /
         param name=movie value=stripy_ident.swf /param
 name=quality
 value=high /param name=wmode value=transparent /param
 name=bgcolor value=#ff /        embed src=stripy_ident.swf
 quality=high bgcolor=#ff width=550 height=48
 name=stripy_ident align=middle allowScriptAccess=sameDomain
 allowFullScreen=false type=application/x-shockwave-flash
 pluginspage=http://www.macromedia.com/go/getflashplayer; /
         /object
 /noscript
 /div

 !--div id=stripes
 /div--

 div id=sidebar
 GRAPHIC DESIGN
 /div

 div id=workhide class=work
 /div
 -
 who
 h1 class='sectionTitle'WHO/h1
 div class='sectionBody'
         !--ABOUT--
         div id=about class=whothere is something here now/div
 /div

 -
 me
 h1 class='sectionTitle'Me/h1
 div style='display: none;' class='sectionBody'
 div id=history class=me divs
 h4 class=headingWINK/h4
 pSTRIPY EYE is a one person design compendium, Im an individual
 working on a freelance basis.
 My experience spans roughly ten years working in a variety of
 backgrounds from exhibition, print and web based media, to teaching at
 FE level and recently working in flash and 3d rendering.
 br /
 The site contains a selection of my work, illustrating a broad range
 of skills in communication media.
 br /
 br /
 If you wish to talk or simply seek advice about a project please
 contact me
 br /

 t...@stripyeye.com
 br /br /

 If you would like further information about me, my cv is available as
 a download
 /p
 /div

 !--PROCESS--
 div id=processbutton class=slide
 /div
 /div

 -
 view
 h1 class='sectionTitle'VIEW/h1
 div style='display: none;' class='sectionBody'

 div id=main class=view

 h4 class=heading PROCESS/h4

 div class=divfloats
 bMind/bbr /
 Our perceptions of something can be both enlightening and perplexing.
 We can present something that will communicate different things to
 different people. Unifying the perceptions of an idea is an important
 process that requires thought and a guiding hand on how it is
 received. It requires someone who can take the idea in hand and 

Re: [jQuery] What software distributes jQuery?

2010-01-12 Thread Massimo Lombardo
On Tue, Jan 12, 2010 at 20:54, justintr jtre...@gmail.com wrote:
 Are there any products that currently distribute jQuery?

Just to name the first ones that popped up in my mind:
- Aptana Inc. Aptana Studio, through plugin [1]
- ActiveState Komodo (both IDE and Edit flavors), through plugin [2]
- MacroMates TextMate, through bundle [3, 4]
- MacRabbit Espresso, through sugar [5, 6]
- NetBeans (not completely sure about this)

[1] http://www.aptana.org/
[2] http://www.activestate.com/komodo_edit/
[3] http://macromates.com/
[4] http://github.com/kswedberg/jquery-tmbundle
[5] http://macrabbit.com/espresso/
[6] http://fileability.net/coffee/sugar/jQuery
-- 
Massimo Lombardo
Linux user #437712


RE: [jQuery] Re: Function help

2010-01-12 Thread Dave Maharaj :: WidePixels.com

But I think I started off wrong using the click functions the form should be
bind submit no?

I am here now but nothing

addTest('#add_test'); //this is the form ID and on the html page


Below is in the external js sheet


function addTest(selector)
{
var $form = $(selector);

$form.submit( function() {



var form_url = $form.attr('action');
alert(form_url);

return false;
  });


}

But no alert. Any ideas?

Thanks

Dave

-Original Message-
From: MorningZ [mailto:morni...@gmail.com] 
Sent: January-12-10 3:53 PM
To: jQuery (English)
Subject: [jQuery] Re: Function help

$('#new').live('click', function() {
 addRecord($(this).closest(form).attr(id));
});

function addRecord(form_id) {
.. stuff ...
});
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/12/10
04:05:00



[jQuery] background mouseover fade effect

2010-01-12 Thread 1.am.W1z4rd
I need to add a mouseover effect to the navigation for a site that I'm
building.  I need the backgroundColor to fade from none, to black, and
then on mouseout, I need it to fade back to none.  This would be easy
if I were using two colors, but since I'm using 'none' as one of the
color's, I don't know what to do.  I have tried:

[code]
$('.nav_link').hover(function() {
$(this).animate({backgroundColor: '#00'});
}, function() {
$(this).animate({backgroundColor: 'none'});
});
[/code]

but that doesn't seem to work.

Any help / plugin links would be greatly appreciated.

Thanks, bye.


[jQuery] Actually deleting instead of .remove

2010-01-12 Thread sophos707
Hi everyone,
I'm running a script that processes text messages people send in, and
then it displays them on a screen.  It will loop the text messages
when there are too many to show on one screen.

To accomplish this I add DIVs with a new ID for each new message.  The
new messages push the old ones off the screen eventually.  But when
this is the case the memory in the browser just keeps increasing to a
frightening load!

I tried using $(#MyDivId).remove() to get rid of the DIVs no longer
on the screen.  Memory keeps increasing.  Found out in this forum
that .remove() just hides an element in the DOM and makes in
inaccessible rather than actually deleting it.

How can we actually delete elements?
Thanks!
- Jeff


[jQuery] Add option to autocomplete plugin to set method

2010-01-12 Thread Devether
Hello,

Would it be possible to add the choice of method in options ?

eg:
$(#username).autocomplete(url, {max: 50, type: 'POST'});


Devether


[jQuery] simple plugin script

2010-01-12 Thread Dean
In my plugin, I'd like to provide a constructor (or sorts) that
returns an extended jQuery object with some additional functionality.

I've reduced this problem down to a very simple test case.

I don't get an error until I attempt to run a method of the new,
extended object. The error is foo.rename is not a function. This
apparently means that I was not successful in extending $(this) in the
plugin's constructor, but I'm not sure why. Does anyone know why?

!DOCTYPE html
html
head
  titleTest/title
  script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.js type=text/javascript/script
  script type=text/javascript
(function($)
{
  /* Extend the jQuery prototype so any selected element(s) can
implement create_content. */
  $.fn.extend
  ({
/* Initialize this extended object. */
create_content: function(settings)
{
  /* Initialize all matched elements. */
  return this.each(function(i, el)
  {
/* Extend $(this) with additional properties and methods. */
$.extend(false, $(this),
  {
s: settings,
/* Show this content. */
activate: function()
{
  return this.show();
},
/* Hide this content. */
deactivate: function()
{
  return this.hide();
},
/* Change the content. */
rename: function()
{
  return this.html(settings[text]);
}
  }
);
  });
}, // end create_content
  }); // end $.fn.extend
})(jQuery);

$(document).ready(function()
{
  var foo = $(#foo).create_content({ text: New text for
foo. }); // Error: foo.rename is not a function.
  var bar = $(#bar).create_content({ text: New text for bar. });

  foo.rename();
  bar.rename();
});
/script
/head
body
  div id=fooFoo/div
  div id=barBar/div
/body
/html


[jQuery] image cycle, fade on click

2010-01-12 Thread Simon
Hi I'm trying with no luck to fade on click the image cycle, can
anyone offer any assistance to a novice.
Fading is ok but I'm not sure where to add the onClick.

Thanks

Simon


[jQuery] Superfish: 2nd dropdown positioning

2010-01-12 Thread mcpilot
I have Superfish installed on a website and have a 3-tier dropdown. li/
li/li. The 3rd tier is not positioned correctly, it's behind the
second  tier. (http://208.84.152.20/~loveland1)

Lookiung for the CSS line to tweak to move that out.

Pat


[jQuery] Easy Transition to JQUERY - i hope this is right place to post this question

2010-01-12 Thread Mole
I am not a programmer but a designer and after a lot of trial and
error using examples I got this code working. I have been studying
JQUERY for a week and want to use it in place of my original AJAX, but
I am confused as to the best methods to use to get the same capability
and most efficient response.

Is there an easy way to transition my existing AJAX script into what
is obviously the more efficient JQUERY methods. I essentially have a
set of category buttons (images in a class) called from a MySQL
database (9 load at start - lev is 1) on selection of a button I call
the database to get the next level of buttons and replace the cat
buttons. I know I need to use the  $.getJSON(scripts/getcat.php,
calling my php script which extracts the data from the database and
returns the JSON formatted data.
but cant quite get the placement of var and callback.

MUST BE MUCH EASIER WITH JQUERY Thanks in advance for any for any
guidance.

// selectlist.js
var xmlhttplist;
showList(0,1);
function showList(cat,lev)
{
xmlhttplist=GetXmlHttpObjectList();
if (xmlhttplist==null)
{
alert (Browser does not support HTTP Request);
return;
}
var url=scripts/getlist.php;
url=url+?cat=+cat;
url=url+lev=+lev;
url=url+sid=+Math.random();
xmlhttplist.onreadystatechange=stateChangedList;
xmlhttplist.open(GET,url,true);
xmlhttplist.send(null);
}
function stateChangedList()
{
if (xmlhttplist.readyState==4)
{

var xmlDoc=xmlhttplist.responseXML;

// Load list
var mainData = ;
var x=xmlDoc.getElementsByTagName(Category);
var lastLev = xmlDoc.getElementsByTagName(Category)
[x.length-1].getElementsByTagName(NextLevel)[0].childNodes
[0].nodeValue;
var currLev = lastLev + 1;

for (i=0;ix.length;i++)
{
if (i==x.length-1)
{
if (lastLev1)
{

document.getElementById(home).innerHTML=
img class='buttonhomeimage' 
src='images/homepage.jpg'
onclick='showList(0,1)' /;

document.getElementById(back).innerHTML=
img class='buttonhomeimage' 
src='images/back.jpg'
onclick='showList(0,0)' /;
break;
}
else
{

document.getElementById(home).innerHTML=
img class='buttonhomeimage' 
src='images/homepage.jpg'
onclick='showList(0,1)' /

document.getElementById(back).innerHTML=
img class='buttonhomeimage' 
src='images/back.jpg'
onclick='showList(+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(NextCategory)[0].childNodes[0].nodeValue+
,+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(NextLevel)[0].childNodes[0].nodeValue+
)' /;
break;
}
}
if (lastLev  3)
{
mainData +=
div class='button9' 
onclick='showList(+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(NextCategory)[0].childNodes[0].nodeValue+
,+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(NextLevel)[0].childNodes[0].nodeValue+
)'+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(Name)[0].childNodes[0].nodeValue+
/div;
}
else if (lastLev == 3)
{
mainData +=
div class='listing' 
onclick='showList(+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(NextCategory)[0].childNodes[0].nodeValue+
,+

xmlDoc.getElementsByTagName(Category)[i].getElementsByTagName
(NextLevel)[0].childNodes[0].nodeValue+
)'+

[jQuery] Re: Make BlockUI synchronous

2010-01-12 Thread Dave Methvin
When the button is clicked, set a variable to the current time and
return false from the handler to cancel the submit. When your ajax
completes, do a settimeout for the difference between the variable you
set and the min length of time  you want to show the blockui. When the
settimeout fires it can do the $(#myform).submit() to submit the
form.

On Jan 12, 11:48 am, Vince vli...@yahoo.com wrote:
 Hello all,

 I have this form and a submit button.

 I then try the following inside my document ready:

 $(#btnSubmit).click(function() {

             $.blockUI({
                 theme: true,
                 title: 'My title',
                 message: 'pMy message.../p',
                 timeout: 8000
             });

             return true;

 });

 Unfortunately the form is being submitted and completely disregards
 the timout attribut I've set.
 So I'm assuming there isn't a way to make blockUI synchronous and
 really wait the timeout time and then, submit the form.

 The reason I'm asking is because I'm having the exact same scenario as
 this post:http://osdir.com/ml/jQuery/2009-02/msg02094.html

 I'm using both IE and FF

 In a nutshell, between the blockUI and the return true I make an ajax
 call. The time it takes varies a lot...it can be really quick like it
 can take 15 seconds...

 When the call is quick, the users barely has the time to view the
 blockUI and read what's inside...the form gets submitted but they are
 like...What happened? What was written there? I didn't have enough
 time to read...

 So to avoid, this, I always want a minimum of time for the blockUI to
 appear even if the ajax call is quick.

 As for what happens if the ajax call is lets say...15 seconds...well
 that's another story!
 I'd first like to know if this is even possible...to NOT make my form
 submit until it has reached the timeout attribute I've set inside the
 blockUI parameters.

 Thanks in advance
 Sincerely

 Vince


[jQuery] keep executing the script after a few seconds

2010-01-12 Thread runrunforest
Say i want the alert message hello appear every 90 seconds, how can
i do it ?


Re: [jQuery] iHwy creditcard2 validation extension fails on some Discover cards

2010-01-12 Thread Jack Killpatrick

Hi,

We've made the change to the plugin and are hoping to deploy it tonight. 
After it's deployed I'll post an ANNOUNCE here. Thanks for bringing this 
to my attention. We also added LaserCard support and updated some other 
card prefixes.


- Jack

dnfdrmn wrote:

Hi all,

We're working with Paypal sandbox generated Discover cards, and
they're not passing the iHwy credit card validation extension for
jQuery. This seems to be a PayPal issue, as PayPal is generating
invalid IIN ranges.

But in our research, we noticed that the iHwy extension isn't properly
validating *newer* Discover IIN range updates (two PDFs are available
online, from

An update that takes into account the new ranges -- 6011,
622126-622925, 644-649, 65 -- would be much appreciated.

regards,
dnfdrmn

  





[jQuery] slideUp very slow depending on number of fields above

2010-01-12 Thread Eric Cope
Hello all,
I am using the slideUp animation to hide a div.  Above the div, are 25
other divs that may or may not be visible. The speed of the slideUp
animation depends on how many of those divs are visible. if 25 divs
are visible, the animation takes 1200ms. If 20 divs are visible, the
animation takes 700ms. If 15 divs are visible, it takes 600ms. If 10
divs are visible, it takes 470-500 ms. if 5 divs are visible it takes
~350ms (as an fyi the slideDown takes 350ms regardless of divs
visible).

About half the time is spend in css() and half in hidden(). I don't
see why it should take upto 600ms to compare two values in hidden().
If I take out slideUp and place in hide() it takes longer!
If I take out slideUp and place in
document.getElementById(endorsementFeeAdjust).style.display =
'none';
The css() time goes to 0, but hidden is still taking the same amount
of time.

If I take out the fadeOut and fadeIn, then the hidden drops to 0 as
well. Why does hidden take so long?

$(#addEndorseFeeBtn).click(function() {
if($(#endorsementFeeAdjust).is(:hidden)){
$(#endorsementFeeAdjust).slideDown(slow,function () 
{

$(#addEndorseFeeBtn).fadeOut(fast).text(Remove Endorsement
Fee Adjustment).fadeIn(fast);
});
}
else {
$(#endorsementFeeAdjust).slideUp('slow', function () {

$(#addEndorseFeeBtn).fadeOut('slow').text(Add Endorsement Fee
Adjustment).fadeIn(fast);

//$(#endorsementFeeAdjustmentDescription).val();
//$(#endorsementFeeAdjustmentAmount).val();
document.getElementById
(endorsementFeeAdjustmentDescription).value = '';

document.getElementById(endorsementFeeAdjustmentAmount).value
= '';
});
}
});

Thank you,
Eric


[jQuery] Re: Superfish 1.4.8 accessibility enhancement

2010-01-12 Thread Jason Denizac
You can of course use my (minor) modification under an MIT license.

Since Superfish 1.4.8 is offered under both MIT and GPL, you are free
to create your own fork. This plugin still gets tons of use, I think
it would be good for the community to have a more current release. You
should start a google code project for it.

-Jason

On Jan 10, 2:12 pm, decola decola...@googlemail.com wrote:
 Im really wondering where the developer of this project ... anyway i
 made some enhancements to superfish by myself. Am i allowed to copy
 and paste your code into my work.

 Because if the developer of superfish does not answer i will maybe
 make an own project like superfish menu enhanced or so.

 so far decola

 On 7 Jan., 20:55, Jason Denizac j.deni...@gmail.com wrote:



  Superfish is a jQuery plugin for progressive enhancement of suckerfish-
  style HTML/CSS drop-down menus. It can be found 
  athttp://users.tpg.com.au/j_birch/plugins/superfish/

  The original Superfish plugin used jQuery's hide() method, which sets
  an inline css attribute of display: none on the hidden menus. This has
  the unintended effect of making screen readers skip over the submenus.
  Since screen readers cannot easily trigger the hover event, this
  effectively blocks them from accessing any of the sub menu items.

  This modification changes the css technique used to hide the menus
  visually while leaving them available for screen readers.

  You can grab the updated code herehttp://jsbin.com/useku

  (Apologies if this is the wrong place for this posting - the author of
  the original Superfish plugin mentioned this list as the place for
  support for the plugin. Thanks!)

  Jason Denizac


[jQuery] tabs in one line, on small resolution

2010-01-12 Thread NMarcu
Hello all. I'm using jquery tabs, and I have 6 tabs. On a big
resolution, everithing is OK, but on 800x600, the last tab, go to
second line. How can I set tabs, to remain in one line, not depending
by resolution, or of the number of tabs?


[jQuery] Re: slideUp very slow depending on number of fields above

2010-01-12 Thread Eric Cope
Update: My Firefox memory must have been overloaded - I restarted Firefox
and the times are down to 100ms, as expected. Could jquery be adding things
to the DOM slowing down parsing?
Eric

On Wed, Jan 13, 2010 at 12:29 AM, Eric Cope eric.c...@gmail.com wrote:

 Hello all,
 I am using the slideUp animation to hide a div.  Above the div, are 25
 other divs that may or may not be visible. The speed of the slideUp
 animation depends on how many of those divs are visible. if 25 divs
 are visible, the animation takes 1200ms. If 20 divs are visible, the
 animation takes 700ms. If 15 divs are visible, it takes 600ms. If 10
 divs are visible, it takes 470-500 ms. if 5 divs are visible it takes
 ~350ms (as an fyi the slideDown takes 350ms regardless of divs
 visible).

 About half the time is spend in css() and half in hidden(). I don't
 see why it should take upto 600ms to compare two values in hidden().
 If I take out slideUp and place in hide() it takes longer!
 If I take out slideUp and place in
document.getElementById(endorsementFeeAdjust).style.display =
 'none';
 The css() time goes to 0, but hidden is still taking the same amount
 of time.

 If I take out the fadeOut and fadeIn, then the hidden drops to 0 as
 well. Why does hidden take so long?

 $(#addEndorseFeeBtn).click(function() {
if($(#endorsementFeeAdjust).is(:hidden)){
$(#endorsementFeeAdjust).slideDown(slow,function
 () {

  $(#addEndorseFeeBtn).fadeOut(fast).text(Remove Endorsement
 Fee Adjustment).fadeIn(fast);
});
}
else {
$(#endorsementFeeAdjust).slideUp('slow', function
 () {

  $(#addEndorseFeeBtn).fadeOut('slow').text(Add Endorsement Fee
 Adjustment).fadeIn(fast);

  //$(#endorsementFeeAdjustmentDescription).val();

  //$(#endorsementFeeAdjustmentAmount).val();
document.getElementById
 (endorsementFeeAdjustmentDescription).value = '';

  document.getElementById(endorsementFeeAdjustmentAmount).value
 = '';
});
}
});

 Thank you,
 Eric




-- 
Eric Cope
http://cope-et-al.com