[jQuery] Washington DC jQuery Meetup - lunch and learn jQuery UI at the Library of Congress

2008-09-16 Thread Richard D. Worth
Washington DC Developers,

I'm speaking about jQuery and jQuery UI to some developers at the Library of
Congress this Thursday at lunch. They were nice enough to open it up for
anyone to attend. If you're interested, see the details below and shoot an
email to Ed Summers so they have an idea of numbers. Thanks.

Talk: jQuery and jQuery UI
Synopsis: Will be similar to talks I gave recently at the Rich Web
Experience. See
http://www.therichwebexperience.com/conference/washing_dc/sessions.html#speaker18860

Date  Time:
Thursday, September 18, 2008
12:30-1:30pm (we have the room until 2, if you want to chat for a bit)

Location:
LA-G06, Adams Building
Library of Congress
Washington, D.C.

Directions:
Adams Building is located at 2nd St SE
between Independence Ave  East Capitol Streets
a block from the Capitol South Metro

RSVP:
Ed Summers
 ed.summers AT gmail DOT com 

- Richard

Richard D. Worth
http://rdworth.org/


[jQuery] Re: [jquery-ui] Washington DC jQuery Meetup - lunch and learn jQuery UI at the Library of Congress

2008-09-16 Thread Paul Bakaus
Wohoo! What a shame I can't attend..

On Tue, Sep 16, 2008 at 4:31 PM, Richard D. Worth [EMAIL PROTECTED] wrote:

 Washington DC Developers,

 I'm speaking about jQuery and jQuery UI to some developers at the Library
 of Congress this Thursday at lunch. They were nice enough to open it up for
 anyone to attend. If you're interested, see the details below and shoot an
 email to Ed Summers so they have an idea of numbers. Thanks.

 Talk: jQuery and jQuery UI
 Synopsis: Will be similar to talks I gave recently at the Rich Web
 Experience. See
 http://www.therichwebexperience.com/conference/washing_dc/sessions.html#speaker18860

 Date  Time:
 Thursday, September 18, 2008
 12:30-1:30pm (we have the room until 2, if you want to chat for a bit)

 Location:
 LA-G06, Adams Building
 Library of Congress
 Washington, D.C.

 Directions:
 Adams Building is located at 2nd St SE
 between Independence Ave  East Capitol Streets
 a block from the Capitol South Metro

 RSVP:
 Ed Summers
  ed.summers AT gmail DOT com 

 - Richard

 Richard D. Worth
 http://rdworth.org/


 



-- 
Paul Bakaus
UI Architect
--
http://paulbakaus.com
http://www.linkedin.com/in/paulbakaus


[jQuery] Re: Washington DC jQuery Meetup - lunch and learn jQuery UI at the Library of Congress

2008-09-16 Thread chris thatcher
Ed Summers...  I know him!  In fact I like him too!   I worked with Ed and
the OSI team to create the World Digital Library Prototype (and used jQuery
in fact).

I have to be in New York for that date but please give OSI my kindest
regards and let them know I wish I could join you all.

PS I also used jQuery with another project at LOC which is in UX testing now
and have recently been contracted for a third.  Wish I could take all the
credit but jQuery really was the key.

Thatcher

On Tue, Sep 16, 2008 at 10:31 AM, Richard D. Worth [EMAIL PROTECTED]wrote:

 Washington DC Developers,

 I'm speaking about jQuery and jQuery UI to some developers at the Library
 of Congress this Thursday at lunch. They were nice enough to open it up for
 anyone to attend. If you're interested, see the details below and shoot an
 email to Ed Summers so they have an idea of numbers. Thanks.

 Talk: jQuery and jQuery UI
 Synopsis: Will be similar to talks I gave recently at the Rich Web
 Experience. See
 http://www.therichwebexperience.com/conference/washing_dc/sessions.html#speaker18860

 Date  Time:
 Thursday, September 18, 2008
 12:30-1:30pm (we have the room until 2, if you want to chat for a bit)

 Location:
 LA-G06, Adams Building
 Library of Congress
 Washington, D.C.

 Directions:
 Adams Building is located at 2nd St SE
 between Independence Ave  East Capitol Streets
 a block from the Capitol South Metro

 RSVP:
 Ed Summers
  ed.summers AT gmail DOT com 

 - Richard

 Richard D. Worth
 http://rdworth.org/




-- 
Christopher Thatcher


[jQuery] Re: $.getScript in Firefox 3

2008-09-16 Thread Mark T

I'm getting even more convinced that this is an issue with FF3 
jQuery.  Interestingly, it only affects local JS files, which are
inserted as text into the head of the document between script tags.

Remote files, which are loaded using script src=... and monitored
using onload / onreadystate execute fine.

Why is it that local files are not loaded using the src attribute of
the script tag too?

Mark.

On Sep 16, 11:57 am, robert_shipley [EMAIL PROTECTED]
wrote:
 Posted by Rob on Behalf of Mark...

 I've been doing a little investigation into this (I'm a colleague of
 Rob's) and we are still experiencing the issue in Firefox 3.  I'm
 afraid it's very difficult for me to produce an example of this as we
 are using quite a complex set of getScript calls in our website and
 can't make this available to the outside world.  I've managed to
 generate a replica of the page here:http://www.tcc-net.com/jquery-getscript/

 Here are my findings todate:

  - We are calling getScript to retrieve local javascript files.
  - As soon as the file is loaded, we attempt to execute a function
 within the script.

 I put a few console.log messages into the files (Firebug uses
 console.log for debugging) to output messages at certain points.  The
 key ones were a message at the end of the file being retrieved (end
 of tablesorter) with getScript and one in the callback (would
 trigger) which is triggered on (apparent) completion of the load.

 Most of the time, these appear in the console in the correct order
 (end of tablesorter = would trigger).  Occasionally, however,
 they appear the alternate way around and this is when the error
 (myMethod() is not a valid function, or words to those effect) is
 seen.

 I therefore deduce that the callback is being triggered before the
 execution of the javascript is complete (even though it is loaded, it
 has not executed fully).  It is down to a race as to whether the
 callback is triggered first or the script completes execution.

 Looking at the jQuery code, and I am claiming no expertise here so I
 may well be wrong, it seems that the globalEval function is used to
 execute a local script once downloaded.  I do not see anywhere in this
 function, however, where there are any checks on whether the script
 has fully executed.

 It might be that in IE6, IE7, FF  3 the execution of the javascript
 is paused until the inserted script element has been executed, and in
 FF3, no such pause occurs.  I am hypothesising here though, and really
 don't have enough information on how this method of script loading
 works internally.

 I'm posting this information here more to see if it triggers any
 thoughts in those more experienced jQuery contributors.  In the
 meantime, I will continue my own investigations.

 Cheers,

 Mark.


[jQuery] Re: IE slideDown bad attitude!

2008-09-16 Thread JohnieKarr

From what I can tell it works great for me (ie 6).

