[jQuery] Re: Problems selecting elements...

2008-12-13 Thread Richard D. Worth
Have you tried breaking apart your chain? At least to debug. Might help to
do a console.log step (in Firebug) at each function call to ensure your
selectors are returning what you expect, your slice etc. This would allow
you to see if for example addClass is being called on 1 element, or many
elements. Also, you should escape '' as 'gt;'

- Richard

On Fri, Dec 12, 2008 at 10:13 PM, SLR sean.rab...@gmail.com wrote:


 Alright, I'm really confused now. On my index page, the body tag has
 an ID with a value of Link0. On this page it works fine; only the
 first link in the navigation section is changed.

 Now on all the other pages where the body tag ID is another number
 (i.e. Link1, Link2, etc), everything just falls apart. What happens is
 that it selects that particular link but it applies the style changes
 to that link and all the following links. For example, if I had a body
 ID with a value of Link4, links 4, 5, 6, and so on are all changed.

 I'm losing my mind on this one. Why does it work on one page and not
 the others? Same markup and script on all pages, only the body id is
 changing...


[jQuery] Re: Problems selecting elements...

2008-12-13 Thread SLR

I ended up fixing the issue myself. For those that want to know, it
was type-casting issue. I change the following line:


var pageIndex = $(body).attr(id);// Pulls ID value from body tag
pageIndex = pageIndex.substring(4);

to

var pageIndex = $(body).attr(id);// Pulls ID value from body
tag
 pageIndex = parseInt(pageIndex.substring(4)); // Extracts Index from
value

Hopefully, this saves someone else a huge headache...


[jQuery] Odd issues passing JSON to server

2008-12-13 Thread Shawn Grover


I'm not sure if I have a server side issue or a client side issue.  The 
problem is that I am generating a JSON string in my plugin, and passing 
it to a php page (though the back end shouldn't matter in the long run). 
 I can see that a parameter is infact passed, but trying to decode that 
string is giving me nothing - not even errors.  Sooo, I'm stuck not 
knowing if the json string is invalid, or I'm doing something wrong on PHP.


I have a pastie with the code in question at http://pastie.org/338246.

Any tips are appreciated.  Thanks.

Shawn


[jQuery] Re: JQuery is really a nice tool

2008-12-13 Thread Sid

hi

Please help me out as i am a new fresher learning HTML
how to remove all the html and css bugs from this site http://googlelance

Thanks

On Dec 12, 11:30 pm, Sid harshal...@gmail.com wrote:
 Just look at this URLhttp://googlelance.com

 You see the login and button click on it then you find that

 a pop up appears in middle of your page for login

 that is done with Jquery


[jQuery] Re: JQuery is really a nice tool

2008-12-13 Thread Sid

hi

Please help me out as i am a new fresher learning HTML
how to remove all the html and css bugs from this site http://googlelance

Thanks

On Dec 13, 1:31 am, Andy Matthews li...@commadelimited.com wrote:
 No jQuery on that page. It's just using a collection of dHTML scripts found
 online.

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

 Behalf Of Sid
 Sent: Friday, December 12, 2008 12:31 PM
 To: jQuery (English)
 Subject: [jQuery] JQuery is really a nice tool

 Just look at this URLhttp://googlelance.com

 You see the login and button click on it then you find that

 a pop up appears in middle of your page for login

 that is done with Jquery




[jQuery] Re: how to write selector of Id contains some text

2008-12-13 Thread Paul Mills

Hi,

Try  $('#PB'+n) where n is a variable set to 1,2,3,etc.

Paul

On Dec 12, 11:55 pm, Ashish neerash...@gmail.com wrote:
 How can i write selector to retrieve elements (span)  that contains
 'PB' as part of id.
 My ids are dynamically generated as PB1 PB2 etc.


[jQuery] Please help me improve my glassbox plugin

2008-12-13 Thread ShiwawaRaider

Hi all,

By inspiration of glassbox effect here
http://www.glassbox-js.com/

and css button here
http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html

I have try to enhance its feature to suite my need in jQuery way.
then by now I have done far but need more improvement.

Please a look at simple example here
http://www.2shared.com/file/4448827/d6437194/web.html
if it cool enough to be qualified as a plugin, I will contributed the
finished source.

I'm newbie to jquery, please help me solve problems list here so I can
move further..

problem and further improvement

- problem with title leyout (title text  icon floating outside title
bar, but it look not too bad indeed look like an special effect by
accident, so I will keep it as one option hehe).
- first time page loaded look like left  right border is missing, I
have to refresh page to make them appear.
- build-in tab support (by now I think I will do it in windows media
player 11's style).
- top animation panel for ajax waiting (as windows vista's file copy
dialog).
- top alert information panel (like IE popup blocking alert)


I think I can handle above things, just need time..


- not work with firefox3 and chrome (not test with firefox2 yet I
don't know whether it works).
- I want to activate windows by clicking on it content too, now it can
active by clicking on glass border only.
- I need to know the best way to add callback to my top right icons to
submit form, link to other page, or other javascript stuffs.
- I can not bind mouseover event to set 'pointer' cursor and apply
hover effect on top right button images.


these are problems that I can't solve myself so I ask for help here..

any suggestions are strongly welcome..


[jQuery] Treeview : how to add selected class to clicked item.

2008-12-13 Thread Pankaj

I would like to highlight current selected node to the user, making
current selection more visually clear using CSS

If we use persist:Location,  node is hightlighted [adds the
selected class], but only when u refresh the page.

Can some one guide me how to implement it on per click basis ?

Regards,
Pankaj


[jQuery] Thumbnail-Gallery - previous/next link

2008-12-13 Thread sharkbait


Hi there!

i try to create a previous/next-link in my thumbnail gallery.

the gallery is created by an cms, and provides a certain amount of
thumbnails which link to a big image, which will then be shown when the
thumb is clicked.
i got it working so far that the big image fades in, a fade effect for
hovering the thumbs and displaying a loading gif...but i'm stuck with
creating a prev/next-link. i was searching and trying to find a solution
without success (i'm a noob, btw), so i thought maybe this has been done
over and over before, and somebody here can help me out, maybe sharing some
code or pointing me in the right direction. i got a hint btw. what needs to
be done, but since i'm new to this, it didn't help me.
he told me:
Quote:
You need to write a js code that collects all thumbnails to an array and
then do js functions for prev and next links. In that function you check
what is currently displayed in the picture container, find the same from the
array that holds all thumbnails and then call the image change function with
the information of the next/prev image.

the js is:
Code:
//![CDATA[
$(document).ready(function(){
   $(.hoverthumb).hover(function(){
   $(this).fadeTo(fast, 0.6); // This sets the opacity to 60% on hover
   },function(){
   $(this).fadeTo(fast, 1.0); // This sets the opacity back to 100% on
mouseout
});
});
function showPic(url,title,descr,width,height) {
  $(#maxImage).fadeOut(slow, function(){
  var image = new Image();
  $(image).load(function() {
$(this).hide();
  // with the holding div #loader, apply:
  $('#picturecontainer')
// remove the loading class (so no background spinner),
.removeClass('loading')
// then insert our image
.append(this);
$(#maxImage).attr({
  src: url,
  width: width,
  height: height
});
$(#maxImage).fadeIn(fast);
$(#maxTitle).html(title);
$(#maxDescr).html(descr);
  $('#picturecontainer').addClass('loading')
  });
  $(image).attr({src: url, width: width, height: height});
  });
}
//]]
/script


  #maxImage is the id of the big image

  #picturecontainer  .loading are the id  class of the div wrapping
the big image

  .hoverthumb is the class of every div holding a thumbnail

  and javascript:showPic is inserted to the thumbnail link like this:
  Code:
  href=javascript:showPic ('/linktopicture/picture.JPG','','',225,300)



thank you  best regards, j
-- 
View this message in context: 
http://www.nabble.com/Thumbnail-Gallery---previous-next-link-tp20989009s27240p20989009.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Please help me improve my glassbox plugin

2008-12-13 Thread Mike Alsup

 Please a look at simple example 
 herehttp://www.2shared.com/file/4448827/d6437194/web.html
 if it cool enough to be qualified as a plugin, I will contributed the
 finished source.

You'll have better luck with feedback if you post a link to a demo
page.


[jQuery] Re: how to write selector of Id contains some text

2008-12-13 Thread Mike Alsup

 How can i write selector to retrieve elements (span)  that contains
 'PB' as part of id.
 My ids are dynamically generated as PB1 PB2 etc.

spans that have an ID that starts with PB:

$(span[id^='PB'])

http://docs.jquery.com/Selectors/attributeStartsWith#attributevalue


[jQuery] Re: How to avoid the required on a credit card field using validate extension? [validate]

2008-12-13 Thread Dirceu Barquette
Hi,
Idea: assign itemField class to credit card block onchanging  select
input, or something like this.

Dirceu Barquette

2008/12/12 ekilater ivan.tho...@gmail.com


 Hi all,

 I've a form that validates using jQuery.

 In that form we use a small credit card validation with an extension
 that you can find here:
 http://www.ihwy.com/Labs/jquery-validate-credit-card-extension.aspx
 // Is only a small tweek of creditcard method.

 We want only some fields required, and that's no problem, adding the
 rules properly in the JS or with the class.. but, we DON'T want the
 field creditcard required.. and it's not possible to avoid this. We
 haven't put the required rule, but we think that's an innherit
 property of the class?

 That's the form:

 http://hotelantibes.net/en/reservas/

 If you hit the send button, required fields will be marked.. and de
 creditcard wouldnt be marked as well we don't want it required.

 Some idea to avoid this?

 Thanks in advance,

 Iván



[jQuery] Re: Multiple plugins in same namespace?

2008-12-13 Thread Mike Alsup

 I'm trying to create a plugin with two entry points. You would use it
 like this:

 $('#someid').myPlugin.doThis(options);
 $('#anotherid').myPlugin.doThat(options);

How about one of these approaches instead:

$('#someid').myPluginDoThis(options);
$('#anotherid').myPluginDoThat(options);

or

$('#someid').myPlugin('doThis', options);
$('#anotherid').myPlugin('doThat',options);

or

$('#someid').myPlugin({
action: 'doThis'
/* other options */
});
$('#anotherid').myPlugin({
action: 'doThat'
/* other options */
});


[jQuery] Re: Submit a form automatically

2008-12-13 Thread Mike Alsup

 I have a dynamically created form that I'd like to submit
 automatically after it loads.  It doesn't look like forms have an
 onload event.  I would use the window onload, but the form isn't
 necessarily around when the window loads - it is created later in a
 jquery popup.

 Any suggestions?  I am using the jquery form plugin if it matters.

After you create the form and insert it into the DOM, select it and
invoke the submit method.  For example:

$('#someDiv').append('form id=myForm.../form');
$('#myForm').submit();


[jQuery] Re: Another date picker

2008-12-13 Thread Jorge Godoy
Is there I18N support?

I missed a today button...

--
Jorge Godoy jgo...@gmail.com


On Thu, Dec 11, 2008 at 12:40 AM, Alex Kroman alexkro...@gmail.com wrote:


 Hi --

 We just released another date picker using jQuery that we've been
 using internally at OpenSourcery for a while now and are really
 liking.

 The main benefits of our date picker are that:

 - Dates can be entered through the keyboard or a calendar widget
 - Validation for keyboard entered dates is presented unobtrusively and
 inline.

 You can view the demo and get the code here:
 https://www.opensourcery.com/blog/alex-kroman/better-date-picker

 Thanks,
 Alex



[jQuery] Re: jQuery Cycle Plugin: 1 pager to control 2 slideshows

2008-12-13 Thread Mike Alsup

 I have been searching for a way to have 1 pager to control 2
 slideshows with the same number of slides. Where one slideshow can
 have a scrollLeft and another just with a fade. Is this possible with
 the current plugin?

Here's a demo:

http://jquery.malsup.com/cycle/pagers.html


[jQuery] Re: jQuery Plugin -- DOMisBetter

2008-12-13 Thread KillIEbrowser

Yes, but the way is long:
IE share slips under 70%; Firefox surges past 20%

The more home users who are online, using Firefox and Safari at home
rather
than IE, the more those browsers' shares go up, he said. With
November
including the Thanksgiving holiday in the U.S. and more weekend days
this
year -- 10 such days, versus an average of 8.7 per month -- users were
at
home more than usual.

http://www.computerworld.com/action/article.do?command=viewArticleBasicarticleId=9121919


On Dec 11, 7:21 am, sad1sm0 john.fan...@gmail.com wrote:
 I'm really not sure I see the benefit.  To build an entire site on the
 client side seems useless to me given that most spiders don't evaluate
 javascript as far as I'm aware.  That means bad news to me.  And as
 far as the IEKiller idea, I have to say that's up there with Chatroom
 Scrollers back in the days of AOL.  The best way to kill IE is to link
 to FF on your site if you have one, and anywhere else you can imagine.
 FF is up to 44% market share and IE has 47% (according 
 tohttp://www.w3schools.com/browsers/browsers_stats.asp) as of November.


[jQuery] Re: BlockUI unchecks checkboxes

2008-12-13 Thread MorningZ

Why can't I duplicate this behavior? 

Because you're not using the checkbox itself to fire off the
block   his code and my quick example do




On Dec 12, 5:17 pm, Mike Alsup mal...@gmail.com wrote:
   Could you possibly post a demo page somewhere?

  Mike, this code:http://paste.pocoo.org/show/95075/

  shows what he means, i even tried to change .click to .change and
  it still never checks the box

 Why can't I duplicate this behavior?

 http://www.malsup.com/jquery/block/dec12.html


[jQuery] Re: Please help me improve my glassbox plugin

2008-12-13 Thread ShiwawaRaider

ok
I have load my example to geocities, please take a look there
also I found problem with the top-padding of top right icons that I
don't found on my machine.. -_-'

http://www.geocities.com/blackzabaha/

sorry for very big blackground image, it may take so long time to
load, but I like it :)

On Dec 13, 8:02 pm, Mike Alsup mal...@gmail.com wrote:
  Please a look at simple example 
  herehttp://www.2shared.com/file/4448827/d6437194/web.html
  if it cool enough to be qualified as a plugin, I will contributed the
  finished source.

 You'll have better luck with feedback if you post a link to a demo
 page.


[jQuery] jqModal Onload

2008-12-13 Thread webnot


Hi everyone
I want to load this window on page load can you plz let me know how to do
this.



$().ready(function() {

 $('#tallContent2').jqm();


setTimeout($('#tallContent2').jqm(),2000);

});
-- 
View this message in context: 
http://www.nabble.com/jqModal-Onload-tp20990657s27240p20990657.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jqModal Onload

2008-12-13 Thread MorningZ

It's easy when you read the documentation
http://dev.iceburg.net/jquery/jqModal/README


You can manually show or hide a dialog with $.jqmShow() and $.jqmHide
(). e.g.

$(e).jqm().jqmShow(); $('#window2').jqmHide();

  will show the dialog attached to (e), and hide the dialog
attached to the
  element with an ID of window2, without any trigger being
clicked




so

setTimeout($('#tallContent2').jqm(),2000);

would be

setTimeout($('#tallContent2').jqmShow(),2000);




On Dec 13, 9:23 am, webnot merajw...@gmail.com wrote:
 Hi everyone
 I want to load this window on page load can you plz let me know how to do
 this.

 $().ready(function() {

  $('#tallContent2').jqm();

 setTimeout($('#tallContent2').jqm(),2000);

 });

 --
 View this message in 
 context:http://www.nabble.com/jqModal-Onload-tp20990657s27240p20990657.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: serialScroll Plugin - Problems with lazy loading of items (dynamically updating item list)

2008-12-13 Thread Ariel Flesler

The demo is not too functional. Elements don't scroll (at least in
FF).
Elements here do rearrange when adding/removing. The option lazy
should do.

Could you fix w/e needs to be fixed so that the problem does arise ?
Note that you don't need line #34 of the pastie.
That could actually mess it all up once it works.

Cheers

--
Ariel Flesler
http://flesler.blogspot.com/

On Dec 12, 3:19 am, vanstee patrickvans...@gmail.com wrote:
 Please take a look at my code.http://pastie.org/337379or if you want
 to look at a functioning copy go 
 tohttp://vansteedesign.com/flashcards/test.php.
 Even when setting the 'lazy' attribute to true in the parameters, when
 you delete one of the cards (items) from the list it still exists as
 empty space in the list. To view what I am explaining go to the
 webpage and click the x on one of the cards. Then cycle through the
 list. When scrolling to the item after the one we deleted there will
 be an intermediate scroll to a blank area between the two cards. This
 is the first time I've used this plugin so it may be a simple problem
 with how I've set it up. Any guidance would be greatly apprecated.
 Thanks in advance.


[jQuery] Re: validation plugin question

2008-12-13 Thread Sean Allen


I already have that in place.

How do I get the autogenerated label to not do style=display:inline ?
In that demo there is no such element styling on the label created for  
errors.



On Dec 12, 2008, at 4:37 PM, Jörn Zaefferer wrote:

In that demo this line hides the default messages for the required  
method:


$.validator.messages.required = ;

Jörn

On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen s...@monkeysnatchbanana.com 
 wrote:


playing around with it.

don't want to get error messages displayed.

i'm just putting in a general error message at top and highlighting
required fields.
but the label for errors gets created with a display: inline set on
the element which is
thwarting me from not showing it.

looking at the marketo example ( for 2 hours now ), i see no such
display: inline being set
but can't figure out why that is.

can anyone explain?






[jQuery] Re: jquery ajax-built page with embedded ajax code issue

2008-12-13 Thread brian

On Fri, Dec 12, 2008 at 4:30 PM, ray rayjohnterr...@gmail.com wrote:

 I've implemented the changes you've suggested, but I'm seeing the same
 issue (clicks are not being intercepted by JQuery).  :-/  I do
 understand what you suggested, but I'm now very confused as to why it
 isn't working.

Post some code?

 Is there a way to see, at the current time, what links have the click
 handler attached correctly?

Maybe somewhere in Firebug's DOM info. I've never looked for that, specifically.


[jQuery] Re: Separate Functions for Events

2008-12-13 Thread DAZ

Just to say a belated thanks to both of you for this help - it is very
useful and helped me lots in learning how to use jQuery. I still have
lots left to learn, but I'm finding it a great library.

cheers,

DAZ

On Dec 8, 8:35 pm, Richard D. Worth rdwo...@gmail.com wrote:
 But also this is a jQuery UI callback, which means jQuery UI is already
 passing two parameters to this function, event, and ui. See

 http://docs.jquery.com/UI/Droppable/droppable#options

 All jQuery UI callbacks receive two arguments: The original browser event
 and a prepared ui object, view below for a documentation of this object (if
 you name your second argument 'ui'):
  * ui.options - options used to initialize the droppable
  * ui.position - current position of the draggable helper
  * ui.absolutePosition - current absolute position of the draggable helper
  * ui.draggable - current draggable element
  * ui.helper - current draggable helper

 So if you're interested in those, you can do

 drop: function(event, ui) {
   dropped(foo, bar, event, ui)
 //or
   dropped(event, ui, foo, bar)

 })

 or something like that.

 If the arguments that the plugin provides are sufficient (you don't need to
 pass any of your own arguments), your setup might look something like this

 function dropped(event, ui) {
  ...

 }

 $(#myDiv).droppable({
   ...,
   drop: dropped

 }

 So you still just provide a reference to the function, regardless of how
 many parameters it will be passed/what they are named.

 - Richard

 On Mon, Dec 8, 2008 at 3:15 PM, Michael Geary m...@mg.to wrote:

   From: DAZ

   Just one more question - what if I need to provide arguments
   to the function? Don't these need to go in parens which will
   then cause the function to be called immediately?

  Then you wrap the function call in another function (typically an anonymous
  function, but could be a reference to a named function):

     drop: function() { dropped(foo,bar); }

  -Mike


[jQuery] Re: jQuery Plugin -- DOMisBetter

2008-12-13 Thread Klaus Hartl

span/ is valid XHTML.

--Klaus


On 11 Dez., 03:59, RobG rg...@iinet.net.au wrote:
 On Dec 11, 7:45 am, KillIEbrowser davide.rogn...@gmail.com wrote:

  DOMisBetter is different from jQuery( html, [ownerDocument] )

 http://docs.jquery.com/Core/jQuery#htmlownerDocument

 That part of the documentation needs to be updated. Where it says:

   When creating single elements use the closing tag or XHTML
    format. For example, to create a span use $(span/)...

 the following changes should be made:

 1. The use of the definite article the should be replaced with a.

 2. The use of span/ in the example *is not* valid XHTML.

 The section should say something like:

   When creating empty elements, use a closing tag or XML
    format. For example, to create a span use $(span/)...

 --
 Rob


[jQuery] Re: creating unique IDs

2008-12-13 Thread brian

I just came across a *much* better way to do this in Andris Valums'
ajax_upload plugin:

var get_uid = function(){
var uid = 0;
return function(){
return uid++;
}
}();

That's what's called a closure, btw.

http://valums.com/


[jQuery] Add a class to an accordion

2008-12-13 Thread paul

Hello,

I want to custom this jQuery script :

$(document).ready(function(){

$(.accordion h3).eq(0).addClass(active);
$(.accordion p).eq(0).show();

$(.accordion h3).click(function(){
$(this).next(p).slideToggle(fast)
.siblings(p:visible).slideUp(fast);
$(this).toggleClass(active);
$(this).siblings(h3).removeClass(active);
});

});

However, I want to add a container after .accordion and before h3,
like foo :

div class=accordion
div class=foo
h3.../h3
p.../p
/div
div class=foo
h3.../h3
p.../p
/div
/div

If I write...

$(document).ready(function(){

$(.accordion .foo h3).eq(0).addClass(active);
$(.accordion .foo p).eq(0).show();

$(.accordion2 .foo h3).click(function(){
$(this).next(p).slideToggle(fast)
.siblings(p:visible).slideUp(fast);
$(this).toggleClass(active);
$(this).siblings(h3).removeClass(active);
});

});

The accordion opens, but do not close!

Is the syntax (.accordion .foo h3) incorrect?

Thanks for your help!

Sincerely,

Paul


[jQuery] Re: validation plugin question

2008-12-13 Thread Jörn Zaefferer
No idea, I'd need to see some code, a testpage is prefered.

Jörn

On Sat, Dec 13, 2008 at 4:03 PM, Sean Allen s...@monkeysnatchbanana.com wrote:

 I already have that in place.

 How do I get the autogenerated label to not do style=display:inline ?
 In that demo there is no such element styling on the label created for
 errors.


 On Dec 12, 2008, at 4:37 PM, Jörn Zaefferer wrote:

 In that demo this line hides the default messages for the required method:

 $.validator.messages.required = ;

 Jörn

 On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen s...@monkeysnatchbanana.com
 wrote:

 playing around with it.

 don't want to get error messages displayed.

 i'm just putting in a general error message at top and highlighting
 required fields.
 but the label for errors gets created with a display: inline set on
 the element which is
 thwarting me from not showing it.

 looking at the marketo example ( for 2 hours now ), i see no such
 display: inline being set
 but can't figure out why that is.

 can anyone explain?






[jQuery] Does jQuery do the encode thing

2008-12-13 Thread David .Wu

My default character set is utf8, should I use encodeURI when use ajax
sending the data to server?

for example
$username = $('#username').val()
$.ajax(
{
url:'xxx.php',
data:{username:encodeURI($username)}
..
...
...
});


[jQuery] Re: BlockUI unchecks checkboxes

2008-12-13 Thread Mike Alsup

 Why can't I duplicate this behavior? 

 Because you're not using the checkbox itself to fire off the
 block   his code and my quick example do

Ah, thanks for clarifying, Steve.  I'll get that fixed.

Mike


[jQuery] Re: Problems with more than one AJAX request at a time

2008-12-13 Thread George

It has nothing to so with AJAX.
You did not say what you using on your server side so i can not tell.

But a lot of frameworks like ASP or ASP.NET will serialize requests
made from the same Sesssion (browser). To avoid programmers having to
manage concurent access to resources in Session object.


George.

On Dec 12, 1:48 pm, hotdog...@gmail.com hotdog...@gmail.com wrote:
 Hello there!

 I'm sending an AJAX request using jQuery that could take a minute to
 complete. However, I also want to send other smaller ajax requests to
 the same host at the same time just after the first one starts. The
 problem is, the smaller requests block until the first one finishes.
 Is there a way to get around that? Shouldn't AJAX be asynchronous?


[jQuery] Re: Problems with more than one AJAX request at a time

2008-12-13 Thread hotdog...@gmail.com

On Dec 13, 11:05 am, George gev...@comcast.net wrote:
 It has nothing to so with AJAX.
 You did not say what you using on your server side so i can not tell.

 But a lot of frameworks like ASP or ASP.NET will serialize requests
 made from the same Sesssion (browser). To avoid programmers having to
 manage concurent access to resources in Session object.
DUDE !! You are AWESOME! Thank you, that was EXACTLY the problem. I'm
using CherryPy on the server with sessions turned on. Turning them off
fixed the problem instantly.

However, I've run into some problems with this setup... Seems like
doing this with CherryPy would either involve a lot of hackery. What
server framework would you suggest?


[jQuery] Re: mod'ing pseudo-classes...possible?

2008-12-13 Thread Dave Methvin

 $(.detailsPaneToggle).children(a).css('background-position','0px -35px');
 $(.detailsPaneToggle).children(a:hover).css('background-position','0px
 -80px');

I think you can do this without script, except for IE6.

style type=text/css
.detailsPaneToggle  a {
  background-position: 0px -35px;
}
.detailsPaneToggle  a:hover,  .detailsPaneToggle  a.hover {
  background-position: 0px -80px
}
/style

If you add this script for IE6 it should work there too.

$(.detailsPaneToggle  a).hover(
  function(){ $(this).addClass(hover) },
  function(){ $(this).removeClass(hover) }
});


[jQuery] Re: Multiple plugins in same namespace?

2008-12-13 Thread Marion

Hi Mike,

Thanks! all good suggestions. I went with
 $('#someid').myPlugin({
 doThis: ...,
 doThat: ... });
One entry point, and lets me doThis and doThat both, which turned out
to be useful.

I'm still curious whether my original syntax could be made to work. I
suspect the answer is not easily.

Marion

On Dec 13, 5:14 am, Mike Alsup mal...@gmail.com wrote:
  I'm trying to create a plugin with two entry points. You would use it
  like this:

  $('#someid').myPlugin.doThis(options);
  $('#anotherid').myPlugin.doThat(options);

 How about one of these approaches instead:

 $('#someid').myPluginDoThis(options);
 $('#anotherid').myPluginDoThat(options);

 or

 $('#someid').myPlugin('doThis', options);
 $('#anotherid').myPlugin('doThat',options);

 or

 $('#someid').myPlugin({
 action: 'doThis'
 /* other options */});

 $('#anotherid').myPlugin({
 action: 'doThat'
 /* other options */

 });


[jQuery] Re: jquery ajax-built page with embedded ajax code issue

2008-12-13 Thread ray

It appears that the .children portion of the code either isn't getting
the .ajax_link classes, or the click handler isn't getting correctly
applied.  Is there a way to determine what the actual results returned
are by the following:

   $(this).children('.ajax_link')

i tried something like:

   var kids = $(this).children('.ajax_link');
   alert(kids);

but that printed out that the 'kids' output was an object.

i replaced the children section with the following (it looks to be
working correctly now) to grab all of the ajax_link classes, but i'd
still like to know what i was doing wrong w/ the above as well, as i
feel like the above is a little clearer:

   $(.ajax_link).click(my_click);

thanks for your help and patience btw.  i love open source software
(and the help you can get implementing things), and jquery ROCKS!
-ray

On Dec 13, 9:34 am, brian bally.z...@gmail.com wrote:
 On Fri, Dec 12, 2008 at 4:30 PM, ray rayjohnterr...@gmail.com wrote:

  I've implemented the changes you've suggested, but I'm seeing the same
  issue (clicks are not being intercepted by JQuery).  :-/  I do
  understand what you suggested, but I'm now very confused as to why it
  isn't working.

 Post some code?

  Is there a way to see, at the current time, what links have the click
  handler attached correctly?

 Maybe somewhere in Firebug's DOM info. I've never looked for that, 
 specifically.


[jQuery] Re: Add a class to an accordion

2008-12-13 Thread paul

I made a mistake on :

$(document).ready(function(){


$(.accordion .foo h3).eq(0).addClass(active);
$(.accordion .foo p).eq(0).show();


$(.accordion2 .foo h3).click(function(){
$(this).next(p).slideToggle(fast)
.siblings(p:visible).slideUp(fast);
$(this).toggleClass(active);
$(this).siblings(h3).removeClass(active);
});



});

Read:

$(document).ready(function(){


$(.accordion .foo h3).eq(0).addClass(active);
$(.accordion .foo p).eq(0).show();


$(.accordion .foo h3).click(function(){
$(this).next(p).slideToggle(fast)
.siblings(p:visible).slideUp(fast);
$(this).toggleClass(active);
$(this).siblings(h3).removeClass(active);
});



});

Thanks again.

Paul


[jQuery] Re: passing args to a delegate

2008-12-13 Thread Jan Limpens

while this might keep the browser from crashing, I wonder what values
these parameters will have, when the event finally occurs. The ones I
have passed the very first time? I thought they would have been
destroyed by then, as we left this scope long ago ...
But I'll try it out :), thanks!

On Sat, Dec 13, 2008 at 3:22 AM, Mike Nichols nichols.mik...@gmail.com wrote:

 Try this:
 success: function() { registerImageForms(id,key,type); }


 On Dec 12, 5:13 pm, Jan Limpens jan.limp...@gmail.com wrote:
 Hello,

 I have the following code:

 var registerImageForms = function(id, key, type) {
 var sizes = ['small', 'medium', 'large'];
 $('#panel-images fieldset:visible').remove();
 $.each(sizes, function(i, item) {
 var $clonedForm = $('#panel-images fieldset:hidden').clone();
 $(legend, $clonedForm).text(item);
 $([name='id'], $clonedForm).val(id);
 $([name='key'], $clonedForm).val(key);
 $([name='type'], $clonedForm).val(type);
 $([name='size'], $clonedForm).val(item);
 $(img, $clonedForm).attr('src', /imagem/article/ + key +
 / + item + .png);
 $(#panel-images).append($clonedForm);
 $(form, $clonedForm).ajaxForm({
 success: registerImageForms
 });
 $clonedForm.show();
 });

 };

 Success has no args, so everything is rendered empty, after posting
 the form. If I pass arguments as
 success: registerImageForms(id, key, type)

 The browser crashes and it makes sense, because at the time this
 fires, these identifiers mean nothing. But how do I pass them?

 --
 Jan



-- 
Jan


[jQuery] Re: passing args to a delegate

2008-12-13 Thread Jeffrey Kretz

Mike's suggestion involves creating a javascript closure.

There are a number of good articles on closues.

http://www.google.com/search?hl=enq=javascript+closuresrlz=1W1GGLL_en

But essentially, when you create a function that has a reference to a value 
outside of its scope, that function is created as a closure, with its own 
context that has access to those variables, even when they've been changed on 
the global scope.

Try this:

var x = 25;
var fn = function(val){
   return function(){
  alert(val);
   };
}(x);
x = 30;
fn();

The alert will be for 25, rather than 30, as the closure has its own context 
now for the x variable.

The downside to closures is that handled incorrectly, they can cause memory 
leaks.

But review of the many articles on the subject will help keep that from 
happening.

JK


-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of Jan Limpens
Sent: Saturday, December 13, 2008 2:28 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: passing args to a delegate


while this might keep the browser from crashing, I wonder what values
these parameters will have, when the event finally occurs. The ones I
have passed the very first time? I thought they would have been
destroyed by then, as we left this scope long ago ...
But I'll try it out :), thanks!

On Sat, Dec 13, 2008 at 3:22 AM, Mike Nichols nichols.mik...@gmail.com wrote:

 Try this:
 success: function() { registerImageForms(id,key,type); }


 On Dec 12, 5:13 pm, Jan Limpens jan.limp...@gmail.com wrote:
 Hello,

 I have the following code:

 var registerImageForms = function(id, key, type) {
 var sizes = ['small', 'medium', 'large'];
 $('#panel-images fieldset:visible').remove();
 $.each(sizes, function(i, item) {
 var $clonedForm = $('#panel-images fieldset:hidden').clone();
 $(legend, $clonedForm).text(item);
 $([name='id'], $clonedForm).val(id);
 $([name='key'], $clonedForm).val(key);
 $([name='type'], $clonedForm).val(type);
 $([name='size'], $clonedForm).val(item);
 $(img, $clonedForm).attr('src', /imagem/article/ + key +
 / + item + .png);
 $(#panel-images).append($clonedForm);
 $(form, $clonedForm).ajaxForm({
 success: registerImageForms
 });
 $clonedForm.show();
 });

 };

 Success has no args, so everything is rendered empty, after posting
 the form. If I pass arguments as
 success: registerImageForms(id, key, type)

 The browser crashes and it makes sense, because at the time this
 fires, these identifiers mean nothing. But how do I pass them?

 --
 Jan



-- 
Jan



[jQuery] Re: validation plugin question

2008-12-13 Thread Sean Allen


I copied it straight from the demo with just  a couple minor changes...

going to remove the code that I don't need once I work this out...

$(document).ready(function(){
$.validator.messages.required = ;
$(#lf).bind(invalid-form.validate, function(e, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
var message = Please complete the form:;
$(#formheader).html(message);
$(#formheader).show();
}
}).validate({
//focusInvalid: false,
//focusCleanup: true,
onkeyup: false,
submitHandler: function() {
$(div.error).hide();
alert(submit! use link below to go to the  
other step);

},
messages: {
password2: {
required:  ,
equalTo: Please enter the same  
password as above

},
email: {
required:  ,
email: Please enter a valid email  
address, example: y...@yourdomain.com,
remote: jQuery.format({0} is already  
taken, please enter a different address.)

}
},
debug:true
});

  });

relevent bit of html:

form id=lf name=lf method=post action=/lp2op  
style=display:inline

div class=form_bod
div id=formheader class=formtitlePlease ship my  
strongFREE/strong 7 day Trial plus Colgate kit/div
div class=formlabellabel for=fnameFirst Name:/ 
label/div input maxlength=75 name=fname id=fname size=19  
class=text required value= /
div class=formlabellabel for=lnameLast Name:/ 
label/div input maxlength=75 name=lname id=lname size=19  
class=text required value= /
div class=formlabellabel for=address1Address:/ 
label/div input maxlength=30 name=address1 id=address1  
size=19 class=text required value= /
div class=formlabellabel for=address2Address 2:/ 
label/div input maxlength=30 name=address2 id=address2  
size=19 class=text value= /
div class=formlabellabel for=cityCity:/label/ 
div input maxlength=75 name=city id=city size=19 class=text  
required value= /
div class=formlabellabel for=stateState:/label/ 
div
select size=1 name=state id=state  
class=stateselector required

... state list snipped...
/select
div class=formlabellabel for=zipcodeZip:/label/ 
div input maxlength=5 name=zipcode id=zipcode size=15  
value= class=text required /
div class=formlabellabel for=phonePhone:/label/ 
div input maxlength=30 name=phone id=phone size=19  
class=text required value= /
div class=formlabellabel for=emailEmail:/label/ 
div input maxlength=75 name=email id=email size=19  
class=text required email value= /
input id=submit_btn1 name=submit_btn type=image  
src=[% image.src( '/lp-cxdigital/images/button1.gif' ) %]  
class=button1 alt=GET IT NOW /

/div
/form

On Dec 13, 2008, at 12:32 PM, Jörn Zaefferer wrote:


No idea, I'd need to see some code, a testpage is prefered.

Jörn

On Sat, Dec 13, 2008 at 4:03 PM, Sean Allen s...@monkeysnatchbanana.com 
 wrote:


I already have that in place.

How do I get the autogenerated label to not do  
style=display:inline ?
In that demo there is no such element styling on the label created  
for

errors.


On Dec 12, 2008, at 4:37 PM, Jörn Zaefferer wrote:

In that demo this line hides the default messages for the required  
method:


$.validator.messages.required = ;

Jörn

On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen s...@monkeysnatchbanana.com 


wrote:


playing around with it.

don't want to get error messages displayed.

i'm just putting in a general error message at top and highlighting
required fields.
but the label for errors gets created with a display: inline set on
the element which is
thwarting me from not showing it.

looking at the marketo example ( for 2 hours now ), i see no such
display: inline being set
but can't figure out why that is.

can anyone explain?









[jQuery] Wildcard selector AND pass the selector to a sub-function?

2008-12-13 Thread Daniel L

Hi, I have a situation where the same javascript is repeated about 50
times - just with a differnt ID. Example:

$('#mydiv1').change(function() {
   doStuff('#mydiv1');
});
$('#mydiv2').change(function() {
   doStuff('#mydiv2');
});
...
$('#mydiv50').change(function() {
   doStuff('#mydiv50');
});


Is there a way to combine all these calls using wildcards?? I imagine
it would be something like:

$('#mydiv* as foo').change(function() {
   doStuff('#mydivfoo');
});

Any help would be greatly appreciated.


[jQuery] [VALIDATION] Fields not updating numberOfInvalids count

2008-12-13 Thread Jet

Hi,

It's kind of difficult for me to explain for English is not my native
language.

I'll explain it briefly and refer you to the actual page.

If the 'Rule' for a field has a Required attribute and with or
without any other attributes, then it works fine.

But when a field has any other 'Rules' attribute other than
'Required', and when the field is blank, it updated the
this.defaultShowErrors(); status but it doesn't update the
numberOfInvalids count (it will show there is (1) error).

Here is the actual page: http://www.thaidatelink.com/page/delivery/

Note1: no need to login to test the page, just click on the Radio or
Checkbox to display the form.
Fields without an asterisk sign (not required fields) are those which
has the problem. Type something into any of the following fields:
Recipient's Email:, Recipient's Telephone:  and Message:  then
clear the field, and you shall see that the this.defaultShowErrors
(); staus will be updated as it should but the numberOfInvalids
notify of an error instead though the field isn't a Required field.

Hopefully someone could help for I have been trying to solve this
problem without success for the last three days.

Thanks in advanced.

Below is the code I used on the page:

script type=text/javascript
$.validator.setDefaults({
focusInvalid: false
});

$(document).ready(function(){
$(#error_summary_float).hide();
var v = $(#delivery_quotation).validate({
rules: {
 recipient_member: { required: true },
 recipient_username: { required: true,
 nowhitespace: true,
 alphanumeric: true,
 minlength: 4,
 maxlength: 16 },
 recipient_name: { required: true,
   lettersspaces: true,
   maxlength: 64 },
 recipient_address: { required: true },
recipient_email: { email: true,
 nowhitespace: true,
 maxlength: 64 },
recipient_phone: { phonenumber: true,
   minlength: 9,
   maxlength: 32 },
select_gifts: { required: true },
gifts[]: { required: true },
greeting_card_to: { required: true,
letterswithbasicpunc: true,
maxlength: 64 },
greeting_card_msg: { lettersnumberspuncspaces: true },
greeting_card_from: { required: true,
   letterswithbasicpunc: true },
instructions_requests: { maxlength: 500 },
imgverify: { required: true,
minlength: 5,
nowhitespace: true,
lettersnumbers: true,
lowercaseletters: true }
},
messages: {
recipient_member: { required: Information required! },
recipient_username: { required: This field cannot be empty!,
nowhitespace: No spaces allowed!!,
alphanumeric: Letters, Numbers amp; Underscores 
only!,
minlength: Minimum 4 characters long!,
maxlength: Maximum 16 characters long! },
recipient_name: { required: This field cannot be empty!,
 letterswithbasicpunc: Letters amp; 
Basic Punctuation
only!,
 maxlength: Maximum 64 characters long! },
recipient_address: { required: This field cannot be empty! },
recipient_email: { email: Please enter a valid Email Address!,
 nowhitespace: No spaces allowed!,
 maxlength: Maximum 64 characters long! },
recipient_phone: { phonenumber: Numbers, Brackets amp; Hyphens
only!,
  minlength: Minimum 9 digits long!,
  maxlength: Maximum 16 digits long! },
select_gifts: { required: You have not selected any Gift! },
gifts[]: { required: Please select at least one item! },
greeting_card_to: { required: This field cannot be empty!,
letterswithbasicpunc: Letters amp; Basic 
Punctuation
only!,
maxlength: Maximum 64 characters
long! },
greeting_card_msg: {
lettersnumberspuncspaces: Letters,
Numbers amp; Punctuation only! },
greeting_card_from: { required: This field cannot be empty!,
   letterswithbasicpunc: Letters amp; Basic
Punctuation only!,
   maxlength: Maximum 64 characters long! },
instructions_requests: { maxlength: Maximum 500 characters

[jQuery] Re: Odd issues passing JSON to server

2008-12-13 Thread talent

maybe you should show us your JSON code

On Dec 13, 5:27 pm, Shawn Grover sgro...@open2space.com wrote:
 I'm not sure if I have a server side issue or a client side issue.  The
 problem is that I am generating a JSON string in my plugin, and passing
 it to a php page (though the back end shouldn't matter in the long run).
   I can see that a parameter is infact passed, but trying to decode that
 string is giving me nothing - not even errors.  Sooo, I'm stuck not
 knowing if the json string is invalid, or I'm doing something wrong on PHP.

 I have a pastie with the code in question athttp://pastie.org/338246.

 Any tips are appreciated.  Thanks.

 Shawn


[jQuery] Re: BlockUI unchecks checkboxes

2008-12-13 Thread Mike Alsup

 Ah, thanks for clarifying, Steve.  I'll get that fixed.

It's fixed now.

http://www.malsup.com/jquery/block/#download


[jQuery] Re: Wildcard selector AND pass the selector to a sub-function?

2008-12-13 Thread Dan Switzer

The easiest way to do this would be to give each div a specific class:

div id=mydiv1 class=foo /
div id=mydiv2 class=foo /
div id=mydiv3 class=foo /
div id=mydiv4 class=foo /

Now you could just do:

$(div.foo).change();

I like this method, since usually this divs have related visuals, so
you may already have a constant class defined for the elements.

An alternative would be to do something like:

$(div[id^=mydiv]).change();

This would find all divs with an ID that starts mydiv. The
performance on the class method may be more efficient though.

-Dan

On Sat, Dec 13, 2008 at 8:30 PM, Daniel L dan...@cleardocs.com wrote:

 Hi, I have a situation where the same javascript is repeated about 50
 times - just with a differnt ID. Example:

 $('#mydiv1').change(function() {
   doStuff('#mydiv1');
 });
 $('#mydiv2').change(function() {
   doStuff('#mydiv2');
 });
 ...
 $('#mydiv50').change(function() {
   doStuff('#mydiv50');
 });


 Is there a way to combine all these calls using wildcards?? I imagine
 it would be something like:

 $('#mydiv* as foo').change(function() {
   doStuff('#mydivfoo');
 });

 Any help would be greatly appreciated.



[jQuery] Re: Konqueror problems?

2008-12-13 Thread Karl Swedberg

On Dec 12, 2008, at 5:20 PM, John Moore wrote:
Thanks, I hadn't spotted that. I can live with it, as the number of  
Konqueror users is (unfortunately) very small and they're likely going  
to be used to having certain pages not work for them. I'd just prefer  
my stuff to work with all modern browsers (and Konqueror is a good  
browser). I actually ran into other problems, subsequently, with   
Safari, purportedly one of the more tested ones - using CSS opacity  
settings seems to cause it problems, on pages which work just fine on  
IE, FF and Opera.


Hi John,

If you're discovering bugs with Safari, or any other supported  
browser, please notify us. Either post a message to the jquery-dev  
Google Group or, if you're absolutely sure it's a bug, file a ticket  
at http://dev.jquery.com/newticket/ (quick registration required).


thanks,

--Karl


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



[jQuery] Re: Problems selecting elements...

2008-12-13 Thread Karl Swedberg

On Dec 13, 2008, at 3:19 AM, SLR wrote:



I ended up fixing the issue myself. For those that want to know, it
was type-casting issue. I change the following line:


  var pageIndex = $(body).attr(id);// Pulls ID value from  
body tag

  pageIndex = pageIndex.substring(4);


to

var pageIndex = $(body).attr(id);// Pulls ID value from body
tag
pageIndex = parseInt(pageIndex.substring(4)); // Extracts Index from
value

Hopefully, this saves someone else a huge headache...


I see what you're going for there, and the parseInt() function is nice  
and convenient for this sort of thing. You might want to consider a  
simpler alternative:


var pageIndex = +$(body).attr(id).slice(4); // Pulls ID from body  
tag and extracts index from value


--Karl

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



[jQuery] Re: Retrieve webmethod from webservice

2008-12-13 Thread Sara

I  already had saw some posts which are in your search url result and
my code includes ones but I found a post in that search which help me
and solved my problem

Thanks a lot

On Dec 12, 5:12 pm, MorningZ morni...@gmail.com wrote:
 I'm not sure where you got your code examples from, but there's lots
 of blog posts showing valid and working examples

 http://www.google.com/search?q=asp.net+web+service+jquery

 On Dec 12, 8:07 am, Sara sararaminp...@gmail.com wrote:



  hi every body

  I want to call a webmethod of my webservice and to do this I try the 3
  follwing methods but none of them show me the result and nothing
  happen
  It also has no error
  please help me

  Method 1:

  jQuery.getJSON(WebService.asmx/HelloWorld , function(json){
       jQuery(#result).html(json);
          });
  Method 2:

  jQuery.ajax({
      type: POST,
      url: WebService.asmx/HelloWorld,
      data: {},
      contentType: application/json; charset=utf-8,
      dataType: json,
      success: function(msg) {
        jQuery(#result).html(msg);
      }
    });

  Method 3:

  jQuery.ajaxDotNet(WebService.asmx/HelloWorld , {
                  verb: GET,
                  success: function(obj) {
                          jQuery(#result).html(obj);
                  }
          });

  Webmethod Code:

   WebMethod() _
      Public Function HelloWorld() As String
          Return Hello World
      End Function- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Wildcard selector AND pass the selector to a sub-function?

2008-12-13 Thread Daniel L

CSS 3 selectors seem to be my solution:

$('inp...@id^=foo]...@id$=bar]').change(function(){
alert(this.id);
}

This will be attached to all input fields that have an ID starting
with 'foo' and ending with 'bar' (e.g. 'foo123bar', 'foobar',
'foo456bar').

Then within the function I can pass through the actual ID with
'this.id'.

Cheers.




On Dec 14, 1:44 pm, Dan Switzer dswit...@pengoworks.com wrote:
 The easiest way to do this would be to give each div a specific class:

 div id=mydiv1 class=foo /
 div id=mydiv2 class=foo /
 div id=mydiv3 class=foo /
 div id=mydiv4 class=foo /

 Now you could just do:

 $(div.foo).change();

 I like this method, since usually this divs have related visuals, so
 you may already have a constant class defined for the elements.

 An alternative would be to do something like:

 $(div[id^=mydiv]).change();

 This would find all divs with an ID that starts mydiv. The
 performance on the class method may be more efficient though.

 -Dan

 On Sat, Dec 13, 2008 at 8:30 PM, Daniel L dan...@cleardocs.com wrote:

  Hi, I have a situation where the same javascript is repeated about 50
  times - just with a differnt ID. Example:

  $('#mydiv1').change(function() {
    doStuff('#mydiv1');
  });
  $('#mydiv2').change(function() {
    doStuff('#mydiv2');
  });
  ...
  $('#mydiv50').change(function() {
    doStuff('#mydiv50');
  });

  Is there a way to combine all these calls using wildcards?? I imagine
  it would be something like:

  $('#mydiv* as foo').change(function() {
    doStuff('#mydivfoo');
  });

  Any help would be greatly appreciated.