On Sep 15, 11:25 pm, JFRanger [EMAIL PROTECTED] wrote:
 Hello World!

 Can some one can tell me WHY the content of my div's disappear (IE
 ONLY) at the end of the slideDown/slideUp functions.

 See it in action:http://dev.residencia.ca/?site=projectadd(click on
 the blue H3's to expand and see the effect)

 I have no padding/margin in the main div as explained 
 herehttp://jqueryfordesigners.com/animation-jump-quick-tip/

 Every thing is 100% nice with FF / SAFARI / CHROME

 The js code;

  function AccordeonProjectAdd() {
   $('#menuProjectAdd div.ui-accordion-content').hide();
   $('#menuProjectAdd div.ui-accordion-
 content:first').slideDown({duration: 2000, easing:'easeOutBack'} );
   $('#menuProjectAdd h3').click(
     function() {
       var checkElement = $(this).next('.ui-accordion-content');
        if((checkElement.is('div'))  (checkElement.is(':visible'))) {
                  return false;
         }
       if((checkElement.is('div'))  (!checkElement.is(':visible'))) {
         $('#menuProjectAdd div.ui-accordion-
 content:visible').slideUp('slow');
         checkElement.slideDown({duration: 1000,
 easing:'easeOutBack'});
                 $('#menuProjectAdd 
 h3').removeClass('ui-accordion-header-over');
                 $(this).addClass('ui-accordion-header-over');

         return false;
         } else {
                  return false
                   }
       }
     );
   }


[jQuery] Re: superfish: advice on using jquery.corners.js plugin

2008-09-16 Thread oconshaw

Some additional info:  I did try the following (I've included an
excerpt from the example file), but the results weren't very good.

link rel=stylesheet type=text/css href=css/superfish.css
media=screen
script type=text/javascript src=js/jquery-1.2.6.min.js/
script
script type=text/javascript src=js/hoverIntent.js/script
script type=text/javascript src=js/superfish.js/script
script type=text/javascript 
src=js/jquery.corners.js/script

script type=text/javascript

// initialise plugins
jQuery(function(){
jQuery('li.sf-menu').superfish();
});

/script
script
  jQuery(document).ready( function(){
  jQuery('.style123').corners(20px);
});
/script

/head
body
div class=style123ul class=sf-menu
li class=current
a href=#amenu item #8595;/a
ul
li
a href=#aamenu item that is 
quite long/a
/li
li class=current
a href=#abmenu item 
#8594;/a
ul
li class=currenta 
href=#menu item/a/li
lia href=#abamenu 
item/a/li
lia href=#abbmenu 
item/a/li
lia href=#abcmenu 
item/a/li
lia href=#abdmenu 
item/a/li
/ul
etc...

On Sep 15, 1:22 am, oconshaw [EMAIL PROTECTED] wrote:
 I'm trying to use the rounded corners plugin (found 
 at:http://www.atblabs.com/jquery.corners.html) to make rounded corners
 for the body (top level) of the menu created by the superfish plugin.
 To start, I'm just using the example file that comes with the
 superfish plugin (as seen here at:  
 http://users.tpg.com.au/j_birch/plugins/superfish/#sample1).

 It seems pretty straightforward, but I'm having trouble.  While I can
 get the corners plugin to work, I can't get it to play right with the
 superfish menu.

 Any ideas or insite is much appreciated.

 Thanks.


[jQuery] Trouble with some onload function

2008-09-16 Thread Firehalk

Hey all,

I'm using the toggle() function to show/hide some div with a form that
I have here. Below that div there's another div, which is clickable
and it's text alternates whenever the display of the above div is
changed.

All is working that way. The problem is that on some pages I need that
div to start with display:block and not display:none (default). And
when I define that, the text doesn't check for the div display upon
the load of the page.

That causes to when I set the div to start with display:block
(showing) on that particular page, the text says Click here to open
the div... That's the mess that is happening here.

So I thought on create some function that upon the body onload, would
check how is the display of that div, and so change the text to
display the current info: Click here to hide when the div is opened
(display:block), and Click here to show when the div is hidden
(display:none).

Here is the current code:

$(document).ready(function(){

function checa_botao() {
var am = $(a#mostra);
var fc = $(#form_consulta);
((fc.css(display) == block) ? am.text(Click here to show) 
:
am.text(Click here to hide));
}

checa_botao();

//Alternar exibição do form
$(a#mostra).click(function () {
checa_botao();
$(#form_consulta).slideToggle(fast);
});

}

But it's not working. When loading the page, even with that function,
the text isnt changing according to the div state (none or block).

Any ideas?

Thanks.


[jQuery] serialize does not send the value of the submit button

2008-09-16 Thread onmountain

Hi. Pretty new to jquery, but have gotten some ajax working - my
question is, is it normal that the serialize does not send the value
of the submit button itself? If so, why is that?

It caused me all sorts of problems, as my php code responds to various
HTML post requests based on the value of the submit button (e.g. add,
delete, or view commands).  The jquery serialize was sending the other
fields OK, but my php server program was just ignoring each request,
based on the missing value of submit.  Seems odd that the submit
button would be treated differently.

My work around is to have the server php code look for missing
submit values and falling back on an additional hidden text field I
had to add to the forms called command.  It does let me treat ajax
posts and normal HTML posts differently, a slight advantage in my
case, but I can't find anything on teh web or my jquery books that
warns people of this difference...

Thanks for any advice (especially if I am doing something really
stupid :-)
Jamie


[jQuery] Checking if input is a number.

2008-09-16 Thread africanshox

i have a serach box that checks for a product code or product keyword.

I need to find out how i can check if the  input submitted on this
search box is a number, and if it is, remove any white spaces.

The reason is that product codes coming from a feed have a space in
them and it is much easier if i sue jquery rather than go through a
collection fo nearly 20,000 codes.

can anyone point me in the right direction?


[jQuery] Re: $.getScript in Firefox 3

2008-09-16 Thread Mark T

Ok, my temporary fix has been to alter the following block of code
from line 2656 in jquery 1.2.6:

// If we're requesting a remote document
// and trying to load JSON or Script with a GET
if ( s.dataType == script  type == GET){
// remote.test(s.url)  
remote.exec(s.url)[1] != location.host )
{
var head = document.getElementsByTagName(head)[0];
var script = document.createElement(script);

I have commented out the second part of the IF statement which tests
whether the URL is remote.  This will force all scripts to use the
script src=??? and onreadystatechange / onload events whether they
are remote or local.

I'd be interested in hearing why using the alternative way for local
scripts is better.

Cheers,

Mark.

On Sep 16, 11:57 am, robert_shipley [EMAIL PROTECTED]
wrote:
 Posted by Rob on Behalf of Mark...

 I've been doing a little investigation into this (I'm a colleague of
 Rob's) and we are still experiencing the issue in Firefox 3.  I'm
 afraid it's very difficult for me to produce an example of this as we
 are using quite a complex set of getScript calls in our website and
 can't make this available to the outside world.  I've managed to
 generate a replica of the page here:http://www.tcc-net.com/jquery-getscript/

 Here are my findings todate:

  - We are calling getScript to retrieve local javascript files.
  - As soon as the file is loaded, we attempt to execute a function
 within the script.

 I put a few console.log messages into the files (Firebug uses
 console.log for debugging) to output messages at certain points.  The
 key ones were a message at the end of the file being retrieved (end
 of tablesorter) with getScript and one in the callback (would
 trigger) which is triggered on (apparent) completion of the load.

 Most of the time, these appear in the console in the correct order
 (end of tablesorter = would trigger).  Occasionally, however,
 they appear the alternate way around and this is when the error
 (myMethod() is not a valid function, or words to those effect) is
 seen.

 I therefore deduce that the callback is being triggered before the
 execution of the javascript is complete (even though it is loaded, it
 has not executed fully).  It is down to a race as to whether the
 callback is triggered first or the script completes execution.

 Looking at the jQuery code, and I am claiming no expertise here so I
 may well be wrong, it seems that the globalEval function is used to
 execute a local script once downloaded.  I do not see anywhere in this
 function, however, where there are any checks on whether the script
 has fully executed.

 It might be that in IE6, IE7, FF  3 the execution of the javascript
 is paused until the inserted script element has been executed, and in
 FF3, no such pause occurs.  I am hypothesising here though, and really
 don't have enough information on how this method of script loading
 works internally.

 I'm posting this information here more to see if it triggers any
 thoughts in those more experienced jQuery contributors.  In the
 meantime, I will continue my own investigations.

 Cheers,

 Mark.


[jQuery] Re: Checking if input is a number.

2008-09-16 Thread Andy Matthews

Well, a number by definition can't have spaces in it. So if there ARE
spaces, then it's a string, and can be treated as such.

Alternately I suppose you could try multiplying the value by 1 and see what
you get.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of africanshox
Sent: Tuesday, September 16, 2008 9:39 AM
To: jQuery (English)
Subject: [jQuery] Checking if input is a number.


i have a serach box that checks for a product code or product keyword.

I need to find out how i can check if the  input submitted on this search
box is a number, and if it is, remove any white spaces.

The reason is that product codes coming from a feed have a space in them and
it is much easier if i sue jquery rather than go through a collection fo
nearly 20,000 codes.

can anyone point me in the right direction?




[jQuery] Read AJAX response in transit?

2008-09-16 Thread Michael Price


Hi all,
Is there any way to use jQuery to stream an AJAX response as it's 
downloading?


For example, I'm running a long script via AJAX and I want to post 
progress updates on the screen as it goes - at certain intervals I 
output a percentage via the AJAX script which my page can then read and 
update on screen.


Does this make sense, and is it possible?

Regards,
Michael Price



[jQuery] Re: jquery scriptaculous conflict - jquery plugin needed

2008-09-16 Thread Eric Martin

I was able to get it working by downloading lightbox and adding
farbastic to the index file that was in the lightbox download:

I added div id=picker/div to the body and the head looks like:
head
titleLightbox JS v2.0 | Test Page/title
link rel=stylesheet href=lightbox/lightbox.css type=text/css
media=screen /
link rel=stylesheet href=farbtastic/farbtastic.css type=text/
css media=screen /
script src=lightbox/prototype.js type=text/javascript/script
script src=lightbox/scriptaculous.js?load=effects,builder
type=text/javascript/script
script src=jquery.js type=text/javascript/script
script type=text/javascript
jQuery.noConflict();
/script
script src=farbtastic/farbtastic.js type=text/javascript/
script
script src=lightbox/lightbox.js type=text/javascript/script
style type=text/css
body{ color: #333; font: 13px 'Lucida Grande', Verdana, sans-
serif;  }
/style
script type=text/javascript
jQuery(document).ready(function() {
jQuery('#picker').farbtastic();
});
/script
/head

HTH

-Eric

On Sep 15, 2:23 am, ^AndreA^ [EMAIL PROTECTED] wrote:
 Thanks Eric,

 wrapping the plugin, as you said, let it works also after the
 jQuery.noconflict() command but if I leave the scriptacolous library
 everything goes badly anyway.

 I think all of these libraries are needed just for lightbox...

 script src=../lightbox/js/prototype.js type=text/javascript/
 script
 script src=../lightbox/js/scriptaculous.js?load=effects type=text/
 javascript/script
 script src=../lightbox/js/lightbox.js type=text/javascript/
 script

 If I want to let the color picker work I have to comment the central
 line (js/scriptaculous.js?load=effects... etc)

 and then I add the jquery library, the noconflict and the plugin
 stuff.

 script type=text/javascript src=js/jquery.js/script

 script
      jQuery.noConflict();
 /script

 etc...

 any other idea to solve the conflict?

 On Sep 12, 6:06 pm, Eric Martin [EMAIL PROTECTED] wrote:

  Andrea,

  In looking at the plugin, it looks like it is using $() but not coding
  to prevent conflict issues.

  Try wrapping the plugin code in:

  (function ($) {

  // plugin code here

  })(jQuery);

  See if that fixes your issue.

  -Eric

  On Sep 12, 9:52 am, ^AndreA^ [EMAIL PROTECTED] wrote:

   Hello everyone,

   I'm working on a website where scriptacolous is already in.

   In a particolar page I need a jQuery plugin (picker 
   color:http://acko.net/dev/farbtastic).

   If I use jQuery.noconflict() the plugin does not work anymore.

   Is there a solution to this?

   Any advice would be appreciated.
   Andrea


[jQuery] Re: Checking if input is a number.

2008-09-16 Thread MorningZ

Totally off the top of my head (and therefore totally untested, but it
should be good)

var EnteredValue = $.trim($(#SearchText).val());
var TestValue = EnteredValue.replace( , );
if (isNaN(TestValue)) {
 return EnteredValue;  // User must have entered a keyword
}
else {
 return TestValue;// Prodict code minus all spaces
}


[jQuery] Re: Checking if input is a number.

2008-09-16 Thread africanshox

okay..so how can check if the string only contains numbers?

im quite new to jquery..would i need to use reg ex?

On Sep 16, 3:58 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Well, a number by definition can't have spaces in it. So if there ARE
 spaces, then it's a string, and can be treated as such.

 Alternately I suppose you could try multiplying the value by 1 and see what
 you get.

 andy

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

 Behalf Of africanshox
 Sent: Tuesday, September 16, 2008 9:39 AM
 To: jQuery (English)
 Subject: [jQuery] Checking if input is a number.

 i have a serach box that checks for a product code or product keyword.

 I need to find out how i can check if the  input submitted on this search
 box is a number, and if it is, remove any white spaces.

 The reason is that product codes coming from a feed have a space in them and
 it is much easier if i sue jquery rather than go through a collection fo
 nearly 20,000 codes.

 can anyone point me in the right direction?


[jQuery] borders work fine with all browsers except IE7

2008-09-16 Thread Namlet

I have a site with several borders that are part of jQuery commands.
One has rounded corners, others don't.  IE7 doesn't render ANY of
these borders.  There are two divs that are not touched by jQuery, and
their borders work fine.  Everything that has a jQuery click event, or
rounded corners has no border at all.  Any ideas?



[jQuery] Re: Trouble with some onload function

2008-09-16 Thread Firehalk

Fixed.

The problem is that toggle() kind of messes with that capture of the
state. When it's block captured on toggle(), its infact hidden yet,
not showing, and vice-versa.


[jQuery] superfish align navbar to the right

2008-09-16 Thread waver

As you can see in de navbar style example the submenu's (http://
users.tpg.com.au/j_birch/plugins/superfish/#sample4) are aligned to
the left (attached to the first menu item).

I've been trying to align them to the right with no luck. The reason I
want to do this is because I have a design with the menu to the right
of the page and i don't want the submenu items going outside of the
browser window. Is it even possible yo assign de submenu to the last
menu item?


[jQuery] Re: $.getScript in Firefox 3

2008-09-16 Thread Mark T

Hmm, actually I think I'm still getting the problem, it's just being
quiet about it now :(

On Sep 16, 3:00 pm, Mark T [EMAIL PROTECTED] wrote:
 Ok, my temporary fix has been to alter the following block of code
 from line 2656 in jquery 1.2.6:

                 // If we're requesting a remote document
                 // and trying to load JSON or Script with a GET
                 if ( s.dataType == script  type == GET){
                                 // remote.test(s.url)  
 remote.exec(s.url)[1] != location.host )
 {
                         var head = document.getElementsByTagName(head)[0];
                         var script = document.createElement(script);

 I have commented out the second part of the IF statement which tests
 whether the URL is remote.  This will force all scripts to use the
 script src=??? and onreadystatechange / onload events whether they
 are remote or local.

 I'd be interested in hearing why using the alternative way for local
 scripts is better.

 Cheers,

 Mark.

 On Sep 16, 11:57 am, robert_shipley [EMAIL PROTECTED]
 wrote:

  Posted by Rob on Behalf of Mark...

  I've been doing a little investigation into this (I'm a colleague of
  Rob's) and we are still experiencing the issue in Firefox 3.  I'm
  afraid it's very difficult for me to produce an example of this as we
  are using quite a complex set of getScript calls in our website and
  can't make this available to the outside world.  I've managed to
  generate a replica of the page here:http://www.tcc-net.com/jquery-getscript/

  Here are my findings todate:

   - We are calling getScript to retrieve local javascript files.
   - As soon as the file is loaded, we attempt to execute a function
  within the script.

  I put a few console.log messages into the files (Firebug uses
  console.log for debugging) to output messages at certain points.  The
  key ones were a message at the end of the file being retrieved (end
  of tablesorter) with getScript and one in the callback (would
  trigger) which is triggered on (apparent) completion of the load.

  Most of the time, these appear in the console in the correct order
  (end of tablesorter = would trigger).  Occasionally, however,
  they appear the alternate way around and this is when the error
  (myMethod() is not a valid function, or words to those effect) is
  seen.

  I therefore deduce that the callback is being triggered before the
  execution of the javascript is complete (even though it is loaded, it
  has not executed fully).  It is down to a race as to whether the
  callback is triggered first or the script completes execution.

  Looking at the jQuery code, and I am claiming no expertise here so I
  may well be wrong, it seems that the globalEval function is used to
  execute a local script once downloaded.  I do not see anywhere in this
  function, however, where there are any checks on whether the script
  has fully executed.

  It might be that in IE6, IE7, FF  3 the execution of the javascript
  is paused until the inserted script element has been executed, and in
  FF3, no such pause occurs.  I am hypothesising here though, and really
  don't have enough information on how this method of script loading
  works internally.

  I'm posting this information here more to see if it triggers any
  thoughts in those more experienced jQuery contributors.  In the
  meantime, I will continue my own investigations.

  Cheers,

  Mark.


[jQuery] Re: serialize does not send the value of the submit button

2008-09-16 Thread Mike Alsup

 Hi. Pretty new to jquery, but have gotten some ajax working - my
 question is, is it normal that the serialize does not send the value
 of the submit button itself? If so, why is that?

Yes, that is normal because the serialize method has no way of knowing
which submit element was clicked.  If you need that functionality you
can check out the Form Plugin, specifically, its ajaxForm method.

http://www.malsup.com/jquery/form/

Mike



[jQuery] Re: Checking if input is a number.

2008-09-16 Thread MorningZ

okay..so how can check if the string only contains numbers? 

Takes out user entered spaces
var TestValue = EnteredValue.replace( , );

Checks if the remaining value is numeric
isNaN(TestValue)


And this method doesn't really need jQuery (nor would i see why it
would have to)


[jQuery] Re: Bind events on DOM elements inserted from other frame

2008-09-16 Thread hubbs

Ok Brandon,

I found this in another post:

var doc = $('#testframe')[0].contentWindow.document;
$(doc.body).append('spantest/span');

This seems like it would help, but I am not sure how to use this,
along with what you posted to get it working correctly.  Somehow
sending the GET within the context of the contentWindow is confusing
me, and I just can't get it working.

On Sep 15, 9:18 am, Brandon Aaron [EMAIL PROTECTED] wrote:
 To see what I mean run this in Firebug:
 $('iframe')[0].contentWindow.$ = $;

 Then click on the link in the iframe and it will behave as you expect.

 --
 Brandon Aaron

 On Mon, Sep 15, 2008 at 9:13 AM, Brandon Aaron [EMAIL PROTECTED]wrote:

  This would work if you used the frames parent instance of jQuery. LiveQuery
  works by monitoring the DOM methods within jQuery. Since within the frame
  you are using a new instance of jQuery, LiveQuery will not be monitoring its
  DOM methods.
  --
  Brandon Aaron

  On Sun, Sep 14, 2008 at 11:04 PM, hubbs [EMAIL PROTECTED] wrote:

  I can confirm that using event delegation will fix this problem.  I
  guess that it is just a problem with the LiveQuery plugin.  Brandon,
  if you are where around here, could you comment on this?

  Thanks.

  On Sep 14, 2:29 pm, hubbs [EMAIL PROTECTED] wrote:
   I have a working example of this, and would really like help
   understanding why bind or livequery does not bind events to DOM
   elements that are inserted from an iframe.

  http://web2.puc.edu/PUC/files/bind.html

   Clicking the insert from frame link will append links to the parent
   frame, which won't pick up the click event.  But, clicking the insert
   from body link will append links within the same frame and will
   correctly have the click events bound.

   Why is this happening?

   On Sep 12, 9:02 pm, hubbs [EMAIL PROTECTED] wrote:

I have been experiencing strangeness with trying tobindevents to DOM
elements that have been inserted from a different frame using .get().
For some reason the elements don't be binded with the events if they
are inserted from other frame.  In testing, if I try the same
  thingwithinthe SAME frame the the events get binded correctly.

Am I missing something here?  Is this a limitation of jQuery?


[jQuery] Re: $.getScript in Firefox 3

2008-09-16 Thread Mark T

Actually, scratch that - it seems to be working now.

I'd still appreciate a comment from a jQuery guru on the original
problem I've worked around here!

Mark.


[jQuery] Re: Checking if input is a number.

2008-09-16 Thread africanshox

hi thanks for the quick code but this does not seem to evaluate if i
enter a number.

see code below


$(#searchForm input.submitBtn).click(function(e){

var EnteredValue = $.trim($(#keywords).val());

var TestValue = EnteredValue.replace( , );

alert(EnteredValue);
alert(TestValue);

 if (isNaN(TestValue)) {

 alert(is a letter)
   return EnteredValue;  // User must have entered a keyword

}
else

return TestValue;// Prodict code minus all spaces
 alert(is a number)


})


On Sep 16, 4:14 pm, MorningZ [EMAIL PROTECTED] wrote:
 Totally off the top of my head (and therefore totally untested, but it
 should be good)

 var EnteredValue = $.trim($(#SearchText).val());
 var TestValue = EnteredValue.replace( , );
 if (isNaN(TestValue)) {
  return EnteredValue;  // User must have entered a keyword}

 else {
  return TestValue;// Prodict code minus all spaces

 }


[jQuery] Docs server weirdness, almost looks like defacing

2008-09-16 Thread Bradley Sepos

http://bradleysepos.com/dropbox/jquery-docs-wierd.png

Notice the title, heading text and the layout issues. Looks like 1/2
an error page, 1/2 the actual page. Anyone working on the server right
now?


[jQuery] Re: serialize does not send the value of the submit button

2008-09-16 Thread onmountain

Thank Mike,
That was a help. Thought I was going crazy there for a while. The
problem with working with ajax in a new language is that you never
know what part of the transaction is problematic.

I have set up an example with ajaxForm and have it working fine with
json. However, is there something specifically on the server side
(php) I should do if I am wanting to pass html back?  I can't just use
a bunch of echo lines can I? I don't get anything back when I do
that.  I have to build a response into a variable and send that
(careful not to have any  in there) back as jason.

I can't seem to reproduce the server php code needed to reply back to
the sample at : http://malsup.com/jquery/form/#code-samples


On Sep 16, 11:53 am, Mike Alsup [EMAIL PROTECTED] wrote:
  Hi. Pretty new to jquery, but have gotten some ajax working - my
  question is, is it normal that the serialize does not send the value
  of the submit button itself? If so, why is that?

 Yes, that is normal because the serialize method has no way of knowing
 which submit element was clicked.  If you need that functionality you
 can check out the Form Plugin, specifically, its ajaxForm method.

 http://www.malsup.com/jquery/form/

 Mike


[jQuery] accordion open in different sections?

2008-09-16 Thread KEVIN EVANS

Hello,

I am working on a site where I am using the Accordion script from 
http://docs.jquery.com/UI/Accordion 
  on the left navigation.

You have an option to keep a section open by defaultbut I need to  
change which button is opened depending on which section you are in,  
and I have that accordion menu in a include so I dont see how you can  
do it.

The one that is open by default has a class of opener.

Any ideas?

Kevin


[jQuery] $.post using dynamic arrays

2008-09-16 Thread Anthony

This may be quite simple for many, but I am stuck trying to make a
dynamic $.post() where the request (post) variables passed are fed
from a dynamicly changing array.


/-- CODE --/

// just above this is a function that takes a url string and parses
out the variables and store them in an assoc. array.  This info will
be used by the $.post().

url = resources/java/community_rpc.php;
$.post(
 /index.php,
 { run: url, **THIS IS WHERE I WANT TO DO MY DYNAMIC ARRAY
PASSING*** },
 function(debug){
alert(dump(debug));
*THIS IS WHERE THE CALLBACK IS RUN*
},
 json
);
/-- END CODE --/

I have tried different things, but each time I get an error that
things aren't defined, or that [] is not permitted ... I am relatively
new to JQuery, so I probably am missing a very important step.  What I
would like to get working would look like this:

{ run:url, dynamic1: value1, dynamic2:value2 ... dynamicN: valueN }


Thanks
Anthony


[jQuery] Re: Read AJAX response in transit?

2008-09-16 Thread onmountain

Hi. I guess if the process is REALLY long, like minutes or hours, it
could be done. How about this as an idea:
1. on the server, create two handlers. The first one is the action you
call to start the long process off with - call it start. The second
will be a progress check - call it check.
2. When start is called with ajax the first time, it will have to
pass an ID back via the ajax response the calling routine.  Assuming
that these are webpages, you have to have a way to differentiate
between different start requests. You might have one, you might have
20 different start ajax requests going.   Note that is the process
is really long, in that it soaks up huge CPU resources, etc, you may
be better off have some sort of lock-out flag set when you start,
preventing other costly start requests beginning at the same time. The
ajax response in those cases would tell the user yo try again later,
etc.
3. The start program on the server will need to periodically update
some sort of file or DB record on its state, like % done, using the ID
it is working on and had previously passed back.
4. The check (with an ID passing back too) would cause the server to
look for a % in that file or DB with that particular ID.  It could
reply with status % or other info, like No such process.

Anyway, that is what came to my mind. If it is really long, perhaps it
would be better to queue up the incoming jobs, and just put results on
webpages with a URL passed back in the first step - the user or his/
her program could just keep checking that URL until there was a
finished product.

Good luck,
Jamie


On Sep 16, 11:09 am, Michael Price [EMAIL PROTECTED] wrote:
 Hi all,
 Is there any way to use jQuery to stream an AJAX response as it's
 downloading?

 For example, I'm running a long script via AJAX and I want to post
 progress updates on the screen as it goes - at certain intervals I
 output a percentage via the AJAX script which my page can then read and
 update on screen.

 Does this make sense, and is it possible?

 Regards,
 Michael Price


[jQuery] Re: Checking if input is a number.

2008-09-16 Thread MorningZ

Here is some working code

http://paste.pocoo.org/show/85443/


and just to note on your code, you have:

alert(is a number)

*after* the return TestValue line... that would never ever fire


[jQuery] Re: Jcrop v0.9.0 image cropping plugin - comments please

2008-09-16 Thread Jose

thanks.

I am a bit confused which one should I use.  I think some plugin
authors should be encouraged
to  go the UI way, if the advantages are clear.

Maybe the author can comment why he didn't pick UI as the base to
build the plugin

regards
jose


On Mon, Sep 15, 2008 at 9:38 PM, Richard D. Worth [EMAIL PROTECTED] wrote:
 jQuery UI could be used (thought it isn't in this case) to make a crop
 component like this. You would make use of three lower-level interaction
 plugins:

 Mouse (internal, in ui.core.js)
 Draggables (ui.draggable.js, builds on mouse)
 Resizables (ui.resizable.js, builds on mouse)

 So there's a bit of overlap. Here's a very simple demo of one done in that
 way:

 http://ui.jquery.com/repository/real-world/image-cropper/

 The other thing that jQuery UI would offer a plugin like this is a widget
 plugin system that abstracts out some common elements like defaults,
 options, method calls, getters/setters. I think it would quite interesting.

 - Richard

 On Mon, Sep 15, 2008 at 2:00 PM, Jose [EMAIL PROTECTED] wrote:

 hi,

 how does the plugin compare to the functionality in UI ?

 thanks and regards,
 jose

 On Tue, Sep 9, 2008 at 11:35 PM, Kelly [EMAIL PROTECTED] wrote:
 
  Announcing initial release of Jcrop image cropping plugin for jQuery.
  This is my first plugin release, so I would appreciate any feedback.
 
  http://deepliquid.com/content/Jcrop.html
  Also posted to plugins.jquery.com
 
  There are some rough edges in the API and a few other minor issues.
  More work to do before 1.0, but what's there is pretty functional.
  I needed to push it out or I'd keep tinkering forever...
 
  Thanks for looking!
  -Kelly
 




[jQuery] Improvement to delegate plugin to simulate bubbling

2008-09-16 Thread Matt Kruse

I've been writing my own event delegation handling for a long time,
but today I thought I'd look at how the delegate plugin does it. Not
very complicated, as I found out!

It doesn't do one thing that I needed today, however. It doesn't check
for matches against the whole bubble chain - just against the actual
event target.

For example, I load a table into a container via ajax, and I want to
delegate the handling of table row clicks to the container so it still
works after ajax reloads. The table source may look like:

table
tbody
   tr class=user
  tdMatt/td
  tdKruse/td
   /tr
/tbody
/table

I want to fire a function when the user clicks on tr.user. But when
they actually click, the target is one of the td's, not the tr.

I modified the delegate plugin to start at the target element and then
bubble up through each parent element to check the selectors, just as
the original event bubbling did. This way I can check for selector
matches anywhere up the chain, not just on the target.

I also changed it so I could use syntax like this:

$('#container').delegate( 'click' , { '.selector1':func1,
'.selector2':func2 } );
or:
$('#container').delegate( 'click' , '.selector1', func1 );

Because of the simulated bubbling, I wouldn't use this for any events
that fire rapidly. But in my tests of handling clicks (probably 95% of
all event delegation I do) it works very quickly.

Here is my modified code. Any thoughts?

;(function($) {
$.extend($.fn, {
delegate: function(type, handlers, handler) {
if (typeof handlers!='object') {
// A single selector/handler has been passed in
handlers = {handlers:handler};
}
var selector;
return this.bind(type, function(e) {
var $o = $(e.target);
while($o$o[0]$o[0]!=this) {
for (selector in handlers) {
if ($o.is(selector)) {
return 
handlers[selector].apply($o,[$o,e]);
}
}
$o = $o.parent();
}
});
}
})
})(jQuery);


Matt Kruse


[jQuery] [validate] Issues in IE6

2008-09-16 Thread Mattl

Hi,
I've got form validation using 
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
working well in Firefox 2, Safari 3.1, Opera 9.5 etc but throwing up
an error in IE6.

I can't see what's wrong, any suggestions?

http://www.edenvillamedical.co.uk/

The form in question is under the 'Prescriptions' tab. 'Patient Name'
is required.

Appreciate any help.

Many thanks
Matt


[jQuery] ajax not working on new form added to a page after an ajax operation

2008-09-16 Thread onmountain

Hi. I have a calendar which lists events. After each event I have a
delete form. When someone clicks the submit, I use ajaxform to
return new html that replaces the entire day's list of events,
including a new delete form for each event.  My problem is, the new
forms do not seem to be ajaxed. When pressed, those newly replaced
items just go straight to an old fashioned POST, not ajax.  When I
refresh the page manually, they work.

Do I have to do something to refresh the things in $
(document).ready() ?
Thanks,
Jamie


[jQuery] Re: Change user status with AJAX

2008-09-16 Thread suntrop

Hi, and thanks for the help.

the server side code is above. It seems to be correct. I guess the JS
isn't working correct since there is no new connection as I see in the
status bar. Nothing happens when I click the link.

Thanks for the code Andreas! I am sorry but I can understand it in
detail. This is only for changing the image? But where and how can I
integrate it into my code? And where can I update the DB?


Hope you can help me little bit more :-)

Thanks a million!



On 14 Sep., 22:34, Andras Kende [EMAIL PROTECTED] wrote:
 Hello,

 I have this for a toggling, debug with firebug so you could see whats
 happening:

 jQuery(document).ready(function() {

 jQuery(a.status).unbind(change);
 jQuery(a.status).click(function(){
 var p = this.firstChild;
 if (p.src.match('icon_1.png')) {
 jQuery(p).attr({ src: /img/icon_0.png, alt: Activate });} else {

 jQuery(p).attr(src,/img/icon_1.png);
 jQuery(p).attr(alt,Deactivate);};

 jQuery.get(this.href + ? + new Date().getTime() );
 return false;}

 );

 }

 )

 td class=changea href=/admin/favorites/changestatus/5/favorite/
 class=statusimg src=/img/icon_0.png alt= //a/td

 Andras Kendehttp://www.kende.com/

 On Sun, Sep 14, 2008 at 7:36 AM, suntrop [EMAIL PROTECTED] wrote:

  I am sorry if this was posted twice!

  ---

  Hi,

  I have a list of users that I pull out of a MySQL DB. Some are
  favorite users marked with a star.
  Now I want to change the state is favorite/is not favorite quickly
  with a click on the star image, and the image should turn directly to
  its state yellow(is favorite) or grey(is not favorite).

  This is how the link and image looks like:
  a href={$user.id} class=makeFavorite id=makeFavorite-{$user.id}
  title=Save as favoriteimg src=images/{if $user.favorit ==
  1}favorites.png{else}favorites2.png{/if} width=16 height=16
  alt= //a

  The JS look like this:
  // Make Favorite
  $('.makeFavorite').click(function() {
 $.ajax({
 type: POST,
 url: make_favorite.php,
 data: id=19,
 success: function(msg) {
 alert('Data saved: ' + msg);
 }
 });
 return false;
  });

  The PHP:
  ?php
  …mysql connect …
  $sql = UPDATE table SET favorite='1' WHERE id=$_POST[id];

  mysql_query($sql);

  echo 'My Msg: id is: ' . $_POST['id'];
  ?

  But unfortunately it doesn't work :(
  The Msg says My Msg: id is 19 but the state in the DB won't update.

  Since this is the very first time I'm dealing with AJAX it is a quite
  big thing for me :-)

  What is wrong with the code above? And how can I change the image
  directly without reloading the page?

  Hope you get what I want to do and can help me. Thanks!


[jQuery] Re: JQuery - wrap() + Internet Explorer problem

2008-09-16 Thread ricardobeat

ooops.

yeah, everything disappears on subsequent reloads.

As Karl said, it looks like an IE rendering bug. When you change any
of the style properties of an element inside #content, everything goes
back to normal. Add 'visibility: visible' to your anchors tags and see
what happens, adjusting the CSS should solve your problem.


On Sep 16, 4:26 am, weidc [EMAIL PROTECTED] wrote:
 Well for me it still doesn't work. I tried it in IE 6 and 7 with
 windows vista and xp.
 The first time I load the site it works but if I reload it it doesn't.

 On 15 Sep., 20:41, ricardobeat [EMAIL PROTECTED] wrote:

  Works ok for me, It's probably your IE install.

  On Sep 15, 10:26 am, weidc [EMAIL PROTECTED] wrote:

   I still haven't solved it yet. Does someone got an idea?

   -weidc

   On 11 Sep., 13:49, weidc [EMAIL PROTECTED] wrote:

Here's the link -http://tinyurl.com/629qpt

It's really strange. The first 3-5 min it works and after that it
removes the picture as I said.

-weidc

On 10 Sep., 18:12, Karl Swedberg [EMAIL PROTECTED] wrote:

 I'm guessing this has less to do with wrap() than with an IE 
 rendering  
 bug of some sort. If you could provide a link to page that we can 
 look  
 at, that would be helpful. My hunch is that you're dealing with a  
 hasLayout issue, but hard to tell if I can't see it.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Sep 10, 2008, at 4:32 AM, weidc wrote:

  Hi,

  well I got some problems with wrap() and IE. It works fine in 
  FireFox
  but if I try it in IE it removes every picture beside the one I
  clicked. But if I tab in an other register in IE and tab back it 
  works
  like in FireFox.

  I wonder if there is a way to get it work with wrap() or if there is
  an other way to get it like that.

  I hope someone got an idea.

  -weidc


[jQuery] Play Counter Strike and Dragon Ball Z

2008-09-16 Thread guilhermelima77

www.gamesflash.zip.net


[jQuery] Trying to use serializeArray to send JSON to a .NET 2.0 Web Service

2008-09-16 Thread Namlet

I am using serializeArray to send a form as a JSON object to a .NET
2.0 Web Service in C#.

I am getting this error, prefix is the first field:

responseText: {Message:Invalid JSON primitive:
prefix.,StackTrace: at
System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
\r\n at
System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32
depth)\r\n at
System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String
input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer
serializer, String input, Type type, Int32 depthLimit)\r\n at
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T]
(String input)\r\n at
System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext
context, JavaScriptSerializer serializer)\r\n at
System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData
methodData, HttpContext context)\r\n at
System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext
context, WebServiceMethodData
methodData),ExceptionType:System.ArgumentException}

The Web Method is doing nothing right now, just returning the input:
[WebMethod]
public string setBMBJSONString(string guid)
{

return guid;
}

Any idea what's wrong?  Can this be done this way?  Is there a way I
can serialize it to a JSON formatted string instead?

Thanks.



[jQuery] Re: Need some help with image map coding....

2008-09-16 Thread Aaron

Yes I already have that downloaded before it provided a non colored
map of the U.S and I just colored it in.

The problem I face is I  don't want to use the image map to link to
different files. I don't want to use links.

I want to use php in a way where when the person clicks a state the
image mape would pass the value meaning the name of the state this
would then be included in my php script so it would do a database
lookup.

What I am trying to make is a gui  instead of a drop down list of
states. The purpose of this is to have a interface friendly that when
you click a sate you will get the listings of that state.

So I notice in the code that they only have each state to have there
own html page I don't want to do that. I just want a gui that when you
click the state the image map will be gone but the table with the list
will appear  and I plan to make a button that when click it would go
back to the map of the U.S.A.

I am trying to make a  system where in the U.S you can put postings
meaning if you want to sell something or have some type of event where
you want local people to know about it.

SO I have mysql and use php for that. The problem I am having is
making the image map as a form type where I can get a value passed to
my php code using post method so I can using php figure out what the
user click so I can do a database lookup on listings of that state and
then display them.



On Sep 16, 3:00 am, Peter Edwards [EMAIL PROTECTED] wrote:
 this turned up in a google search and seems to meet your needs:

 http://www.freevbcode.com/ShowCode.asp?ID=1854

 on 16/09/2008 01:29 Aaron said::

  Hi I am trying to make a image map of the U.S.A  so when users click a
  state my php code would grab the value that was clicked which would be
  a states name so I can go into my database using php and do a lookup
  and generate a list that was submitted for that state.

  Does jquery or javascript offer good usermaps coding???

  I am trying to find pre-coded image map of the U.S.A. So I don't have
  to reinvent the wheel I mean it will take a while for me to put each
  code for each 50 state.

  any ideas??


[jQuery] How to use a div as a placeholder for other divs?

2008-09-16 Thread zephyr

Hi,
I have a div id=content that serves as a placeholder for text. The
text are all like

div id=about
test test test
/div

div id=links
link link link
/div

div id=contact
[EMAIL PROTECTED]
/div

When the user clicks a link, I use it's id attribute value
(about,contact or links). I use that value to show the content of
the corresponding div in div content. Div content is visible, the
others are invisible
I succeed in prepending() the div to div content:

activeElementId = $(this).attr('id')
$(div#content).prepend($([EMAIL PROTECTED]+activeElementId+]).html())


but if I do this in succession, new texts get appended to exisiting.
Of course I do not want this- I want the text about to be shown in
content or links. Not both because append() appends! How can I
remove a div before showing another one?

if(typeof(activeElementId) != undefined){
$(div#content).remove($(div))
}

gives me an error t.substring is not a function when I click a
second link and only the first text is shown

Thanks


[jQuery] How to serialize an Object to JSON String without making it POST like?

2008-09-16 Thread Namlet

When I use this function to create a JSON object:

var formObject = $(:input).serialize();

and I print it, I get name=valuename=value...  This isn't proper
JSON string and the .NET webservice I'm sending it to barfs.

How can I make it stay in the proper format, i.e.

{'fname':'dave', 'lname':'ward'}

Thanks!


[jQuery] tablesorter (highlighting columns by appling td class=sorted )

2008-09-16 Thread chovy

Is there a way to apply a class to the table cells of the sorted
column?

I want to have the sorted column to have a class=sorted on each of
it's table data cells.


[jQuery] how to use Current of superfish

2008-09-16 Thread ric

after all (with big help of Joel) I managed to setup my menu.

since i wanted it the way that the background and the font color
change
when hovering the menu items i know encounter another problem for
setting
the current menu.

the current class doesnt not work. so i decided to use my own way of
setting
a current menu. (maybe quit helpful so i do post it)

1.
put body id=home and body id=about in the html files

2.
a href=index.html class=homeHome/a
a href=about.html class=aboutabout/a

2.
put into the CSS file

#home .home, #about .about
{
color: #D1002F;
background: #FFF;
}

et voila!

nevertheless  the graphical arrow now disappears when working that
way.

what am i doing wrong?
How can I use current of superfish


[jQuery] Re: linking two controls

2008-09-16 Thread Jan Limpens

ah and by popup i mean something like a modal dialogue on the page,
not another browser instance.

On Tue, Sep 16, 2008 at 3:22 PM, Jan Limpens [EMAIL PROTECTED] wrote:
 hello,

 on several pages I have small forms (plural) with a textbox and a
 button. If I click on the button, a popup shows a search form. The
 results of the searchform are shown in the very same popup as a list
 of radiobuttons/labels. If someone selects a radiobutton, it's value
 should be inserted into the textbox next to the button. Then the popup
 should go away.

 This popup (something like a singleton) serves many different pages,
 so I cannot hardwire it. Probably I need to pass a delegate to some
 event the form provides, indicating the originating form. Problem is:
 I have no idea how something like this can be done. Anyone could give
 me a hint or two, or direct me to good resources on similar matters?

 The popup looks like that:

 form id=article-search-form method=get
 action=${Url.For([EMAIL PROTECTED]:'articles',
 @action:'FullTextSearchAsJson'})}
input type=text name=fragment /
input type=submit value=Buscar /
 /form
 form id=article-search-result method
 /form

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

 script type=text/javascript

 $(document).ready(function() {
$('#article-search-form').ajaxForm({
dataType: 'json',
success: fillListWithArticles
});
 });

 function fillListWithArticles(data)
 {
var list = $(#article-search-result);
$(list).empty();
i = 0;
$.each(data, function(){
id = article-search-result- + i;
$(divinput type='radio' value='+this.Id+' id='+id+'
 name='article.Id'/label style='float: inherit' for='+id+' +
 this.Name +/label/div).appendTo(list);
i++;
});
 }
 /script

 --
 Jan
 ___
 [EMAIL PROTECTED]
 www.limpens.com
 +55 (11) 3082-1087
 +55 (11) 3097-8339




-- 
Jan
___
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339


[jQuery] linking two controls

2008-09-16 Thread Jan Limpens

hello,

on several pages I have small forms (plural) with a textbox and a
button. If I click on the button, a popup shows a search form. The
results of the searchform are shown in the very same popup as a list
of radiobuttons/labels. If someone selects a radiobutton, it's value
should be inserted into the textbox next to the button. Then the popup
should go away.

This popup (something like a singleton) serves many different pages,
so I cannot hardwire it. Probably I need to pass a delegate to some
event the form provides, indicating the originating form. Problem is:
I have no idea how something like this can be done. Anyone could give
me a hint or two, or direct me to good resources on similar matters?

The popup looks like that:

form id=article-search-form method=get
action=${Url.For([EMAIL PROTECTED]:'articles',
@action:'FullTextSearchAsJson'})}
input type=text name=fragment /
input type=submit value=Buscar /
/form
form id=article-search-result method
/form

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

script type=text/javascript

$(document).ready(function() {
$('#article-search-form').ajaxForm({
dataType: 'json',
success: fillListWithArticles
});
});

function fillListWithArticles(data)
{
var list = $(#article-search-result);
$(list).empty();
i = 0;
$.each(data, function(){
id = article-search-result- + i;
$(divinput type='radio' value='+this.Id+' id='+id+'
name='article.Id'/label style='float: inherit' for='+id+' +
this.Name +/label/div).appendTo(list);
i++;
});
}
/script

-- 
Jan
___
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339


[jQuery] Re: SOS

2008-09-16 Thread ricardobeat

there is no dataType 'responseXML', try using dataType : 'xml'


On Sep 16, 1:59 am, Kaherman [EMAIL PROTECTED] wrote:
 hi,

 my server side script returns following xml output-

  ?xml version=1.0 encoding=UTF-8 ?
 - markers
   marker lat=22.8015 lng=91.0986 Device=ET700C Index=1 /
   marker lat=23.0494 lng=91.4117 Device=ET700C Index=2 /
   marker lat=23.2666 lng=91.1261 Device=ET700C Index=3 /
   marker lat=22.6951 lng=90.3845 Device=ET700C Index=4 /
   marker lat=22.5836 lng=89.9725 Device=ET700C Index=5 /
   marker lat=23 lng=90 Device=ET700B Index=1 /
   marker lat=24 lng=90 Device=ET700A Index=1 /
   /markers

 and on my client side, i want to catch it using following code-

    $.ajax({
            url: ?=base_url();?Main/Mova,
            global: false,
            type: POST,
            async: false,
            dataType: responseXML,
            data: first_select=+ valore, //the name of the $_POST
 variable and its value
            success: function (request) //'response' is the output
 provided by the controller method prova()
                   {
                         $(request).find(marker).each(function()
                         {
                                 alert(Hello); // alert 1
                                //alert($
 (request).find(marker).attr(lat));

                         })
                                 alert(request); //alert 2
                  }

           });

 
 alert 2 prints alright(The XML), but, i am not getting anything from
 alert 1, how do i access xml elements?

 please help.


[jQuery] jQuery and setTimeout

2008-09-16 Thread zoltalar

How can I make the element (div with class=request), fade out after
loading page and waiting 5 seconds, basically:

1) load the page
2) wait 5 seconds
3) fade out the element

Here's what I have:

jQuery(document).ready
(
function()
{
jQuery('div.request').fadeOut(5000);
}
);


[jQuery] an example of a php response to ajaxForm request

2008-09-16 Thread onmountain

Is there any special thing that needs to be done to reply correctly to
an ajaxForm request expecting html back? I can get it to work with
echoing back a jason array, but nothing I do will get just a straight
text response to work.  Do I need to send a success somehow, could
that be messing me up?  Thanks for any php fragments you might have.
Jamie


[jQuery] Re: Problem with .remove() in IE7

2008-09-16 Thread Carl Von Stetten

Has anyone else come across this?  This is happening on all of my report 
pages.

Thanks,
Carl

Carl Von Stetten wrote:
 Hi,

 I'm using jQuery 1.2.6.min.js on an intranet application.  I have a
 page that when loading, displays a report loading message with an
 animated gif.  This report loading stuff is located within a div
 called wait.  When the document finishes loading, I want to remove
 this div.

 Here is an abbreviated form of my jQuery ready function:

 $(document).ready(function() {
 a bunch of code here unrelated to my div
$(#wait).remove();
 });

 This works fine in Firefox 3 - the div is removed.  In IE7, the
 div is removed but I get a ubiquitous Object required error.  If I
 comment out this one line of code, I don't get any errors.  I also
 tried using hide() instead of remove(), but got the same error.

 Any ideas about what I'm doing wrong?

 Thanks,
 Carl


   


[jQuery] Re: How to retrieve all content within an element's start and end tags

2008-09-16 Thread ricardobeat

Oh yeah, sorry. But who writes HTML4 this days, specially using
jQuery? ;)

On Sep 16, 6:55 am, k3liutZu [EMAIL PROTECTED] wrote:
 If he is using HTML  then br is actually correct.

 On Sep 15, 9:32 pm, ricardobeat [EMAIL PROTECTED] wrote:

  Anchor elements are inline, unordered lists are block elements. A
  paragraph can only contain inline elements. And you should close your
  (unncessary)br / tags too! Semantically correct markup would be:

  div
  ptext/p
  ul.../ul
  /div

  Then you don't need line-breaks cluttering your code.

  On Sep 15, 9:37 am, RobG [EMAIL PROTECTED] wrote:

   On Sep 15, 9:08 pm, zephyr [EMAIL PROTECTED] wrote:

Ok, i found it.
The p element doesn't allow ul as a content. ... Strange because
elsewhere I do have a href=blablabla/a
in a p tag and that's ok...

   Because the HTML specification says that A elements are allowed inside
   P elements and conforming browsers oblige.

   --
   Rob


[jQuery] Re: Read AJAX response in transit?

2008-09-16 Thread ricardobeat

It is possible, but is complicated.

First, google always helps: http://ajaxpatterns.org/Progress_Indicator

Is the script long in runtime or in size?

If it's in size, you have three options:
1. use a fake progress bar that runs on an estimate of download time
2. use subsequent XHR requests to get the current progress from the
server (requires server-side programming)
3. split the script in parts, and have one part load the next while
increasing the progress bar (no server-side code needed)

If it's a long running script, you could use a recursive pattern (a
function looping over itself) that updates the counter and goes on
with the next set of operations.

Hope I've helped.

On Sep 16, 12:09 pm, Michael Price [EMAIL PROTECTED] wrote:
 Hi all,
 Is there any way to use jQuery to stream an AJAX response as it's
 downloading?

 For example, I'm running a long script via AJAX and I want to post
 progress updates on the screen as it goes - at certain intervals I
 output a percentage via the AJAX script which my page can then read and
 update on screen.

 Does this make sense, and is it possible?

 Regards,
 Michael Price


[jQuery] Re: IE slideDown bad attitude **SOLVED**

2008-09-16 Thread JFRanger

Only by adding zoom:1 in the css fixed my problem under IE7

Enjoy that small tip!


[jQuery] Re: Need some help with image map coding....

2008-09-16 Thread Aaron

Ya I do have that and seen it before I currently do have it and have
colored it.

The problem is that the image map has links to state web pages I don't
want to have to create a web page for every state.  It would  take up
room and it really doesn't need.


I want something that I can just have the user click the state and
then it would send using the post method to my php script so I can go
in mysql and do a search and generate a list of stuff that is posted
in that state and then take out the image map and load the table that
has the list in.
I would also have a button that when click it would take  you back to
the image map.

So instead of making 50 html pages I would just used what the person
selected and just display the list in a table while the image map is
tooken off.

This will allow us to save space and also make one script that can do
this.

this is what I want.  I seriously can't afford creating 50 different
html pages for each state... I don't have the memory space for it.

I do have memory space but planned to be used by users.



[jQuery] Re: Hover on all elements: $(*).hover(...)

2008-09-16 Thread John Boxall

Hi Balazs,

Thanks for the reply - looking at your suggestion, my idea was to
apply it to the code like this:

$(function() {
$(*).hover(
   function(){

// If the element has more than one child stop
propagating.
if ($(this).children().length()  0) {
return False
}

$(this).addClass('selected');
},
function(){
$(this).removeClass('selected');
}
);

}

This is _close_ to what I want, but what I'd really like is to grab
DOM element you are hovering over with the minimum number of children
- not necessarily zero.

It's my understanding that with the above, if you hovered over a p
with a strong inside you couldn't select the p because it would
have a child!

Thanks,

John


Should only return true if the selected $(this) has no children.
This is _close_ to what I want - but what I'd really like is to grab
the element

On Sep 14, 4:10 am, Balazs Endresz [EMAIL PROTECTED] wrote:
 Hey John,

 I think this will do that:

 $('body').find('*').filter(function(){
   return !$(this).children().length;})

 .add('p').not('p *') //without this, if a paragraph contains tags 
 thehoverwon't be applied to the most of the text

 On Sep 12, 9:29 pm, John Boxall [EMAIL PROTECTED] wrote:

  Heyo jQuery hackers,

  I'm putting together a little script that adds a class selected to
  an element when youhoverover it.
  When you stop hovering the class selected class is removed.

  I would like the class only to be apply to the lowest element in the
  DOM.

  For example say I was hovering over a p deep inside a document - I
  would like to only add the class selected to that p tag, not the
  div, body and html tags surrounding it.

  So far my thinking has been to use something like this:

  $(function() {
          $(*).hover(
             function(){
                  $(this).addClass('selected');
              },
              function(){
                  $(this).removeClass('selected');
              }
          );

  }

  Which adds the selected class to any element Ihoverover fine. It
  also removes it.

  The problem is thehoveris firing all the way up the chain and
  hitting all elements from the lowest to the highest so I've got a ton
  of ugly selected elements when I really just wanted the lowest one...

  Is there any way I can restrict it?

  Thanks,

  John


[jQuery] Re: $.post using dynamic arrays

2008-09-16 Thread Anthony

To those who read this:

I got my answer.  I was setting up an assoc. array with [ ]... in
Javascript, this is not how it is done.

/-- CODE --/
function http(verb, url, callback, paramstr)
{
params = { };
var urlparts = url.split('?');
paramstr += '' + urlparts[1];

var stuff = paramstr.split('');
for (var i in stuff) {
temp_array = stuff[i].split('=');
params[temp_array[0]] = temp_array[1];
}
$.post(urlparts[0], params, callback, json);
}
/-- END CODE --/

This works just as I expect it to.  And I have my dynamics I was
after.  I hope that this works for those who need it.


[jQuery] Re: $.post using dynamic arrays

2008-09-16 Thread ricardobeat

Just pass your array object:

$.post(/index.php,{run: url, arr : yourarray },

On Sep 16, 1:58 pm, Anthony [EMAIL PROTECTED] wrote:
 This may be quite simple for many, but I am stuck trying to make a
 dynamic $.post() where the request (post) variables passed are fed
 from a dynamicly changing array.

 /-- CODE --/

 // just above this is a function that takes a url string and parses
 out the variables and store them in an assoc. array.  This info will
 be used by the $.post().

 url = resources/java/community_rpc.php;
 $.post(
      /index.php,
      { run: url, **THIS IS WHERE I WANT TO DO MY DYNAMIC ARRAY
 PASSING*** },
      function(debug){
                 alert(dump(debug));
                 *THIS IS WHERE THE CALLBACK IS RUN*
                 },
      json
 );
 /-- END CODE --/

 I have tried different things, but each time I get an error that
 things aren't defined, or that [] is not permitted ... I am relatively
 new to JQuery, so I probably am missing a very important step.  What I
 would like to get working would look like this:

 { run:url, dynamic1: value1, dynamic2:value2 ... dynamicN: valueN }

 Thanks
     Anthony


[jQuery] [treeview] toggling a node from js

2008-09-16 Thread pihentagy

Hi!

I'd like to expand some branches in a treeview. (It is basically a
collapsed tree, with some brances opened).
Can I do that from javascript? If I simply toggle the visibility, then
the expander icon will be screwed up.

thanks
Gergo


[jQuery] Re: borders work fine with all browsers except IE7

2008-09-16 Thread ricardobeat

Impossible to help without seeing some code. I don't see any magical
jQuery gurus around.

On Sep 16, 12:01 pm, Namlet [EMAIL PROTECTED] wrote:
 I have a site with several borders that are part of jQuery commands.
 One has rounded corners, others don't.  IE7 doesn't render ANY of
 these borders.  There are two divs that are not touched by jQuery, and
 their borders work fine.  Everything that has a jQuery click event, or
 rounded corners has no border at all.  Any ideas?


[jQuery] jQuery.getJSON response not working with IE (works perfectly in firefox,safari...)

2008-09-16 Thread yabhi

Below is a simple   jQuery.getJSON  call for fetching json data
through jQuery but issue i am facing is that below code works
perfectly fine in firefox,safari but breaks in IE-7.
I have an alert in the call back function for json response which
works in firefox but in IE-7 it does not give any alert.Neither does
it gives any js error.
Seems control isn't coming back to the call back function.
Any help would be highly appreciable, i am using jquery for the first
time and really found it great except this issue .Thanks in advance.
-yabhi


 filter_results : function() {

// find the active filters
  params = {}
  var self = this;

   //Next four lines simply populate variables i need to send alng
with request which should not be an issue
   this.all_filters.keep(function(jelt){ return
jelt.elt.checked }).each(function(){
  var f = this;
  f.enable();
  params[ f.jelt.attr('group') ] = f.jelt.attr('value');
})

// Ajax-request
  var url_json=http://abc.com/im/output_json.php;;
  jQuery.getJSON( url_json, params, function(json){
  alert(json.data);
});
  },






[jQuery] Re: Bind events on DOM elements inserted from other frame

2008-09-16 Thread ricardobeat

You need to understand that a frame is another 'window' instance, it
doesn't have the same jQuery object as the parent window unless you
tell it to. So the '$' object you use in firebug console is always the
one from the parent window.

If i'm not mistaken you can acess frame content with the parent
window's jQuery object using $('.classinsidetheframe',
frames['name'].document).css();

On Sep 16, 1:48 pm, hubbs [EMAIL PROTECTED] wrote:
 Ok Brandon,

 I found this in another post:

 var doc = $('#testframe')[0].contentWindow.document;
 $(doc.body).append('spantest/span');

 This seems like it would help, but I am not sure how to use this,
 along with what you posted to get it working correctly.  Somehow
 sending the GET within the context of the contentWindow is confusing
 me, and I just can't get it working.

 On Sep 15, 9:18 am, Brandon Aaron [EMAIL PROTECTED] wrote:

  To see what I mean run this in Firebug:
  $('iframe')[0].contentWindow.$ = $;

  Then click on the link in the iframe and it will behave as you expect.

  --
  Brandon Aaron

  On Mon, Sep 15, 2008 at 9:13 AM, Brandon Aaron [EMAIL PROTECTED]wrote:

   This would work if you used the frames parent instance of jQuery. 
   LiveQuery
   works by monitoring the DOM methods within jQuery. Since within the frame
   you are using a new instance of jQuery, LiveQuery will not be monitoring 
   its
   DOM methods.
   --
   Brandon Aaron

   On Sun, Sep 14, 2008 at 11:04 PM, hubbs [EMAIL PROTECTED] wrote:

   I can confirm that using event delegation will fix this problem.  I
   guess that it is just a problem with the LiveQuery plugin.  Brandon,
   if you are where around here, could you comment on this?

   Thanks.

   On Sep 14, 2:29 pm, hubbs [EMAIL PROTECTED] wrote:
I have a working example of this, and would really like help
understanding why bind or livequery does not bind events to DOM
elements that are inserted from an iframe.

   http://web2.puc.edu/PUC/files/bind.html

Clicking the insert from frame link will append links to the parent
frame, which won't pick up the click event.  But, clicking the insert
from body link will append links within the same frame and will
correctly have the click events bound.

Why is this happening?

On Sep 12, 9:02 pm, hubbs [EMAIL PROTECTED] wrote:

 I have been experiencing strangeness with trying tobindevents to DOM
 elements that have been inserted from a different frame using .get().
 For some reason the elements don't be binded with the events if they
 are inserted from other frame.  In testing, if I try the same
   thingwithinthe SAME frame the the events get binded correctly.

 Am I missing something here?  Is this a limitation of jQuery?


[jQuery] Re: IE slideDown bad attitude!

2008-09-16 Thread JPWilson

I believe this is an error with IE7 -- try giving the div's this
style: min-height: 1%

You might also try googling IE7 hasLayout for more info

On Sep 15, 11:25 pm, JFRanger [EMAIL PROTECTED] wrote:
 Hello World!

 Can some one can tell me WHY the content of my div's disappear (IE
 ONLY) at the end of the slideDown/slideUp functions.

 See it in action:http://dev.residencia.ca/?site=projectadd(click on
 the blue H3's to expand and see the effect)

 I have no padding/margin in the main div as explained 
 herehttp://jqueryfordesigners.com/animation-jump-quick-tip/

 Every thing is 100% nice with FF / SAFARI / CHROME

 The js code;

  function AccordeonProjectAdd() {
   $('#menuProjectAdd div.ui-accordion-content').hide();
   $('#menuProjectAdd div.ui-accordion-
 content:first').slideDown({duration: 2000, easing:'easeOutBack'} );
   $('#menuProjectAdd h3').click(
     function() {
       var checkElement = $(this).next('.ui-accordion-content');
        if((checkElement.is('div'))  (checkElement.is(':visible'))) {
                  return false;
         }
       if((checkElement.is('div'))  (!checkElement.is(':visible'))) {
         $('#menuProjectAdd div.ui-accordion-
 content:visible').slideUp('slow');
         checkElement.slideDown({duration: 1000,
 easing:'easeOutBack'});
                 $('#menuProjectAdd 
 h3').removeClass('ui-accordion-header-over');
                 $(this).addClass('ui-accordion-header-over');

         return false;
         } else {
                  return false
                   }
       }
     );
   }


[jQuery] Re: IE slideDown bad attitude!

2008-09-16 Thread JFRanger

Jesus... I'll be damn!

Your are right JohnieKarr, It works great in IE6 but not in IE7... can
you believe that!

What is my option to solve my disappearing problem only under IE7?

Call Bill Gates? lol

Any IE7_css_javascript pro's out there?: 
http://dev.residencia.ca/?site=projectadd



[jQuery] Re: serialize does not send the value of the submit button

2008-09-16 Thread Mike Alsup

 I have set up an example with ajaxForm and have it working fine with
 json. However, is there something specifically on the server side
 (php) I should do if I am wanting to pass html back?  I can't just use
 a bunch of echo lines can I? I don't get anything back when I do
 that.  I have to build a response into a variable and send that
 (careful not to have any  in there) back as jason.

 I can't seem to reproduce the server php code needed to reply back to
 the sample at :http://malsup.com/jquery/form/#code-samples

There is nothing special you need to do.  If your server returns text,
or html, then the client should be able to process that just fine.
And yes, you can just use php echos.  If you're still having trouble
then post a link to your page and we can help you work through it.

Mike



[jQuery] Re: How to serialize an Object to JSON String without making it POST like?

2008-09-16 Thread Mike Alsup

 When I use this function to create a JSON object:

 var formObject = $(:input).serialize();

 and I print it, I get name=valuename=value...  This isn't proper
 JSON string and the .NET webservice I'm sending it to barfs.

 How can I make it stay in the proper format, i.e.

 {'fname':'dave', 'lname':'ward'}

 Thanks!


jQuery's serialize method does not create JSON strings.  It creates
URL-encoded strings, as you discovered.


[jQuery] Resolve Mootools Conflict

2008-09-16 Thread MauiMan2

Just wondering how I can resolve the jQuery/mootools conflict on:
http://www.tccnotary.com/contractorform.php

I have tried moving around the jQuery.noConflict(); script to
different spots within the code but to no avail.


[jQuery] finding the state of slideToggle

2008-09-16 Thread Michael

I have a slideToggle functioning just fine on my page:

http://www.viktorwithak.com/Test/nav/

But I'm trying to get it to set a cookie that remembers what is closed
and what is open. So, step one, I'm trying determine (on click) what
the state of slideToggle is. Here is my code so far...

function initMenu() {
$('#groups ul').hide();
$('#groups li a').click(
function() {
$(this).next().slideToggle('normal');
var id = $(this).attr('id');
if ($(this).is(:hidden)) {
var state = closed;
} else {
var state = open;
}
alert(id + ' is ' + state);
return false;
}
);
}

...but everytime I click, I get the message slide_toggle_# is open.
Can you please take a look at my if statement and let me know how to
determine the slide_toggle state? Once I get that working, I should be
able to figure out myself how to save the state for every ID to the
cookie. Thanks!


[jQuery] Re: jQuery and setTimeout

2008-09-16 Thread Mike Alsup

 How can I make the element (div with class=request), fade out after
 loading page and waiting 5 seconds, basically:

 1) load the page
 2) wait 5 seconds
 3) fade out the element

 Here's what I have:

 jQuery(document).ready
 (
         function()
         {
                 jQuery('div.request').fadeOut(5000);
         }
 );

Try this:

$(document).ready(function() {
setTimeout(function() {
$('div.request').fadeOut();
}, 5000);
});




[jQuery] Re: ajax not working on new form added to a page after an ajax operation

2008-09-16 Thread Mike Alsup

 Hi. I have a calendar which lists events. After each event I have a
 delete form. When someone clicks the submit, I use ajaxform to
 return new html that replaces the entire day's list of events,
 including a new delete form for each event.  My problem is, the new
 forms do not seem to be ajaxed. When pressed, those newly replaced
 items just go straight to an old fashioned POST, not ajax.  When I
 refresh the page manually, they work.

 Do I have to do something to refresh the things in $
 (document).ready() ?
 Thanks,
 Jamie


Give this a read:

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



[jQuery] Re: Checking if input is a number.

2008-09-16 Thread africanshox

thanks so much your a star...i have much to learn... and off i go
to do it!!!

On Sep 16, 6:41 pm, MorningZ [EMAIL PROTECTED] wrote:
 Here is some working code

 http://paste.pocoo.org/show/85443/

 and just to note on your code, you have:

 alert(is a number)

 *after* the return TestValue line... that would never ever fire


[jQuery] Re: tablesorter (highlighting columns by appling td class=sorted )

2008-09-16 Thread aquaone
When you sort it applies a class to the th of either headerSortUp or
HeaderSortDown I believe. You should be able to do something using the
triggers (http://tablesorter.com/docs/example-triggers.html) to determine
which headers have either of those classes, then add that class to equally
positioned tds in each tr. It's a hack but it would work...

stephen

On Tue, Sep 16, 2008 at 11:33 AM, chovy [EMAIL PROTECTED] wrote:


 Is there a way to apply a class to the table cells of the sorted
 column?

 I want to have the sorted column to have a class=sorted on each of
 it's table data cells.



[jQuery] jquery not executing

2008-09-16 Thread Ben Nevile

Howdy pardners,

I run a busy Facebook app.  Recently I redesigned some of the UI so
that it relies on javascript and jquery. These UI components are
loaded in iframes.

Examining the logs, it's clear that about 15% of my users are unable
to use these new interfaces. I am tearing my hair out trying to figure
out the problem. Specifically, $.ajax calls don't seem to be
executing.

I have tested every browser, and I'm unable to reproduce the problem.
(Yeah, 15% is about right for IE6, but 1. IE6 seems to work just fine,
and 2. Gglytics tells me that only 12.7% of my users are using IE6.)

Is it possible that 15% of the people out there have javascript turned
off?  Any other ideas or gotchas I should check?


Ben


[jQuery] Re: Css Class - Parameter

2008-09-16 Thread shapper

Please, anyone?

Thank You,
Miguel

On Sep 15, 3:55 pm, shapper [EMAIL PROTECTED] wrote:
 Hello,

 I am using the following DatePicker 
 plugin:http://www.kelvinluck.com/assets/jquery/datePicker/v2/jquery.datePick...

 Most CSSClasses, for example jCalendar, are built into the plugin. I
 need to make that parameters.

 Could someone, please, give me an example with the jCalendar css
 class, of how to make it a plugin's parameter.

 I have been trying a few changes but was never able to make this work.

 Thank You,
 Miguel


[jQuery] Re: jquery not executing

2008-09-16 Thread Ariel Flesler

Facebook doesn't support JS, but FBJS.
The DOM properties/methods are completely different and I'm not sure
you can do certain things, like creating ActiveXObject's.

I'm not sure whether jQuery can survive in such an environment, on
every supported browser, all the time (it changes every 2 weeks).

Now that I don't do js for facebook apps anymore, I'm 300% happier :D

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

On Sep 16, 7:18 pm, Ben Nevile [EMAIL PROTECTED] wrote:
 Howdy pardners,

 I run a busy Facebook app.  Recently I redesigned some of the UI so
 that it relies on javascript and jquery. These UI components are
 loaded in iframes.

 Examining the logs, it's clear that about 15% of my users are unable
 to use these new interfaces. I am tearing my hair out trying to figure
 out the problem. Specifically, $.ajax calls don't seem to be
 executing.

 I have tested every browser, and I'm unable to reproduce the problem.
 (Yeah, 15% is about right for IE6, but 1. IE6 seems to work just fine,
 and 2. Gglytics tells me that only 12.7% of my users are using IE6.)

 Is it possible that 15% of the people out there have javascript turned
 off?  Any other ideas or gotchas I should check?

 Ben


[jQuery] Re: jquery not executing

2008-09-16 Thread Ben Nevile

here's a link to the running code. thanks in advance!

http://65.74.151.7/fb/sbfootball/entries/js_entry/801156


[jQuery] Re: Docs server weirdness, almost looks like defacing

2008-09-16 Thread Karl Swedberg

Hi Bradley,

Looks like that image is returning a 404.

--Karl


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




On Sep 16, 2008, at 12:43 PM, Bradley Sepos wrote:



http://bradleysepos.com/dropbox/jquery-docs-wierd.png

Notice the title, heading text and the layout issues. Looks like 1/2
an error page, 1/2 the actual page. Anyone working on the server right
now?




[jQuery] Re: jquery not executing

2008-09-16 Thread Ben Nevile

(Sorry if this is a double post.)

Hi Ariel - thanks for your response.  I know about JS vs FBJS, I guess
I should have made that clear in my first message.  I am doing all my
jQuery stuff in iframes, so it ought to run normally.

Ben




On Sep 16, 3:48 pm, Ariel Flesler [EMAIL PROTECTED] wrote:
 Facebook doesn't support JS, but FBJS.
 The DOM properties/methods are completely different and I'm not sure
 you can do certain things, like creating ActiveXObject's.

 I'm not sure whether jQuery can survive in such an environment, on
 every supported browser, all the time (it changes every 2 weeks).

 Now that I don't do js for facebook apps anymore, I'm 300% happier :D

 --
 Ariel Fleslerhttp://flesler.blogspot.com/

 On Sep 16, 7:18 pm, Ben Nevile [EMAIL PROTECTED] wrote:

  Howdy pardners,

  I run a busy Facebook app.  Recently I redesigned some of the UI so
  that it relies on javascript and jquery. These UI components are
  loaded in iframes.

  Examining the logs, it's clear that about 15% of my users are unable
  to use these new interfaces. I am tearing my hair out trying to figure
  out the problem. Specifically, $.ajax calls don't seem to be
  executing.

  I have tested every browser, and I'm unable to reproduce the problem.
  (Yeah, 15% is about right for IE6, but 1. IE6 seems to work just fine,
  and 2. Gglytics tells me that only 12.7% of my users are using IE6.)

  Is it possible that 15% of the people out there have javascript turned
  off?  Any other ideas or gotchas I should check?

  Ben


[jQuery] Re: jquery not executing

2008-09-16 Thread Ben Nevile

Hi Ariel - thanks for your response.  In fact I knew that already
about FBJS.  I should have mentioned that all of the jQuery stuff is
happening in its own iframe.

Ben



On Sep 16, 3:48 pm, Ariel Flesler [EMAIL PROTECTED] wrote:
 Facebook doesn't support JS, but FBJS.
 The DOM properties/methods are completely different and I'm not sure
 you can do certain things, like creating ActiveXObject's.

 I'm not sure whether jQuery can survive in such an environment, on
 every supported browser, all the time (it changes every 2 weeks).

 Now that I don't do js for facebook apps anymore, I'm 300% happier :D

 --
 Ariel Fleslerhttp://flesler.blogspot.com/

 On Sep 16, 7:18 pm, Ben Nevile [EMAIL PROTECTED] wrote:

  Howdy pardners,

  I run a busy Facebook app.  Recently I redesigned some of the UI so
  that it relies on javascript and jquery. These UI components are
  loaded in iframes.

  Examining the logs, it's clear that about 15% of my users are unable
  to use these new interfaces. I am tearing my hair out trying to figure
  out the problem. Specifically, $.ajax calls don't seem to be
  executing.

  I have tested every browser, and I'm unable to reproduce the problem.
  (Yeah, 15% is about right for IE6, but 1. IE6 seems to work just fine,
  and 2. Gglytics tells me that only 12.7% of my users are using IE6.)

  Is it possible that 15% of the people out there have javascript turned
  off?  Any other ideas or gotchas I should check?

  Ben


[jQuery] Re: Hover on all elements: $(*).hover(...)

2008-09-16 Thread [EMAIL PROTECTED]

$('*').hover( function(event){
$(this).addClass('selected');
event.stopPropagation();
},
function(event){
$(this).removeClass('selected');
event.stopPropagation();
});

On Sep 16, 10:17 am, John Boxall [EMAIL PROTECTED] wrote:
 Hi Balazs,

 Thanks for the reply - looking at your suggestion, my idea was to
 apply it to the code like this:

 $(function() {
         $(*).hover(
            function(){

                 // If the element has more than one child stop
 propagating.
                 if ($(this).children().length()  0) {
                     return False
                 }

                 $(this).addClass('selected');
             },
             function(){
                 $(this).removeClass('selected');
             }
         );

 }

 This is _close_ to what I want, but what I'd really like is to grab
 DOM element you are hovering over with the minimum number of children
 - not necessarily zero.

 It's my understanding that with the above, if you hovered over a p
 with a strong inside you couldn't select the p because it would
 have a child!

 Thanks,

 John

 Should only return true if the selected $(this) has no children.
 This is _close_ to what I want - but what I'd really like is to grab
 the element

 On Sep 14, 4:10 am, Balazs Endresz [EMAIL PROTECTED] wrote:

  Hey John,

  I think this will do that:

  $('body').find('*').filter(function(){
    return !$(this).children().length;})

  .add('p').not('p *') //without this, if a paragraph contains tags 
  thehoverwon't be applied to the most of the text

  On Sep 12, 9:29 pm, John Boxall [EMAIL PROTECTED] wrote:

   Heyo jQuery hackers,

   I'm putting together a little script that adds a class selected to
   an element when youhoverover it.
   When you stop hovering the class selected class is removed.

   I would like the class only to be apply to the lowest element in the
   DOM.

   For example say I was hovering over a p deep inside a document - I
   would like to only add the class selected to that p tag, not the
   div, body and html tags surrounding it.

   So far my thinking has been to use something like this:

   $(function() {
           $(*).hover(
              function(){
                   $(this).addClass('selected');
               },
               function(){
                   $(this).removeClass('selected');
               }
           );

   }

   Which adds the selected class to any element Ihoverover fine. It
   also removes it.

   The problem is thehoveris firing all the way up the chain and
   hitting all elements from the lowest to the highest so I've got a ton
   of ugly selected elements when I really just wanted the lowest one...

   Is there any way I can restrict it?

   Thanks,

   John


[jQuery] Re: jQuery and setTimeout

2008-09-16 Thread zoltalar

Thanks Mike, you got me on the right path, your code needed a small
tweak:

jQuery(document).ready
(
function()
{
setTimeout
(
function()
{
jQuery('div.request').fadeOut(2000);
},
5000
);
}
);

Thanks again

On Sep 16, 2:32 pm, Mike Alsup [EMAIL PROTECTED] wrote:
  How can I make the element (div with class=request), fade out after
  loading page and waiting 5 seconds, basically:

  1) load the page
  2) wait 5 seconds
  3) fade out the element

  Here's what I have:

  jQuery(document).ready
  (
          function()
          {
                  jQuery('div.request').fadeOut(5000);
          }
  );

 Try this:

 $(document).ready(function() {
     setTimeout(function() {
         $('div.request').fadeOut();
     }, 5000);

 });


[jQuery] jQuery Tutorials and Tips: LearningjQuery.com Offers Awesome Articles

2008-09-16 Thread Rey Bango


One of the best sites for getting jQuery tutorials, tips and advice is 
from Learning jQuery (http://www.learningjquery.com/).


The site is run by jQuery Project Team member Karl Swedberg who has 
taken his experiences in development and jQuery training and broken them 
down into very easy to read and thorough posts.


Learning jQuery (http://www.learningjquery.com/) is definitely worth the 
visit if you're interested in becoming a top-notch expert in jQuery.


Rey
jQuery Team


[jQuery] Re: Bind events on DOM elements inserted from other frame

2008-09-16 Thread hubbs

Thanks Ricardo.

But what if I wanted to access the parent document from WITHIN the
iframe?

On Sep 16, 12:27 pm, ricardobeat [EMAIL PROTECTED] wrote:
 You need to understand that a frame is another 'window' instance, it
 doesn't have the same jQuery object as the parent window unless you
 tell it to. So the '$' object you use in firebug console is always the
 one from the parent window.

 If i'm not mistaken you can acess frame content with the parent
 window's jQuery object using $('.classinsidetheframe',
 frames['name'].document).css();

 On Sep 16, 1:48 pm, hubbs [EMAIL PROTECTED] wrote:

  Ok Brandon,

  I found this in another post:

  var doc = $('#testframe')[0].contentWindow.document;
  $(doc.body).append('spantest/span');

  This seems like it would help, but I am not sure how to use this,
  along with what you posted to get it working correctly.  Somehow
  sending the GET within the context of the contentWindow is confusing
  me, and I just can't get it working.

  On Sep 15, 9:18 am, Brandon Aaron [EMAIL PROTECTED] wrote:

   To see what I mean run this in Firebug:
   $('iframe')[0].contentWindow.$ = $;

   Then click on the link in the iframe and it will behave as you expect.

   --
   Brandon Aaron

   On Mon, Sep 15, 2008 at 9:13 AM, Brandon Aaron [EMAIL PROTECTED]wrote:

This would work if you used the frames parent instance of jQuery. 
LiveQuery
works by monitoring the DOM methods within jQuery. Since within the 
frame
you are using a new instance of jQuery, LiveQuery will not be 
monitoring its
DOM methods.
--
Brandon Aaron

On Sun, Sep 14, 2008 at 11:04 PM, hubbs [EMAIL PROTECTED] wrote:

I can confirm that using event delegation will fix this problem.  I
guess that it is just a problem with the LiveQuery plugin.  Brandon,
if you are where around here, could you comment on this?

Thanks.

On Sep 14, 2:29 pm, hubbs [EMAIL PROTECTED] wrote:
 I have a working example of this, and would really like help
 understanding why bind or livequery does not bind events to DOM
 elements that are inserted from an iframe.

http://web2.puc.edu/PUC/files/bind.html

 Clicking the insert from frame link will append links to the parent
 frame, which won't pick up the click event.  But, clicking the 
 insert
 from body link will append links within the same frame and will
 correctly have the click events bound.

 Why is this happening?

 On Sep 12, 9:02 pm, hubbs [EMAIL PROTECTED] wrote:

  I have been experiencing strangeness with trying tobindevents to 
  DOM
  elements that have been inserted from a different frame using 
  .get().
  For some reason the elements don't be binded with the events if 
  they
  are inserted from other frame.  In testing, if I try the same
thingwithinthe SAME frame the the events get binded correctly.

  Am I missing something here?  Is this a limitation of jQuery?


[jQuery] Re: jquery/livequery assign behaviour to element by class

2008-09-16 Thread onmountain

Can I use livequery with ajax?  For instance, I am adding and deleting
elements of a certain class that have .post associated with them
at .ready.

For instance, if my last .post returns new html that create more items
with delete forms, how should I turn the code in the .ready below to
work?
$('.deleteform').submit(function() {
var gthis = this;
var delformData = $(this).serialize();
$.post('eatchoices.php', delformData, delprocessData);
function delprocessData(data) {
$(gthis).parent().html(data);  // get the parent of
the form so replace just below the date
}  // end of delformData
return false;
}); // end of submit delete form


On Sep 15, 4:11 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 Typically with tables you want to do event delegation for performance
 reasons. However, this is how you'd do it with LiveQuery.
 $(document).ready(function() {
     $('table tbody td.hasContent')
         .livequery('mouseenter', showBox)
         .livequery('mouseleave', hideBox)
         .livequery('mousemove', position)
         .livequery('click', showDetail);

 });

 You could also do a function based livequery like this:

 $(document).ready(function() {
     $('table tbody td.hasContent')
         .livequery(function() {
             $(this)
                 .bind('mouseenter', showBox)
                 .bind('mouseleave', hideBox)
                 .bind('mousemove', position)
                 .bind('click', showDetail);
         });

 });

 The mouseenter and mouseleave events are what the hover helper method use
 behind the scenes.

 --
 Brandon Aaron

 On Mon, Sep 15, 2008 at 11:49 AM, jwynne [EMAIL PROTECTED] wrote:

  Currently I am using $(document).ready to bind some behaviours to elements
  in
  the DOM based on a class name (using jquery's .filter) - This works great
  on
  the initial load of the page however these bindings get all screwy when I
  try injecting or editing new elements to the DOM dynamically via AJAX.
  After researching the issue I have been trying to use the livequery plug-in
  but have been unsuccessful so far.

  In $(document).ready I am assigning behaviour to td elements of the class
  hasContent. I am looking to hook them up to livequery listeners so that
  the correct behaviours are assigned when the DOM is updated.

  $(document).ready(function(event) {

         var position = function() {
                 }
         var showBox = function() {
                 }
         var hideBox = function() {
                 }
         var showDetail = function() {
                 }

         //Syntax help below
         $(table tbody td).filter(.hasContent).hover(showBox,
  hideBox).mousemove(position);
         $(table tbody td).filter(.hasContent).click(showDetail);

  });//EOF

  Can anybody help me with the syntax necessary to get livequery to
  bind/unbind the necessary behaviours to the table tds?

  Thanks for the help.
  --
  View this message in context:
 http://www.nabble.com/jquery-livequery-assign-behaviour-to-element-by...
  Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] jqDock's not working when shadowbox changes images

2008-09-16 Thread xdscheetos


Hi,
I've modified the Shadowbox plugin so that I could have mac-like navigation
with my thumbnails. I've incorporated jqDock.
Everything works as expected on the first image from the gallery. But when
the image changes for the second image in the gallery the jqDock plugin's
not working anymore. Here's the bit of code that works on the first show:

if(options.displayCounter  options.counterType == 'thumb' 
options.counterThumbType == 'mac')
{
 $(document).ready(function() {
 
$(#shadowbox_counterthumb).jqDock(options.counterThumbMacConfig);
 });
}

If I'm getting this right, the hook is not there anymore because of the DOM
changes. I've faced this with .aspx pages and I the following solved my
problems:
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(MyHookFunction);

Is there a way to do the same using a plain html page ?

Thanks
-- 
View this message in context: 
http://www.nabble.com/jqDock%27s-not-working-when-shadowbox-changes-images-tp19523691s27240p19523691.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jQuery prototype magic

2008-09-16 Thread Andrei Maxim

Hi all,

I've recently grabbed the latest edition of the Rhino book and I'm
trying to build some small JavaScript libraries in order to get the
hang of coding in JS. I've been also reading lots of blog posts and
I've been looking at the code of several major JS frameworks and
libraries, like jQuery, Prototype and script.aculo.us and I'm trying
to understand why the author wrote that code.

For some reason, I've been growing very fond of the pattern used in
jQuery to create the jQuery object. Here's the code I'm talking about,
taken from v1.2.6:

var jQuery = window.jQuery = window.$ = function( selector, context )
{
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
};

[...]

jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
// Make sure that a selection was provided
selector = selector || document;

// Handle $(DOMElement)
if ( selector.nodeType ) {
this[0] = selector;
this.length = 1;
return this;
}
[...]
};

// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;

When I tried to add my custom object, I had some problems with
accessing the functions I defined inside jQuery.prototype. Only after
a couple of hours I added a line similar to jQuery.fn.init.prototype =
jQuery.fn and then it magically worked.

However, I don't get what's going on.

From what I understood reading JavaScript docs, jQuery.fn =
jQuery.prototype means that we reference jQuery object's prototype
and I'm guessing this is used just to simplify the code (I might be
extremely wrong on this). Also, the defined functions are shared by
each jQuery object.

But why do we need to add jQuery.fn.init.prototype = jQuery.fn for
things to work?

Thanks a lot,
Andrei


[jQuery] Re: jquery/livequery assign behaviour to element by class

2008-09-16 Thread Brandon Aaron
Replace the first line
$('.deleteform').submit(function() {

with this

$('.deleteform').livequery('submit', function() {

--
Brandon Aaron

On Tue, Sep 16, 2008 at 8:30 PM, onmountain [EMAIL PROTECTED] wrote:


 Can I use livequery with ajax?  For instance, I am adding and deleting
 elements of a certain class that have .post associated with them
 at .ready.

 For instance, if my last .post returns new html that create more items
 with delete forms, how should I turn the code in the .ready below to
 work?
$('.deleteform').submit(function() {
var gthis = this;
var delformData = $(this).serialize();
$.post('eatchoices.php', delformData, delprocessData);
function delprocessData(data) {
$(gthis).parent().html(data);  // get the parent of
 the form so replace just below the date
}  // end of delformData
return false;
}); // end of submit delete form


 On Sep 15, 4:11 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
  Typically with tables you want to do event delegation for performance
  reasons. However, this is how you'd do it with LiveQuery.
  $(document).ready(function() {
  $('table tbody td.hasContent')
  .livequery('mouseenter', showBox)
  .livequery('mouseleave', hideBox)
  .livequery('mousemove', position)
  .livequery('click', showDetail);
 
  });
 
  You could also do a function based livequery like this:
 
  $(document).ready(function() {
  $('table tbody td.hasContent')
  .livequery(function() {
  $(this)
  .bind('mouseenter', showBox)
  .bind('mouseleave', hideBox)
  .bind('mousemove', position)
  .bind('click', showDetail);
  });
 
  });
 
  The mouseenter and mouseleave events are what the hover helper method use
  behind the scenes.
 
  --
  Brandon Aaron
 
  On Mon, Sep 15, 2008 at 11:49 AM, jwynne [EMAIL PROTECTED] wrote:
 
   Currently I am using $(document).ready to bind some behaviours to
 elements
   in
   the DOM based on a class name (using jquery's .filter) - This works
 great
   on
   the initial load of the page however these bindings get all screwy when
 I
   try injecting or editing new elements to the DOM dynamically via AJAX.
   After researching the issue I have been trying to use the livequery
 plug-in
   but have been unsuccessful so far.
 
   In $(document).ready I am assigning behaviour to td elements of the
 class
   hasContent. I am looking to hook them up to livequery listeners so
 that
   the correct behaviours are assigned when the DOM is updated.
 
   $(document).ready(function(event) {
 
  var position = function() {
  }
  var showBox = function() {
  }
  var hideBox = function() {
  }
  var showDetail = function() {
  }
 
  //Syntax help below
  $(table tbody td).filter(.hasContent).hover(showBox,
   hideBox).mousemove(position);
  $(table tbody td).filter(.hasContent).click(showDetail);
 
   });//EOF
 
   Can anybody help me with the syntax necessary to get livequery to
   bind/unbind the necessary behaviours to the table tds?
 
   Thanks for the help.
   --
   View this message in context:
  http://www.nabble.com/jquery-livequery-assign-behaviour-to-element-by.
 ..
   Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.



[jQuery] Re: Checking if input is a number.

2008-09-16 Thread RobG


On Sep 17, 12:38 am, africanshox [EMAIL PROTECTED]
wrote:
 i have a serach box that checks for a product code or product keyword.

 I need to find out how i can check if the  input submitted on this
 search box is a number, and if it is, remove any white spaces.

If by search box you mean an input element, then its value is
returned as a string.  Since you really don't care about the numeric
properties of the value, only that it contains just numbers, the
simplest and most efficient method is to use a regular expression.

The following creates a function that returns true if the argument
contains one or more spaces or digits.  If any non-digit or non-space
character is found, it returns false.

  var checkValue = (function() {
var re = /^(\s|\d)+$/;
return function(x) {
  return re.test(x);
}
  })();


 The reason is that product codes coming from a feed have a space in
 them and it is much easier if i sue jquery rather than go through a
 collection fo nearly 20,000 codes.

It is probably quite simple to write a function that creates an index
to the codes and a routine to search it.  It may not be faster than
the above function but it will likely be much more robust if your
codes ever change their format.


--
Rob


[jQuery] input box on change event?

2008-09-16 Thread bombaru

I've got an input box and am displaying a form button on focus... then
hiding the form button on blur.  Ideally, I want to display the form
button on focus, but only hide the button if the original contents of
the input box have not changed (put another way... persist the form
button if the quantity has changed).  Can someone help steer me in the
right direction?  This is for a cart checkout page that I am working
on and will provide users a way to update the quantity of an item in
their cart.  Here's the code I am using:

// flag the document as OK for JS
$('html').removeClass('nojs');

//show Update buttons only as necessary
$('input.qty').each(function()
{
var $qButton = $
(this).siblings('[EMAIL PROTECTED]image]');

$(this).focus(function()
{
$qButton.fadeIn(200);
});

$(this).blur(function()
{
$qButton.fadeOut(200);
});
});

As you can probably tell, this approach is less than ideal and
provides the user no time to click the update button after a change
has been made.  I can increase the fadeOut duration, but that still
blows.

Thanks for any help you might be able to provide me.


[jQuery] Re: finding the state of slideToggle

2008-09-16 Thread Karl Swedberg

Hi Michael,

You're doing the slideToggle() on $(this).next(), but checking the  
visibility state of $(this). I imagine that the link you're clicking  
is always visible. You should probably do a check for $ 
(this).next().is(':hidden')




--Karl


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




On Sep 16, 2008, at 5:24 PM, Michael wrote:



I have a slideToggle functioning just fine on my page:

http://www.viktorwithak.com/Test/nav/

But I'm trying to get it to set a cookie that remembers what is closed
and what is open. So, step one, I'm trying determine (on click) what
the state of slideToggle is. Here is my code so far...

function initMenu() {
$('#groups ul').hide();
$('#groups li a').click(
function() {
$(this).next().slideToggle('normal');
var id = $(this).attr('id');
if ($(this).is(:hidden)) {
var state = closed;
} else {
var state = open;
}
alert(id + ' is ' + state);
return false;
}
);
}

...but everytime I click, I get the message slide_toggle_# is open.
Can you please take a look at my if statement and let me know how to
determine the slide_toggle state? Once I get that working, I should be
able to figure out myself how to save the state for every ID to the
cookie. Thanks!




[jQuery] Re: input box on change event?

2008-09-16 Thread Alex Weber

I'm not sure I understand exactly what you mean but I can answer the
question in the title of your thread :)

instead of using the 'blur' event use the 'change' jquery event
(analogous to onChange() traditional js)

http://docs.jquery.com/Events/change

-Alex

On Sep 16, 11:08 pm, bombaru [EMAIL PROTECTED] wrote:
 I've got an input box and am displaying a form button on focus... then
 hiding the form button on blur.  Ideally, I want to display the form
 button on focus, but only hide the button if the original contents of
 the input box have not changed (put another way... persist the form
 button if the quantity has changed).  Can someone help steer me in the
 right direction?  This is for a cart checkout page that I am working
 on and will provide users a way to update the quantity of an item in
 their cart.  Here's the code I am using:

                 // flag the document as OK for JS
                 $('html').removeClass('nojs');

                 //show Update buttons only as necessary
                 $('input.qty').each(function()
                 {
                         var $qButton = $
 (this).siblings('[EMAIL PROTECTED]image]');

                         $(this).focus(function()
                         {
                                 $qButton.fadeIn(200);
                         });

                         $(this).blur(function()
                         {
                                 $qButton.fadeOut(200);
                         });
                 });

 As you can probably tell, this approach is less than ideal and
 provides the user no time to click the update button after a change
 has been made.  I can increase the fadeOut duration, but that still
 blows.

 Thanks for any help you might be able to provide me.


[jQuery] Re: jQuery prototype magic

2008-09-16 Thread Alex Weber

Just a bump here since I'm curious too! :)
I just kind if take things like jQuery for granted and use and abuse
them without really knowing or caring how it does what it does, so
long as it works :)
(I guess that's a textbook OOP abstraction definition lol)
Anyway, wanna know the answer too if anyone has it...

-Alex

On Sep 16, 9:56 pm, Andrei Maxim [EMAIL PROTECTED] wrote:
 Hi all,

 I've recently grabbed the latest edition of the Rhino book and I'm
 trying to build some small JavaScript libraries in order to get the
 hang of coding in JS. I've been also reading lots of blog posts and
 I've been looking at the code of several major JS frameworks and
 libraries, like jQuery, Prototype and script.aculo.us and I'm trying
 to understand why the author wrote that code.

 For some reason, I've been growing very fond of the pattern used in
 jQuery to create the jQuery object. Here's the code I'm talking about,
 taken from v1.2.6:

 var jQuery = window.jQuery = window.$ = function( selector, context )
 {
         // The jQuery object is actually just the init constructor 'enhanced'
         return new jQuery.fn.init( selector, context );

 };

 [...]

 jQuery.fn = jQuery.prototype = {
         init: function( selector, context ) {
                 // Make sure that a selection was provided
                 selector = selector || document;

                 // Handle $(DOMElement)
                 if ( selector.nodeType ) {
                         this[0] = selector;
                         this.length = 1;
                         return this;
                 }
         [...]

 };

 // Give the init function the jQuery prototype for later instantiation
 jQuery.fn.init.prototype = jQuery.fn;

 When I tried to add my custom object, I had some problems with
 accessing the functions I defined inside jQuery.prototype. Only after
 a couple of hours I added a line similar to jQuery.fn.init.prototype =
 jQuery.fn and then it magically worked.

 However, I don't get what's going on.

 From what I understood reading JavaScript docs, jQuery.fn =
 jQuery.prototype means that we reference jQuery object's prototype
 and I'm guessing this is used just to simplify the code (I might be
 extremely wrong on this). Also, the defined functions are shared by
 each jQuery object.

 But why do we need to add jQuery.fn.init.prototype = jQuery.fn for
 things to work?

 Thanks a lot,
 Andrei


[jQuery] Moving a opened dialog on top the windows stack

2008-09-16 Thread Olive

Hello,

I'm just wondering if there is any undocumented method (or trick),
like dialog.data(), to raise (and maybe focus) an already opened
dialog which is hidden below other dialog(s) ?

I could mimic that by destroying the dialog, creating and opening it
again but it is not very clean.

Thanks,

Olivier.