[jQuery] Re: "on click" doesn't work!

2008-11-05 Thread Miri Sherman
Yeah
I had to change the "onclick" function to "onchange" and everything works
just wonderful!!!
Thanks the both of you for all your help!! :)
Miri.

2008/11/5 MorningZ <[EMAIL PROTECTED]>

>
> Juts like Andy says
>
> http://pastebin.com/m4cbd67f
>
> btw, you wanted to use "change", not "click"   (as my code shows and
> works)
>
>
>
> On Nov 5, 12:49 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> > It might help if you moved the jQuery code out of the HTML. It would help
> > you focus on each seperately which could assist you in finding the
> problem.
> > Plus, if you're just going to use jQuery inline, then why bother with
> using
> > it at all?
> >
> > andy
> >
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> >
> > Behalf Of Miri
> > Sent: Wednesday, November 05, 2008 10:53 AM
> > To: jQuery (English)
> > Subject: [jQuery] "on click" doesn't work!
> >
> > Hi everyone!
> > I've been trying to find the problem in the code below, but I have no
> idea
> > what it is.
> > The problem is with the "on click" option - it just doesn't work..
> > Can anyone please help me?!?!
> > Thanks very much in advance..
> > Miri.
> >
> > The code:
> > #
> > 
> > #
> >   Do you want to subscribe to our newsletter? #
> >
> > #
> >   
> > #
> >  > type="radio" name="subscribe" value="1" /> #
> > Yes, I want to subscribe #
> > 
> > #
> >
> > #
> >  > type="radio" name="subscribe" value="0" /> #
> > No, thanks
> > #
> > 
> > #
> >
> > #
> > 
> > #
> >   Email Address: 
> > #
> >#
> > 
> > #
> >   
> > #
> > 
>


[jQuery] Re: How to solve this

2008-11-05 Thread Johny


Nobody knows the answer to my question ? :-(


[jQuery] Re: Google Charts

2008-11-05 Thread moscorp

hello Choan,

thanks for help !
in php,
80,30,50
in js
var valueArray = $.trim($('#mpngicnt').text()).split(',');
--
after that, valueArray return   80 30 50
--
still can't pass the array into gchart
series: [ $.gchart.series(valueArray, 'red')]

please comment !


On 11月5日, 午後9:52, Choan Gálvez <[EMAIL PROTECTED]> wrote:
> On Nov 5, 2008, at 5:59 AM, moscorp wrote:
>
>
>
> > gchart can't recognize series data in barVert...
>
> > can't work in
> > var valueArray = $('#mpngicnt').text(); //80,30,50
> > series: [ $.gchart.series([ valueArray ], 'red')],
>
> > but it works in
> > series: [ $.gchart.series([ 80,30,50 ], 'red')],
>
> > how can i solve it !
>
> `$('selector').text()` returns a string. From what I read in your  
> working code, you need to pass anarray.
>
>  var valueArray = $.trim($('#mpngicnt').text()).split(','); //  
> [ 80, 30, 50 ]
>  // I assume there is some code in the middle
>  series: [ $.gchart.series(valueArray, 'red')]
>
> Now, back to jQuery related posts.
> --
> Choan


[jQuery] Re: Survey for pro and non-pre developers

2008-11-05 Thread steviegee

I noticed that the second link was not correct- here's and update Non-
professional developer/hobbyist:  
http://www.surveymonkey.com/s.aspx?sm=qXay_2bP9Ib4zmUAvu2hxbbg_3d_3d


On Nov 5, 4:59 pm, steviegee <[EMAIL PROTECTED]> wrote:
> Hi everyone - I am a researcher in the Visual Studio User Experience
> team - I am undertaking research focused on professional and non-
> professional web developers.
> I'd really appreciate you taking 5 minutes to run through one of the
> survey's:
>
> Professional 
> Developers:http://www.surveymonkey.com/s.aspx?sm=Bn4bKg_2bo49xcfXyWaNQl8g_3d_3d
>
> Non-professional developers/hobbyists: error in link> - new link:  
> http://www.surveymonkey.com/s.aspx?sm=qXay_2bP9Ib4zmUAvu2hxbbg_3d_3d

> Thanks in advance!
>
> Stephen Giff


[jQuery] Re: Bug in IE7 - Complains about Opera bindReady code in jquery

2008-11-05 Thread Jeffrey Kretz

Fair enough.

If you have a test case online, I'd be happy to step through the code in
debug mode.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gregoriusness
Sent: Wednesday, November 05, 2008 7:17 PM
To: jQuery (English)
Subject: [jQuery] Re: Bug in IE7 - Complains about Opera bindReady code in
jquery


IE7 is failing when that code block is not commented out.  Whether or
not IE is trying to execute the code (and the browser detection
failing) i'm not quite sure about... I haven't had the time to look
into it any further, just flagging it as a potential issue.


On Nov 4, 10:25 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> This is a bit confusing.  Is IE7 running that block of code, even though
its
> earmarked for Opera?
>
> Like is the browser detection is failing?
>
> Or is IE7 failing when that code is there even though it never runs it?
> Meaning, the bug went away when you commented out code that is never
> reached?
>
> JK
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Gregoriusness
> Sent: Monday, November 03, 2008 2:31 PM
> To: jQuery (English)
> Subject: [jQuery] Bug in IE7 - Complains about Opera bindReady code in
> jquery
>
> hey all,
>
> I initially posted this on the developer forum, but not sure if that
> was the best place for it so reposting here.
>
> I've got an issue with jQuery in IE7.  It is throwing the following
> error:
>
> Line: 2355
> Error: Object doesn't support this property or method
>
> Looking at jquery source (v1.2.6), on that line is the Opera condition
> for the bindReady() event, ie:
>
>         if ( jQuery.browser.opera )
>                 document.addEventListener( "DOMContentLoaded",
> function () {
>                         if (jQuery.isReady) return;
>                         for (var i = 0; i <
> document.styleSheets.length; i++)
>                                 if (document.styleSheets[i].disabled)
> {
>                                         setTimeout( arguments.callee,
> 0 );
>                                         return;
>                                 }
>                         // and execute any waiting functions
>                         jQuery.ready();
>                 }, false);
>
> If i comment out this block of code, all works fine (even in opera).
>
> is this a known bug?  is there a workaround (besides what i've done)??
>
> thanks heaps
> greg



[jQuery] Re: order of script not right (explained inside)

2008-11-05 Thread Jeffrey Kretz

My guess is it's an absolutely positioned element, which won't respond well
to auto margins.

If this is the case, one option would be to measure the width of the window
at the time of drop-down, calculate and set the css left appropriately.

If it is a static/relatively positioned element, and auto margin isn't
working, I'm not sure what the problem might be.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of FastNOC
Sent: Wednesday, November 05, 2008 9:06 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: order of script not right (explained inside)



OK hopefull this is the last question.

I need this to be smaller. the script takes up the whole width because the
css specifies 100%. So i shortened it to 980, the width of my page. But I
want it centered. it aligns left. text-align:center centeres the text within
the div, not the whole panel, and margin-right:auto;margin-left:auto does
nothing.

Any thought on how to center this?
-- 
View this message in context:
http://www.nabble.com/order-of-script-not-right-%28explained-inside%29-tp203
35896s27240p20355237.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] Re: order of script not right (explained inside)

2008-11-05 Thread FastNOC


OK hopefull this is the last question.

I need this to be smaller. the script takes up the whole width because the
css specifies 100%. So i shortened it to 980, the width of my page. But I
want it centered. it aligns left. text-align:center centeres the text within
the div, not the whole panel, and margin-right:auto;margin-left:auto does
nothing.

Any thought on how to center this?
-- 
View this message in context: 
http://www.nabble.com/order-of-script-not-right-%28explained-inside%29-tp20335896s27240p20355237.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Expert jQuery Hackers Needed

2008-11-05 Thread Pixelstuff

Where do the "hacking" skills come in?  That you need.



On Nov 3, 10:56 am, Syn-UX <[EMAIL PROTECTED]> wrote:
> Hey all, This is a shameless post, but our company, Synacor, is in
> need to hire some expert jQuery hackers. We basically make internet
> portals for ISP's - we need some hackers who can help us do cool stuff
> like making page components for weather, radio, movies, etc. We have a
> great corporate culture and I love my job very much. If you're
> interested in our GUI Developer or GUI Engineer positions, please
> email me at [EMAIL PROTECTED] Thanks! --Mike


[jQuery] Re: Hide/Show in IE 6

2008-11-05 Thread OutOfTouch

Thanks, I will try it.


[jQuery] Re: Bug in IE7 - Complains about Opera bindReady code in jquery

2008-11-05 Thread Gregoriusness

IE7 is failing when that code block is not commented out.  Whether or
not IE is trying to execute the code (and the browser detection
failing) i'm not quite sure about... I haven't had the time to look
into it any further, just flagging it as a potential issue.


On Nov 4, 10:25 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> This is a bit confusing.  Is IE7 running that block of code, even though its
> earmarked for Opera?
>
> Like is the browser detection is failing?
>
> Or is IE7 failing when that code is there even though it never runs it?
> Meaning, the bug went away when you commented out code that is never
> reached?
>
> JK
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Gregoriusness
> Sent: Monday, November 03, 2008 2:31 PM
> To: jQuery (English)
> Subject: [jQuery] Bug in IE7 - Complains about Opera bindReady code in
> jquery
>
> hey all,
>
> I initially posted this on the developer forum, but not sure if that
> was the best place for it so reposting here.
>
> I've got an issue with jQuery in IE7.  It is throwing the following
> error:
>
> Line: 2355
> Error: Object doesn't support this property or method
>
> Looking at jquery source (v1.2.6), on that line is the Opera condition
> for the bindReady() event, ie:
>
>         if ( jQuery.browser.opera )
>                 document.addEventListener( "DOMContentLoaded",
> function () {
>                         if (jQuery.isReady) return;
>                         for (var i = 0; i <
> document.styleSheets.length; i++)
>                                 if (document.styleSheets[i].disabled)
> {
>                                         setTimeout( arguments.callee,
> 0 );
>                                         return;
>                                 }
>                         // and execute any waiting functions
>                         jQuery.ready();
>                 }, false);
>
> If i comment out this block of code, all works fine (even in opera).
>
> is this a known bug?  is there a workaround (besides what i've done)??
>
> thanks heaps
> greg


[jQuery] Re: Slide out sidebars

2008-11-05 Thread Jeffrey Kretz

Try something like this:

div.toolbox{
  position:absolute;
  top:0px;
  right:0px;
  width:220px;
  height:99%;
  border-left:solid 1px #00;
  overflow:hidden
  overflow-x:hidden;
  overflow-y:hidden;
}

Monitor the resize event.

window.lastWidth = $(window).bind('resize',adjustToolbox).width();

function adjustToolbox(e)
{
  var width = $(window).width();
  if (width<1024 && window.lastWidth>=1024)
  {
$('div.toolbox')
.animate({width:6})
  .hover(slideTool,unslideTool);
  }
  else if (width>=1024 && window.lastWidth<1024)
  {
$('div.toolbox')
.animate({width:220})
  .unbind('mouseenter')
  .unbind('mouseleave');
  }
  window.lastWidth = width;
}

function slideTool(e)
{
  $(this).animate({width:220});
}

function unslideTool(e)
{
  $(this).animate({width:6});
}

You can use the blockUI plugin to grey out the screen while the tool is out.

JK


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Taco
Sent: Wednesday, November 05, 2008 3:38 PM
To: jQuery (English)
Subject: [jQuery] Slide out sidebars


I am attempting to design a site with a central liquid area, and two
side areas that provide auxiliary information. When the browser window
is made smaller and the viewport is reduced below 1024 px, I want
these side areas to slide into a minimized position showing different
xhtml files. when they are moused over, I'd like them to slide out to
their original size OVER the main area, and graying out the main area.

How would I get started? I am not a complete newbie at javascript, but
this will be my first experience with jQuery. Can someone point me in
the right direction? I appreciate it.

Ty Underwood



[jQuery] Form Plugin - how to capture a return value?

2008-11-05 Thread Info

Hello,
I am hoping you can point in the right direction. I want to use the
Form Plugin to post to a page which will check for an email address.
That page will have a query which says the email address is found or
not found (email=1 or email=2)

How do I go about using the Form Plugin to check for a return value
and do something if its found Yes or No?

Should I not use the form plugin and go another route???Not a jquery
guru yet of course

Thanks!


[jQuery] Re: 26 october occuring two times: datepicker bug?

2008-11-05 Thread Dave Methvin

Sounds like you ran into this bug:
http://groups.google.com/group/jquery-ui/browse_frm/thread/d4f1fb64735d9bad/637bfdc13982576e


[jQuery] Re: accessing child element without unique id

2008-11-05 Thread FrenchiINLA

var $col = $('#row1 td') will give you a collection of all td under
row1, then you can filter by first, last, or even use ordianal positon
like $col[0] etc.

On Nov 5, 11:59 am, Jared_T <[EMAIL PROTECTED]> wrote:
> I'm trying to access a td text value, as shown in the javascript
> below.  The easiet way to solve this problem would be to give each td
> id value a unique identifier (i.e. td id="row1_col1") Is it possible
> to access the td element of a tr with a unique tr id tag without
> naming each td id uniquely?  I'm new to this, I pasted the code as an
> example of what I'm trying to do.  All the attempts in the javascript
> below failed.
>
> 
> 
>   http://code.jquery.com/jquery-latest.js";>
> 
> 
>
>     
>         
>             1
>             2
>         
>         
>             3
>             4
>         
>     
>
>     
>         str01 = $("#row1 > col1").text();
>         document.write("row1 col1 value is: " + str01 + "
"); >         str02 = $("#row1.col1").text(); >         document.write("row1 col1 value is: " + str02 + "
"); >         //str03 = $("#row1").("#col1").text(); >         //document.write("row1 col1 value is: " + str03 + "
"); >         //str04 = $("#col1").text(("#row1").text()); >         //document.write("row1 col1 value is: " + str04 + "
"); >     > >

[jQuery] Re: Check if remote file exists.

2008-11-05 Thread Jeffrey Kretz

That's pretty interesting -- I never thought of that.

So I imagine an $.ajax({url:'somefile.dat',type:'HEAD',error:do_something}) 
would be enough to check for a 404.

Nifty.
JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Karl 
Rudd
Sent: Wednesday, November 05, 2008 4:33 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Check if remote file exists.


What you want is a "HEAD" request. See the following for details:

http://www.jibbering.com/2002/4/httprequest.html
http://www-128.ibm.com/developerworks/web/library/wa-ajaxintro3/

Karl Rudd

On Thu, Nov 6, 2008 at 5:54 AM, Genu <[EMAIL PROTECTED]> wrote:
>
> Is it possible to use jquery to check of remote file (url) exists or
> not. For example, I have this url:
>
> http://www.myserver.com/media/test.mp3
>
> can I use a jquery http request to see if the url is valid or not?
>
>



[jQuery] Re: Scrolling inside a div with mousemove

2008-11-05 Thread Jeffrey Kretz

Well, you could do something like this (completely untested, sorry).

The hover events bind and unbind the mousemove to prevent resource drain.

$('#thisdiv').hover(startScroll,stopScroll);

function startScroll(e)
{
   var div = $(this).bind('mousemove',scrollThis);
   var o = div.offset();
   this.tempPosition = {
  left:o.left,
  top:o.top,
  right:o.left+div.width(),
  bottom:o.top+div.height(),
  scrollOffsetX:this.scrollWidth-this.clientWidth,
  scrollOffsetY:this.scrollHeight-this.clientHeight,
   };
}

function stopScroll(e)
{
   $(this).unbind('mousemove').removeAttr('tempPosition');
}

function scrollThis(e)
{
   // Use the e.clientX and e.clientY vs this.tempPosition 
   // to determine how much to move the scrollbars according 
   // to your tastes.
   this.scrollTop = setTop;
   this.scrollLeft = setLeft;
}


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan
Sent: Wednesday, November 05, 2008 2:56 PM
To: jQuery (English)
Subject: [jQuery] Scrolling inside a div with mousemove


Hello,

I'm trying to move from MooTools over the jQuery as it seems to be a
much reliable and user friendly framework.

However I need to recreate something that I currently have MooTools
doing but am having trouble figuring out how it would work.

I'm trying to replicate the effect seen in the 'mousemove' example of
this MooTools page http://demos111.mootools.net/Scroller.

It doesn't need to scroll left and right but it's fine if it does, I'm
quite comfortable using JavaScript but just to warn you I'm very new
to jQuery :)

Thank you very much for any help.



[jQuery] Survey for pro and non-pre developers

2008-11-05 Thread steviegee

Hi everyone - I am a researcher in the Visual Studio User Experience
team - I am undertaking research focused on professional and non-
professional web developers.
I'd really appreciate you taking 5 minutes to run through one of the
survey's:

Professional Developers: 
http://www.surveymonkey.com/s.aspx?sm=Bn4bKg_2bo49xcfXyWaNQl8g_3d_3d

Non-professional developers/hobbyists:
http://www.surveymonkey.com/MySurvey_EditorPage.aspx?sm=w6NaIo8sZOYGtqFZnEN5tOtvBQX0D3nQ0mDX8Sf2vbw%3d

Thanks in advance!

Stephen Giff


[jQuery] validator plugin dynamic form names

2008-11-05 Thread lance123

Hi Jorn,

Really like the plugin!  How do use dynamic form names?  I have tried
numerous methods but it won't accept my variable.

ie $("#"+MyFormName)

My variable is set ok but it just does not seem to work.  The reason I
want to do this is because I am dynamically creating the form names
from variables in php.  There is also about 20 per page.

A second question is how do I call my own ajax function instead of
submit.  The function is  an 

[jQuery] Re: How to load only one image at a time using JQuery Cycle Plugin?

2008-11-05 Thread Mike Alsup

> Mike, If I call  var $slideshow = $
> ('#slideshow').cycle('stop').empty();  when it is not running  and is
> empty will it error out?


Don't be afraid to experiment with these things yourself.  You'd
already have your answer by now.

Mike



[jQuery] I'm having problems making a div show up when I load the page

2008-11-05 Thread Brian

I'm using jqModal..

I simply want an email subscription list to pop up when the page is
loaded here's what I've got.


$(document).ready(function() {
  $('#dialog').jqm();
   });

view <-that is a link... I
don't want to use a manual link to open up the div



Close
Please Sign up for our mailing list:



First Name:
Last Name:
E-Mail:

Type comments or questions here.



in the jqModal.js file there is " trigger: '.jqModal', "

How do I just have the div pop up? I've looked everywhere, and
everything seems to have to do with clicking I am new to jquery by
the way.


[jQuery] Slide out sidebars

2008-11-05 Thread Taco

I am attempting to design a site with a central liquid area, and two
side areas that provide auxiliary information. When the browser window
is made smaller and the viewport is reduced below 1024 px, I want
these side areas to slide into a minimized position showing different
xhtml files. when they are moused over, I'd like them to slide out to
their original size OVER the main area, and graying out the main area.

How would I get started? I am not a complete newbie at javascript, but
this will be my first experience with jQuery. Can someone point me in
the right direction? I appreciate it.

Ty Underwood


[jQuery] Scrolling inside a div with mousemove

2008-11-05 Thread Dan

Hello,

I'm trying to move from MooTools over the jQuery as it seems to be a
much reliable and user friendly framework.

However I need to recreate something that I currently have MooTools
doing but am having trouble figuring out how it would work.

I'm trying to replicate the effect seen in the 'mousemove' example of
this MooTools page http://demos111.mootools.net/Scroller.

It doesn't need to scroll left and right but it's fine if it does, I'm
quite comfortable using JavaScript but just to warn you I'm very new
to jQuery :)

Thank you very much for any help.


[jQuery] TableSorter Pagination: Move pagination to top

2008-11-05 Thread ripcurlksm


Is there any way i can move the pagination div to the top of the table sort--
because the last page of the table sort always has a white gap between the
last row and the pagination buttons. 

Two ways to solve this would be to either move the pagination to the top or
fix the pagination div so that it adjusts to the last row of the table,
instead of assuming the rows are full and staying way beneath the content at
the bottom, causing a gap(see image below).

Any thoughts?

Here is the gap, when its limited to 10, which seems small, however, when
you limit it to 30 or 40 rows, it becomes a HUGE white gap.

http://www.nabble.com/file/p20353088/Untitled-1.jpg 
-- 
View this message in context: 
http://www.nabble.com/TableSorter-Pagination%3A-Move-pagination-to-top-tp20353088s27240p20353088.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Check if remote file exists.

2008-11-05 Thread Karl Rudd

What you want is a "HEAD" request. See the following for details:

http://www.jibbering.com/2002/4/httprequest.html
http://www-128.ibm.com/developerworks/web/library/wa-ajaxintro3/

Karl Rudd

On Thu, Nov 6, 2008 at 5:54 AM, Genu <[EMAIL PROTECTED]> wrote:
>
> Is it possible to use jquery to check of remote file (url) exists or
> not. For example, I have this url:
>
> http://www.myserver.com/media/test.mp3
>
> can I use a jquery http request to see if the url is valid or not?
>
>


[jQuery] Re: Clone problem in IE...

2008-11-05 Thread Choan Gálvez


On Nov 5, 2008, at 6:53 PM, Rafael Soares wrote:


I had a similar problem...
The difference is that I'm trying to clone the file input inside the  
same

document, just another, hidden, form.
I found a workaround, but I don't know if it'll work for you as well.

Since I was going to clear the form after the whole thing anyway, I  
decide
to do the inverse: append the original input to the new form, then  
clone it

and then append the clone to the original form.
It's kinda messy, but worked for me. Of course I'm doing this only  
in IE,

other browsers use the normal procedure.


You are not alone. I had to do just the same. Nasty.







Hope it helps.

Rafael Soares


On Thu, Jul 24, 2008 at 12:10, Marcus Eby <[EMAIL PROTECTED]> wrote:



I just found out that cloneNode doesn't pass the value in a file  
field

when being cloned from inside an iframe in IE.
Apparently this is an IE bug, and I've tried over 15 different ways  
of

trying to clone the object, then change the values, and update the
values, and even changing them before they get cloned, but nothing
works.

After trying so many different options, and still having no value
being cloned, so that the function won't work, I have given up.

If anyone else has had this problem and solved it, please post.

After spending years hating IE, this has definitely helped me to  
start

thinking about FF only site-app design. 

Thanks

Marcus





[jQuery] Re: Hide/Show in IE 6

2008-11-05 Thread Kru

Firebug Lite i should say considering its IE

On Nov 6, 12:35 pm, Kru <[EMAIL PROTECTED]> wrote:
> I cant see why it shouldnt. Just give it a try?! Maybe even use
> firebug - itll take all of about 10 seconds that way :)
>
> On Nov 6, 10:34 am, OutOfTouch <[EMAIL PROTECTED]> wrote:
>
> > Will this work in IE 6?
>
> > $('#listings').show();
>
> > I can't remember for sure but I thought that didn't work in IE 6.
>
> > Thanks!


[jQuery] Re: Hide/Show in IE 6

2008-11-05 Thread Kru

I cant see why it shouldnt. Just give it a try?! Maybe even use
firebug - itll take all of about 10 seconds that way :)

On Nov 6, 10:34 am, OutOfTouch <[EMAIL PROTECTED]> wrote:
> Will this work in IE 6?
>
> $('#listings').show();
>
> I can't remember for sure but I thought that didn't work in IE 6.
>
> Thanks!


[jQuery] Re: How to load only one image at a time using JQuery Cycle Plugin?

2008-11-05 Thread OutOfTouch

> > Can I clear out what was previously loaded, so the only the selected
> > category is being viewed?
>
> Yes.  Stop the slideshow, empty it, reload it, and then restart it.
>
> var $slideshow = $('#slideshow').cycle('stop').empty();
> $slideshow.append( mySlide1);
> $slideshow.append( mySlide2);
> etc...
> $slideshow.cycle();

Mike, If I call  var $slideshow = $
('#slideshow').cycle('stop').empty();  when it is not running  and is
empty will it error out?

Thanks!



[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Richard D. Worth
On Wed, Nov 5, 2008 at 5:29 PM, Richard D. Worth <[EMAIL PROTECTED]> wrote:

>
> On Wed, Nov 5, 2008 at 3:29 PM, Jared Toporek <[EMAIL PROTECTED]> wrote:
>
>> I hate to barge in on this discussion with something unrelated, but how
>> long does it take for something to post? I've sent 2 posts in the last 30
>> minutes and they are not appearing.  Any idea what I might be doing wrong?
>
>
> The forum is moderated. Your first post(s) are read to make sure they
> aren't spam. After that, they should go right through.
>

That is, after you've been cleared, any future posts should go through
without moderation.

- Richard


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Richard D. Worth
On Wed, Nov 5, 2008 at 3:29 PM, Jared Toporek <[EMAIL PROTECTED]> wrote:

> I hate to barge in on this discussion with something unrelated, but how
> long does it take for something to post? I've sent 2 posts in the last 30
> minutes and they are not appearing.  Any idea what I might be doing wrong?


The forum is moderated. Your first post(s) are read to make sure they aren't
spam. After that, they should go right through.

- Richard


[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-05 Thread Jeffrey Kretz

Your second "documentos" array (the empty one), has a comma after it, which
is not followed by another property.

When I tried to eval your original json, I got an error.

After removing that comma, it eval'ed correctly.

Hope this helps.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Augusto TMW
Sent: Wednesday, November 05, 2008 1:56 PM
To: jQuery (English)
Subject: [jQuery] Re: Problems with the JSON return from the jQuery.ajax()
method


Hi, thanks about your answer.

This is a example of my JSON:


{"mes":{
"numero":"11",
"ano":"2008",
"reunioes": [
{
"dia":"27",
"horario":"15:50",
"local":"lorem ipsum",
"titulo":"Reunião 03",
"documentos":[

{"nome":"teste5","arquivo":"../institucional/downloads/
teste5.pdf"},

{"nome":"teste6","arquivo":"../institucional/downloads/
teste6.pdf"}
]
},
{
"dia":"23",
"horario":"10:20",
"local":"lorem ipsum",
"titulo":"Reunião 04",
"documentos":[],
}
],
"visitas":[
{
"dia":"1",
"horario":"21:15",
"local":"lorem ipsum",
"titulo":"Visita 01",
"documentos":[

{"nome":"teste4","arquivo":"../institucional/downloads/teste4.pdf"}
]
},
{
"dia":"25",
"horario":"21:15",
"local":"lorem ipsum",
"titulo":"Visita 02",
"documentos":[

{"nome":"teste5","arquivo":"../institucional/downloads/teste5.pdf"}
]
}
]
}}


Where I've to put the comma?

Thanks very much for your help! =D

Augusto TMW

On Nov 5, 12:46 pm, Choan Gálvez <[EMAIL PROTECTED]> wrote:
> Hi.
>
> On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:
>
>
>
>
>
> > Hi,
>
> > I'm trying do return a JSON with a $.ajax() method.
>
> > here is my entire function:
>
> > function carregaMes(d){
> >  if(!(_reunioes["reg"+d.month+d.year])){
> >    $.ajax({
> >            url: "reunioes.jsp",
> >            data: "mes="+d.month+"&ano="+d.year,
> >            async: false,
> >            dataType: "json",
> >            success: function(a){
> >                    _reunioes["reg"+d.month+d.year] = a;
> >            }
> >    });
> >    return _reunioes["reg"+d.month+d.year];
> >  } else {
> >    return _reunioes["reg"+d.month+d.year];
> >  }
> > }
>
> > Where _reunioes is an array in window object.
>
> > In FF its ok, but in IE its return "undefined". I tried to call a
> > normal ajax and use the jQuery.httpData() method to covert my xhr into
> > a JSON, but my IE tell me that in line where jQuery tries to convert
> > ( data = eval("("+data+")"); ) has an error "Indentifier, sequency or
> > number expected".
>
> I'd bet the input is not valid JSON. Check for extra commas at the end  
> of your JSON array definition.
>
> Best.
> --
> Choan



[jQuery] Re: Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread MorningZ

Posted this code:
http://paste.pocoo.org/show/86103/

on an earlier exact post like this:

$.tablesorter.addParser({
id: 'dd.mm.',
is: function(s) {
return false;
},
format: function(s) {
s = '' + s; //Make sure it's a string
var hit = s.match(/(\d{1,2})\.(\d{1,2})\.(\d{4})/);
if (hit && hit.length == 4) {
return hit[3] + hit[2] + hit[1];
}
else {
return s;
}
},
type: 'text'
});




and don't forget, you have to wire up the custom sorter in the options
of the .tablesorter() wire up








On Nov 5, 2:53 pm, Josip Lazic <[EMAIL PROTECTED]> wrote:
> Is it possible to sort column with dates in dd.mm. format?


[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-05 Thread Augusto TMW

Hi, thanks about your answer.

This is a example of my JSON:


{"mes":{
"numero":"11",
"ano":"2008",
"reunioes": [
{
"dia":"27",
"horario":"15:50",
"local":"lorem ipsum",
"titulo":"Reunião 03",
"documentos":[

{"nome":"teste5","arquivo":"../institucional/downloads/
teste5.pdf"},

{"nome":"teste6","arquivo":"../institucional/downloads/
teste6.pdf"}
]
},
{
"dia":"23",
"horario":"10:20",
"local":"lorem ipsum",
"titulo":"Reunião 04",
"documentos":[],
}
],
"visitas":[
{
"dia":"1",
"horario":"21:15",
"local":"lorem ipsum",
"titulo":"Visita 01",
"documentos":[

{"nome":"teste4","arquivo":"../institucional/downloads/teste4.pdf"}
]
},
{
"dia":"25",
"horario":"21:15",
"local":"lorem ipsum",
"titulo":"Visita 02",
"documentos":[

{"nome":"teste5","arquivo":"../institucional/downloads/teste5.pdf"}
]
}
]
}}


Where I've to put the comma?

Thanks very much for your help! =D

Augusto TMW

On Nov 5, 12:46 pm, Choan Gálvez <[EMAIL PROTECTED]> wrote:
> Hi.
>
> On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:
>
>
>
>
>
> > Hi,
>
> > I'm trying do return a JSON with a $.ajax() method.
>
> > here is my entire function:
>
> > function carregaMes(d){
> >  if(!(_reunioes["reg"+d.month+d.year])){
> >    $.ajax({
> >            url: "reunioes.jsp",
> >            data: "mes="+d.month+"&ano="+d.year,
> >            async: false,
> >            dataType: "json",
> >            success: function(a){
> >                    _reunioes["reg"+d.month+d.year] = a;
> >            }
> >    });
> >    return _reunioes["reg"+d.month+d.year];
> >  } else {
> >    return _reunioes["reg"+d.month+d.year];
> >  }
> > }
>
> > Where _reunioes is an array in window object.
>
> > In FF its ok, but in IE its return "undefined". I tried to call a
> > normal ajax and use the jQuery.httpData() method to covert my xhr into
> > a JSON, but my IE tell me that in line where jQuery tries to convert
> > ( data = eval("("+data+")"); ) has an error "Indentifier, sequency or
> > number expected".
>
> I'd bet the input is not valid JSON. Check for extra commas at the end  
> of your JSON array definition.
>
> Best.
> --
> Choan


[jQuery] Re: Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread aquaone
ack, just realized you're doing dd.mm so gotta change it to
s = s.replace(/(\d{1,2})\.(\d{1,2})\.(\d{2,4})/, "$2/$1/$3");
i think?

stephen

On Wed, Nov 5, 2008 at 13:50, aquaone <[EMAIL PROTECTED]> wrote:

> Yes but it may be better to change your separator.
>
> I haven't tested this but it should work...
>
> $.tablesorter.addParser({
>   id: "dotDate",
>   is: function(s) {
> return /\d{1,2}\.\d{1,2}\.\d{2,4}/.test(s);
>   },
>   format: function(s,table) {
> s = s.replace(/(\d{1,2})\.(\d{1,2})\.(\d{2,4})/, "$1/$2/$3");
> return $.tablesorter.formatFloat(new Date(s).getTime());
>   },
>   type: "numeric"
> });
>
> stephen
>
>
>
> On Wed, Nov 5, 2008 at 11:53, Josip Lazic <[EMAIL PROTECTED]> wrote:
>
>>
>> Is it possible to sort column with dates in dd.mm. format?
>>
>>
>


[jQuery] Re: Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread aquaone
Yes but it may be better to change your separator.

I haven't tested this but it should work...

$.tablesorter.addParser({
  id: "dotDate",
  is: function(s) {
return /\d{1,2}\.\d{1,2}\.\d{2,4}/.test(s);
  },
  format: function(s,table) {
s = s.replace(/(\d{1,2})\.(\d{1,2})\.(\d{2,4})/, "$1/$2/$3");
return $.tablesorter.formatFloat(new Date(s).getTime());
  },
  type: "numeric"
});

stephen


On Wed, Nov 5, 2008 at 11:53, Josip Lazic <[EMAIL PROTECTED]> wrote:

>
> Is it possible to sort column with dates in dd.mm. format?
>
>


[jQuery] Re: Effect Like slideUp/Down

2008-11-05 Thread Andy Matthews

There's also show/hide. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Panman
Sent: Wednesday, November 05, 2008 3:09 PM
To: jQuery (English)
Subject: [jQuery] Effect Like slideUp/Down


I cannot for the life of me figure this out. I know it must be easy, just
not finding the solution.

I'd like to toggle() something and use the "slide" effect. However, I don't
like how the UI slide effect works. It slides the content out of view then
brings whatever was below up. I'd rather have whatever is below slide up
with the content. Compare how .hide("slide",
{direction: "up"}, "slow") and .slideUp("slow") differ. I tried using the
core toggle() with slideUp/Down but that is not reliable. Thanks for any
input!




[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Jared Toporek
I hate to barge in on this discussion with something unrelated, but how long
does it take for something to post? I've sent 2 posts in the last 30 minutes
and they are not appearing.  Any idea what I might be doing wrong?

On Wed, Nov 5, 2008 at 2:24 PM, Jeffrey Kretz <[EMAIL PROTECTED]> wrote:

>
> Heh.  I like that -- the Code Jihad.
>
> I agree 100% about failing silently being a BAD THING(tm).
>
> However, our disagreement involves what constitutes a fail.
>
> The only thing we've been trying to say is, an empty result set is only a
> fail under certain circumstances.
>
> To define an empty result set is a fail EVERY TIME is to limit the
> underlying system.
>
> Going back to the SQL analogy -- I have a data layer that performs a delete
> like this:
>
> DELETE FROM Table WHERE PrimaryKey = @KeyValue
> SELECT @RowCount = @@ROWCOUNT
>
> The app that calls the delete function will get a return value of how many
> rows were deleted.
>
> Maybe 0 rows is a fail, maybe it isn't.  It depends on what I'm trying to
> do.
>
> I have a choice to fail the program after the delete.
>
> It would be wrong to require a SQL Exception thrown on every case of 0 rows
> deleted.
>
> Savvy?
> JK
>
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of brian
> Sent: Wednesday, November 05, 2008 11:24 AM
> To: jQuery (English)
> Subject: [jQuery] Re: Can I make jquery not fail silently??
>
>
>
> I have a personal jihad against apps that fail silently.
>
> My jihad listens to no reason.
>
> Sure, they have valid points that make sense from the viewpoints they
> hold.  I don't share their viewpoints.  OK?
>
> Can we lighten up now?
>
>
>
> On Nov 5, 1:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> > That 'religious' bit is a bit offensive don't you think? There are
> > good reasons for failing silently as Mike, Richard and Jeffrey have
> > pointed out. The fact you don't accept/understand them doesn't make
> > their (and mine) opinions less empirical.
> >
> > - ricardo
> >
> > On Nov 5, 5:10 pm, brian <[EMAIL PROTECTED]> wrote:
> >
> > > > Now $('#non-existing-id').fail().toggle() will fail,
> > > > but will work if it's not empty.
> >
> > > That's actually right on the money.  Thanks.
> >
> > > //Still thinks fail silently on id queries is insane, but knows a
> > > religious argument when he sees one.
>
>


[jQuery] jquery validation unhighlight issue

2008-11-05 Thread kedr

my js is as follows:

var validator = $('#myForm').validate({
onfocusout: false,
onkeyup: false,

rules: {
prefix: { required: true },
name: { required: true }
},

messages: {
prefix: { required: 'Please select a prefix' },
name: { required: 'Please provide your name' }
},

errorClass: 'formError',
highlight: function(element, errorClass) {
$(element.form).find('label[for=' + element.id +
']').addClass(errorClass);
},
unhighlight: function(element, errorClass) {
$(element.form).find('label[for=' + element.id +
']').removeClass(errorClass);
}
});

and my html:


  *Prefix:
  



  *Name:
  


and I am using jquery 1.2.6 with jquery validation 1.4

When I submit with errors both labels get the errorClass attached
which is what I want. But when I fix the errors and submit again, the
labels disappear and it seems are getting a style="display;none"
instead of running the unhighlight method. Also, if I put an alert
statement inside the unhighlight method it seems once you submit with
no errors each corrected field spits out the alert twice. Any ideas?
How do I get the unhighlight to remove the class instead of making the
label disappear?


[jQuery] Effect Like slideUp/Down

2008-11-05 Thread Panman

I cannot for the life of me figure this out. I know it must be easy,
just not finding the solution.

I'd like to toggle() something and use the "slide" effect. However, I
don't like how the UI slide effect works. It slides the content out of
view then brings whatever was below up. I'd rather have whatever is
below slide up with the content. Compare how .hide("slide",
{direction: "up"}, "slow") and .slideUp("slow") differ. I tried using
the core toggle() with slideUp/Down but that is not reliable. Thanks
for any input!


[jQuery] Tablesorter, sorting dates in format dd.m.yyyy

2008-11-05 Thread Josip Lazic

Is it possible to sort column with dates in dd.mm. format?



[jQuery] problems with unhighlight of error labels with jquery validation 1.4

2008-11-05 Thread kedr

my js is as follows:

var validator = $('#myForm').validate({
onfocusout: false,
onkeyup: false,

rules: {
prefix: { required: true },
name: { required: true }
},

messages: {
prefix: { required: 'Please select a prefix' },
name: { required: 'Please provide your name' }
},

errorClass: 'formError',
highlight: function(element, errorClass) {
$(element.form).find('label[for=' + element.id +
']').addClass(errorClass);
},
unhighlight: function(element, errorClass) {
$(element.form).find('label[for=' + element.id +
']').removeClass(errorClass);
}
});

and my html:


  *Prefix:
  



  *Name:
  


and I am using jquery 1.2.6 with jquery validation 1.4

When I submit with errors both labels get the errorClass attached
which is what I want. But when I fix the errors and submit again, the
labels disappear and it seems are getting a style="display;none"
instead of running the unhighlight method. Also, if I put an alert
statement inside the unhighlight method it seems once you submit with
no errors each corrected field spits out the alert twice. Any ideas?
How do I get the unhighlight to remove the class instead of making the
label disappear?


[jQuery] print out td in tr without unique ids

2008-11-05 Thread Jared_T

Here's what I am trying to do - I want to print out the text value of
a particular td.  The easy solution would be to give each td in each
row a unique id (change code below so the first td to
id="row1_col1").  However if there is a way to access the text in col1
of row1 with jquery without giving each td element a unique id I'd
love to know.  You can look at the code below to get the idea of what
I am trying to do.

http://www.w3.org/TR/html4/loose.dtd";>


  http://code.jquery.com/jquery-latest.js";>






1
2


3
4




str01 = $("#row1 > col1").text();// this doesn't work
document.write("row1 col1 value is: " + str01 + "
"); str02 = $("#row1").("col1").text();// this doesn't work either, these are just for the attempts that failed document.write("row1 col1 value is: " + str02 + "
");

[jQuery] Async TreeView - loading multiple nodes

2008-11-05 Thread yitznewton

Greetings:

Thank you, Jörn, for a wonderful plugin.  I'm trying to load several
branches asynchronously immediately when the document loads:

Root
|
- Books
- Journals
- Article Databases

Each one of these three is meant to load a different set of children
(e.g. books.php, journals.php, dbs.php; or alternately, 'load_data.php?
type=books' etc.).  Forgive me, I couldn't understand from the docs
how to specify the url to use in these cases - would you please point
me in the right direction?

Many thanks,
yitznewton


[jQuery] accessing child element without unique id

2008-11-05 Thread Jared_T

I'm trying to access a td text value, as shown in the javascript
below.  The easiet way to solve this problem would be to give each td
id value a unique identifier (i.e. td id="row1_col1") Is it possible
to access the td element of a tr with a unique tr id tag without
naming each td id uniquely?  I'm new to this, I pasted the code as an
example of what I'm trying to do.  All the attempts in the javascript
below failed.



  http://code.jquery.com/jquery-latest.js";>





1
2


3
4




str01 = $("#row1 > col1").text();
document.write("row1 col1 value is: " + str01 + "
"); str02 = $("#row1.col1").text(); document.write("row1 col1 value is: " + str02 + "
"); //str03 = $("#row1").("#col1").text(); //document.write("row1 col1 value is: " + str03 + "
"); //str04 = $("#col1").text(("#row1").text()); //document.write("row1 col1 value is: " + str04 + "
");

[jQuery] Hide/Show in IE 6

2008-11-05 Thread OutOfTouch

Will this work in IE 6?

$('#listings').show();

I can't remember for sure but I thought that didn't work in IE 6.

Thanks!


[jQuery] Re: Best event for changing the content of a div?

2008-11-05 Thread Chris

$(document).ready() is the soonest possible opportunity without using
inline script (and arguably sooner than an inline script).
You cannot use javascript to select your div until the DOM has been
loaded, and $(document).ready() fires as soon as the DOM has been
loaded. This happens before the page has loaded. The .load() function
is only fired after that element and all of its contents have
completely loaded. In the sequence of things, .load() happens after $
(document).ready() -- the DOM load -- and before onLoad -- the page
load.
More info:
http://www.learningjquery.com/2006/09/introducing-document-ready



On Nov 5, 3:30 pm, "Elwood Casey" <[EMAIL PROTECTED]> wrote:
> Correct: I'm not trying to change the content before the div loads.
> I'm trying to change it at the soonest possible opportunity, but without
> inline script!
> I'm hoping for an event that fires on a per element basis, when the element
> is ready - i.e $(element).ready().
>
> The only event that seems to match is load(), but I can't get this to
> fire...
>
> Looking at the docs, the load() event might be what I'm after
>
> On Wed, Nov 5, 2008 at 5:59 PM, Chris <[EMAIL PROTECTED]> wrote:
>
> > I could be mistaken here, but doesn't jQuery (or javascript for that
> > matter) need the DOM to be loaded before you can start selecting
> > things from it?
> > You could put the script elsewhere on the page, but you're still going
> > to have to wait for that div to load before you can change its
> > contents. If you to insert content before the page loads, you're going
> > to have to use some server-side programming, not javascript.
>
> > - Chris
>
> > On Nov 5, 11:12 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> > > If you don't want to put a script after the div it won't get any
> > > faster then DOM ready.
>
> > > You could although poll for that element. Say it had an id of
> > > 'asap' (untested):
>
> > > (function() {
> > >     var f = function() {
> > >         var div = document.getElementById('asap');
> > >         if (div) {
> > >             // alter content here...
> > >         } else {
> > >             setTimeout(f, 30);
> > >         }
> > >     };
> > >     f();
>
> > > })();
>
> > > --Klaus
>
> > > On 5 Nov., 16:30, the_woodsman <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I want to change the content of a div asap.
>
> > > > I know about document.ready, but if possible I'd rather do this
> > > > earlier. I'd also rather do it as an event instead of loading a script
> > > > file after the div appears in the page.
>
> > > > I tried the load() event, but this didn't seem to fire at all.
>
> > > > Anyone got any tips on this?
>
>


[jQuery] Re: jCarousel, localScroll, other options?

2008-11-05 Thread genius switch

Can that be customized to have the bouncy effect?

On Nov 5, 8:57 am, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Maybe SerialScroll ?
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On Nov 5, 10:45 am, genius switch <[EMAIL PROTECTED]> wrote:
>
> > Here is my issue, I have used jCarousel to accomplish what I need...
> > however the markup is bothering my anal tendencies for pure
> > semantics.
>
> > I'm using jCarousel to scroll content blocks in a sexy way, however,
> > in order to use jCarousel I must have my content blocks inside a list,
> > each as a list item. This validates, and is functioning exactly how I
> > want it to, however I can't get past the fact that this markup doesn't
> > make sense.
>
> > LocalScroll is my other option, but it doesn't slide sexy the way
> > jCarousel does. Does anyone have any advice?
>
> > Here is the test page:http://www.geniusswitchstudio.com/v2/template.htm
>
> > Thanks!
>
> > - C


[jQuery] Re: Toggle and Nested Divs

2008-11-05 Thread n8cshaw

Well, no one followed up and I kept experimenting and found that if I
put the event call in the onclick attribute of the link, it works as
expected. If I try to bind the onclick event on document ready, it
does not work.

Works: onclick="showHideExactDates();"

Does not Work:
jq("#dateExactShowHideLink_image").click(showHideExactDates);

The latter method makes the div open and close immediately when
toggled. I believe there must be some conflict going on between JQuery
and some other library being used on the page, but I don't know that
for certain...

I would still love to know why this is happening if anyone has any
ideas or suggestions.


On Nov 5, 8:40 am, n8cshaw <[EMAIL PROTECTED]> wrote:
> Thanks Ricardo. I have put the code up athttp://jsbin.com/atiza
>
> As for the double quotes on the Velocity call, those are evaluated on
> the server prior to being sent to the client, so no worries there.
>
> I appreciate the help with this! It seems like this should be a very
> easy thing to do (I did the exact same thing with Prototype/
> Scriptaculous on another site). I am not sure what I am missing.
>
> On Nov 5, 7:27 am, ricardobeat <[EMAIL PROTECTED]> wrote:
>
> > Try providing a test page or pasting your code 
> > atwww.pastie.orgorwww.jsbin.com, that way people can actually read it! :)
>
> > Can't figure out from this code what might be wrong, it's probably an
> > event bubbling issue.
>
> > And you have src="$content.getURI("images/icon_plus.gif")" that will
> > cause serious parsing errors on the browser, use single quotes inside.
>
> > - ricardo
>
> > On Nov 4, 7:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > Hi all.
>
> > > I have an outer div that contains several child divs (event search
> > > form that lets the user pick dates, categories, etc...). The user can
> > > toggle the outer div and the child divs as well. This all works for me
> > > AS LONG AS the outer div is visible and not able to be toggled. When I
> > > let the user toggle the outer div, when the outer div is toggled to
> > > visible and the user tries to toggle a child div, the child div opens
> > > and then closes again right away.
>
> > > I believe this is happening because the child div is somehow
> > > inheriting the parent's visibility. I debugged it and
> > > showHideExactDates() is being run twice. So, it seems like it is
> > > starting out as visible, even though it is not visible on the form.
>
> > > Here is a snippet of the code:
>
> > >  > > src="$content.getURI("images/icon_plus.gif")"
> > > name="searchFormShowHideIcon" id="searchFormShowHideIcon" border="0"
> > > align="left" alt="+" />  > > id="searchFormShowHideLink_text">Search Form
>
> > > 
> > >> > title="show/hide exact date form fields"> > > src="$content.getURI("images/icon_plus.gif")"
> > > name="dateExactShowHideIcon" id="dateExactShowHideIcon" border="0"
> > > align="left" alt="+" />  > > id="dateExactShowHideLink_text">Specify Exact Dates
> > > 
> > > Occurs between  > > name="dateRangeStartMonth" id="dateRangeStartMonth" title="date range
> > > start month" value="$!dateRangeStartMonth" maxlength="2">/
> > >  > > id="dateRangeStartDay" title="date range start day" value="$!
> > > dateRangeStartDay" maxlength="2">/
> > >  > > id="dateRangeStartYear" title="date range start year" value="$!
> > > dateRangeStartYear" maxlength="4"> > > id="dateRangeStartCalendarLink" title="event range start calendar date
> > > picker"> > > alt="Choose range start date" border="0" align="absmiddle"> 
> > > and  > > id="dateRangeEndMonth" title="date range end month" value="$!
> > > dateRangeEndMonth" maxlength="2">/
> > >  > > id="dateRangeEndDay" title="date range end day" value="$!
> > > dateRangeEndDay" maxlength="2">/
> > >  > > id="dateRangeEndYear" title="date range end year" value="$!
> > > dateRangeEndYear" maxlength="4"> > > id="dateRangeEndCalendarLink" title="event range end calendar date
> > > picker"> > > alt="Choose range end date" border="0" align="absmiddle">
> > > 
> > > 
>
> > > function showHideSearchForm() {
> > > jq("#eventSearchFormDiv").toggle("blind", {}, 1000);
> > > }
>
> > > //add the form submit handler
> > > jq(document).ready(function() {
> > > jq("#searchFormShowHideLink_image").click(showHideSearchForm);
> > > jq("#searchFormShowHideLink_text").click(showHideSearchForm);
> > > });
>
> > > function showHideExactDates() {
> > > alert("running showHideExactDates()");
> > > jq("#dateExactDiv").toggle("blind", {}, 1000);
> > > }
>
> > > //add the form submit handler
> > > jq(document).ready(function() {
> > > jq("#dateExactShowHideLink_image").click(showHideExactDates);
> > > jq("#dateExactShowHideLink_text").click(showHideExactDates);
> > > jq("#dateRangeStartCalendarLink").datepicker();
> > > jq("#dateRangeEndCalendarLink").datep

[jQuery] Re: Best event for changing the content of a div?

2008-11-05 Thread Elwood Casey
Correct: I'm not trying to change the content before the div loads.
I'm trying to change it at the soonest possible opportunity, but without
inline script!
I'm hoping for an event that fires on a per element basis, when the element
is ready - i.e $(element).ready().

The only event that seems to match is load(), but I can't get this to
fire...



Looking at the docs, the load() event might be what I'm after

On Wed, Nov 5, 2008 at 5:59 PM, Chris <[EMAIL PROTECTED]> wrote:

>
> I could be mistaken here, but doesn't jQuery (or javascript for that
> matter) need the DOM to be loaded before you can start selecting
> things from it?
> You could put the script elsewhere on the page, but you're still going
> to have to wait for that div to load before you can change its
> contents. If you to insert content before the page loads, you're going
> to have to use some server-side programming, not javascript.
>
> - Chris
>
>
> On Nov 5, 11:12 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> > If you don't want to put a script after the div it won't get any
> > faster then DOM ready.
> >
> > You could although poll for that element. Say it had an id of
> > 'asap' (untested):
> >
> > (function() {
> > var f = function() {
> > var div = document.getElementById('asap');
> > if (div) {
> > // alter content here...
> > } else {
> > setTimeout(f, 30);
> > }
> > };
> > f();
> >
> > })();
> >
> > --Klaus
> >
> > On 5 Nov., 16:30, the_woodsman <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > I want to change the content of a div asap.
> >
> > > I know about document.ready, but if possible I'd rather do this
> > > earlier. I'd also rather do it as an event instead of loading a script
> > > file after the div appears in the page.
> >
> > > I tried the load() event, but this didn't seem to fire at all.
> >
> > > Anyone got any tips on this?
> >
> >
>
> >
>


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Jeffrey Kretz

Heh.  I like that -- the Code Jihad.

I agree 100% about failing silently being a BAD THING(tm).

However, our disagreement involves what constitutes a fail.

The only thing we've been trying to say is, an empty result set is only a
fail under certain circumstances.

To define an empty result set is a fail EVERY TIME is to limit the
underlying system.

Going back to the SQL analogy -- I have a data layer that performs a delete
like this:

DELETE FROM Table WHERE PrimaryKey = @KeyValue
SELECT @RowCount = @@ROWCOUNT

The app that calls the delete function will get a return value of how many
rows were deleted.

Maybe 0 rows is a fail, maybe it isn't.  It depends on what I'm trying to
do.

I have a choice to fail the program after the delete.

It would be wrong to require a SQL Exception thrown on every case of 0 rows
deleted.

Savvy?
JK


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of brian
Sent: Wednesday, November 05, 2008 11:24 AM
To: jQuery (English)
Subject: [jQuery] Re: Can I make jquery not fail silently??



I have a personal jihad against apps that fail silently.

My jihad listens to no reason.

Sure, they have valid points that make sense from the viewpoints they
hold.  I don't share their viewpoints.  OK?

Can we lighten up now?



On Nov 5, 1:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> That 'religious' bit is a bit offensive don't you think? There are
> good reasons for failing silently as Mike, Richard and Jeffrey have
> pointed out. The fact you don't accept/understand them doesn't make
> their (and mine) opinions less empirical.
>
> - ricardo
>
> On Nov 5, 5:10 pm, brian <[EMAIL PROTECTED]> wrote:
>
> > > Now $('#non-existing-id').fail().toggle() will fail,
> > > but will work if it's not empty.
>
> > That's actually right on the money.  Thanks.
>
> > //Still thinks fail silently on id queries is insane, but knows a
> > religious argument when he sees one.



[jQuery] Safe Validate for Salesforce

2008-11-05 Thread Seth - TA

I am using the Validate plugin for validating our contact form which
sends data into SalesForce. We just implemented the AdWords plugin for
SalesForce and they say that using form.submit will break their
javascript for SalesForce. Currently with the Validate plugin I do
some custom functions using the SubmitHandler option for creating
values in the fields that go into SalesForce and at the end I use
form.submit.

$("#EmailForm").validate({
errorContainer: container,
errorLabelContainer: $("ul", container),
wrapper: 'li',
meta: "validate",
submitHandler: function(form) {
var comp = $("input[name='company']").val();
var ph = $("input[name='phone']").val();
var em = $("input[name='email']").val();
var ln = $("input[name='last_name']").val();
var fn = $("input[name='first_name']").val();
var comments = $("[name='comments']").val();
var prod = "";
//var checkboxes_product_code;
//checkboxes_product_code = 
$('.product:checkbox').attr("name");
//alert(checkboxes_product_code);
var checkbox_count = 0;
$(':checkbox:checked').each(function(checkbox_count){
if(checkbox_count < 
$(':checkbox:checked').length - 1){
prod += $(this).val() + ", ";
}
else{
prod += $(this).val();
}
return checkbox_count++;
});

var det =  fn + " " + ln + " of " + comp +" completed 
the form on
the website and would like information on " + prod +".  Please contact
" + fn + " at your earliest convenience at " + ph +" or " + em +".";

if(comments != ""){
det = det + " Comments / Questions: " + 
comments;
}
//$("input[name='" + checkboxes_product_code + 
"']").val(prod);
$("input[name='000jroe']").val(det);
//console.log($("input[name='000jroe']").val());
//alert($("#000jroe").val());
form.submit();
}

});

The recommend using an onsubmit call in the form. Plus the javascript
which it uses to determine the lead source is looking for a button to
submit the form. This is there "recommended" way
http://blogs.salesforce.com/adwords/2007/09/web-to-lead-for.html. Any
one have experience with this, or have any suggestions of not using
form.submit? Thanks.

Seth


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Eric Martin

brian,

> Can we lighten up now?

This is, by far, the most friendly, relaxed technical group of people
you are going to find on the Internet. I think you might be taking it
a little too personal.

If you want to add something in your application that makes it behave
in a certain way, there is nothing stopping you. To suggest that it is
a design flaw or something wrong with jQuery is invalid, regardless of
your personal crusades ;)

A few lines of code and you have exactly what you want...but there
have been plenty of valid reasons as to why what you suggest will
never be part of "core" jQuery.

-Eric

On Nov 5, 11:23 am, brian <[EMAIL PROTECTED]> wrote:
> I have a personal jihad against apps that fail silently.
>
> My jihad listens to no reason.
>
> Sure, they have valid points that make sense from the viewpoints they
> hold.  I don't share their viewpoints.  OK?
>
> Can we lighten up now?
>
> On Nov 5, 1:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
>
> > That 'religious' bit is a bit offensive don't you think? There are
> > good reasons for failing silently as Mike, Richard and Jeffrey have
> > pointed out. The fact you don't accept/understand them doesn't make
> > their (and mine) opinions less empirical.
>
> > - ricardo
>
> > On Nov 5, 5:10 pm, brian <[EMAIL PROTECTED]> wrote:
>
> > > > Now $('#non-existing-id').fail().toggle() will fail,
> > > > but will work if it's not empty.
>
> > > That's actually right on the money.  Thanks.
>
> > > //Still thinks fail silently on id queries is insane, but knows a
> > > religious argument when he sees one.


[jQuery] Re: Accordion activate not working

2008-11-05 Thread KCWebMonkey

I got this to work finally by passing in the ID of the toggle i want
to set active.

On Nov 5, 11:01 am, KCWebMonkey <[EMAIL PROTECTED]> wrote:
> I have an accordion which i am trying to activate on page load, and
> the .activate function doesn't appear to be working. can someone show
> me how i'm implementing it incorrectly?
>
> JavaScript:
>
>         $(document).ready(function() {
>                 $('#childnav').accordion({
>                         autoheight: false,
>                         header: '.toggle',
>                         event: 'click',
>                         alwaysOpen: true,
>                         active: false
>                 });
>
>                 $(".toggle").activate(0);
>         });
>
> HTML:
>
> 
>         
>                 
>                 About Us
>                 
>                         Link 1
>                         Link 2
>                 
>         
>         
>                 
>                 New Homes
>                 
>                         another link
>                         another link
>                 
>         
>         
>                 
>                 The Community
>                 
>                         Arial PhotoGraph
>                         Amenities
>                         Schools
>                         Utilities
>                 
>         
>         
>                 
>                 News & Events
>                 
>                         Link 1
>                         Link 2
>                         Link 1
>                         Link 2
>                         Link 1
>                         Link 2
>                 
>         
>         
>                 
>                 Contact Us
>                 
>                         Link 1
>                         Link 2
>                         Link 1
>                 
>         
> 


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread brian


I have a personal jihad against apps that fail silently.

My jihad listens to no reason.

Sure, they have valid points that make sense from the viewpoints they
hold.  I don't share their viewpoints.  OK?

Can we lighten up now?



On Nov 5, 1:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> That 'religious' bit is a bit offensive don't you think? There are
> good reasons for failing silently as Mike, Richard and Jeffrey have
> pointed out. The fact you don't accept/understand them doesn't make
> their (and mine) opinions less empirical.
>
> - ricardo
>
> On Nov 5, 5:10 pm, brian <[EMAIL PROTECTED]> wrote:
>
> > > Now $('#non-existing-id').fail().toggle() will fail,
> > > but will work if it's not empty.
>
> > That's actually right on the money.  Thanks.
>
> > //Still thinks fail silently on id queries is insane, but knows a
> > religious argument when he sees one.


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Brandon Aaron
On Wed, Nov 5, 2008 at 1:10 PM, brian <[EMAIL PROTECTED]>wrote:

>
>
> > Now $('#non-existing-id').fail().toggle() will fail,
> > but will work if it's not empty.
>
> That's actually right on the money.  Thanks.
>
> //Still thinks fail silently on id queries is insane, but knows a
> religious argument when he sees one.


Hmmm ... you don't expect your CSS queries to throw an error if they don't
match an element do you? It'd be silly if it did. Then you'd need
a separate style sheet for each page instead of making good use of reusing
styles. Same goes for jQuery code. Matching zero or more elements is a
corner stone of being able to progressively enhance your web site/app with
unobtrusive javascript.

--
Brandon Aaron


[jQuery] Re: Advice on sIEve/Drip?

2008-11-05 Thread Jeffrey Kretz

Thanks a bunch for that link, also Josh for your advice.

After running this leak detector, nothing found as well.

Also, the 300MB leak hasn't recurred since that one time.

My current best guess is that the leaks occurred while I was debugging
javascript code and refreshing the page -- so the leaks were probably due to
bad code since fixed.  But since it was the same browser session refreshed
again and again, leaked DOM memory wasn't reclaimed until I closed and
re-opened the browser.

Anyway, I'll keep an eye on it, but I've got some good tools to help, and
jQuery is itself excellent at GC anyway so I hopefully won't run into a
problem.

Thanks again,
JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of trixta
Sent: Wednesday, November 05, 2008 6:15 AM
To: jQuery (English)
Subject: [jQuery] Re: Advice on sIEve/Drip?




On Nov 4, 12:20 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> OUCH.
>
> With over 25,000 lines of javascript code (full featured CMS) that's a
> nightmare to track down.
>
> Am I out of luck?  Are there no other alternative tools like sIEve that
are
> still in development?
>

Hi,

there is another tool by microsoft, you can try:
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx

but this tool doesn´t find all memory leaks.

this jquery-related info could be helpfull, too:
http://groups.google.com/group/jquery-dev/browse_thread/thread/4a99f6e9b2e33
057/30099a04db7f87b9
http://www.outsidethediv.com/2008/10/removechild-vs-the-garbage-bin/

One last advice. You don´t have to fix all memory leaks in IE6. It
really depends on the cost-benefit-ratio (hard effort/work to fix it
vs. noticeable advancement for the enduser).

regards
alex



[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread ricardobeat

That 'religious' bit is a bit offensive don't you think? There are
good reasons for failing silently as Mike, Richard and Jeffrey have
pointed out. The fact you don't accept/understand them doesn't make
their (and mine) opinions less empirical.

- ricardo

On Nov 5, 5:10 pm, brian <[EMAIL PROTECTED]> wrote:
> > Now $('#non-existing-id').fail().toggle() will fail,
> > but will work if it's not empty.
>
> That's actually right on the money.  Thanks.
>
> //Still thinks fail silently on id queries is insane, but knows a
> religious argument when he sees one.


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread ricardobeat

oops, missed a line:

jQuery.oldfind = jQuery.find;
jQuery.find = function(t,con){
var f = jQuery.oldfind(t,con);
if (f.length == 0) throw('Empty query');
return f;
}


On Nov 5, 5:10 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> Hey Brian, try this:
>
> jQuery.oldfind = jQuery.find;
> jQuery.find = function(t,con){
>     var f = jQuery.oldfind(t,con);
>     if (f.length == 0) throw('Empty query');
>
> }
>
> cheers,
> - ricardo
>
> On Nov 5, 1:08 pm, brian <[EMAIL PROTECTED]> wrote:
>
> > > It's not a failure to run a query and find nothing - that's a
> > > perfectly valid use case.
>
> > I understand where you are coming from on the querying side, but
> > shouldn't calling a method on an empty object fail?  How can I fade
> > in...nothing?
>
> > I'm going to still think of this as a huge design flaw.
>
> > There needs to be a way to specify that it should fail on empty
> > results.  /s for strict or whatever.
>
> > This post is for 1) bitching purposes and 2) indexing purposes so that
> > future searchers find definitive proof that jquery fails silently and
> > that this is not considered a bug, despite obvious appearances.


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread brian


> Now $('#non-existing-id').fail().toggle() will fail,
> but will work if it's not empty.

That's actually right on the money.  Thanks.

//Still thinks fail silently on id queries is insane, but knows a
religious argument when he sees one.


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread ricardobeat

Hey Brian, try this:

jQuery.oldfind = jQuery.find;
jQuery.find = function(t,con){
var f = jQuery.oldfind(t,con);
if (f.length == 0) throw('Empty query');
}

cheers,
- ricardo

On Nov 5, 1:08 pm, brian <[EMAIL PROTECTED]> wrote:
> > It's not a failure to run a query and find nothing - that's a
> > perfectly valid use case.
>
> I understand where you are coming from on the querying side, but
> shouldn't calling a method on an empty object fail?  How can I fade
> in...nothing?
>
> I'm going to still think of this as a huge design flaw.
>
> There needs to be a way to specify that it should fail on empty
> results.  /s for strict or whatever.
>
> This post is for 1) bitching purposes and 2) indexing purposes so that
> future searchers find definitive proof that jquery fails silently and
> that this is not considered a bug, despite obvious appearances.


[jQuery] Re: Check if remote file exists.

2008-11-05 Thread Andy Matthews

I think if you use the $.ajax method, you can implement the built in failure
method and go from there.


andy 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Genu
Sent: Wednesday, November 05, 2008 12:54 PM
To: jQuery (English)
Subject: [jQuery] Check if remote file exists.


Is it possible to use jquery to check of remote file (url) exists or not.
For example, I have this url:

http://www.myserver.com/media/test.mp3

can I use a jquery http request to see if the url is valid or not?




[jQuery] Check if remote file exists.

2008-11-05 Thread Genu

Is it possible to use jquery to check of remote file (url) exists or
not. For example, I have this url:

http://www.myserver.com/media/test.mp3

can I use a jquery http request to see if the url is valid or not?



[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Balazs Endresz

You can still write a simple plugin:

jQuery.fn.fail=function(){ return this.length ? this : null; }

Now $('#non-existing-id').fail().toggle() will fail,
but will work if it's not empty.

Consider this for example:
$('#non-existing-id').add('.anotherClass');
if it failed you cannot add other elements to the empty set
and you can't even write a plugin like this one above.

On Nov 5, 10:08 am, brian <[EMAIL PROTECTED]> wrote:
> > It's not a failure to run a query and find nothing - that's a
> > perfectly valid use case.
>
> I understand where you are coming from on the querying side, but
> shouldn't calling a method on an empty object fail?  How can I fade
> in...nothing?
>
> I'm going to still think of this as a huge design flaw.
>
> There needs to be a way to specify that it should fail on empty
> results.  /s for strict or whatever.
>
> This post is for 1) bitching purposes and 2) indexing purposes so that
> future searchers find definitive proof that jquery fails silently and
> that this is not considered a bug, despite obvious appearances.


[jQuery] Re: Clone problem in IE...

2008-11-05 Thread Rafael Soares
I had a similar problem...
The difference is that I'm trying to clone the file input inside the same
document, just another, hidden, form.
I found a workaround, but I don't know if it'll work for you as well.

Since I was going to clear the form after the whole thing anyway, I decide
to do the inverse: append the original input to the new form, then clone it
and then append the clone to the original form.
It's kinda messy, but worked for me. Of course I'm doing this only in IE,
other browsers use the normal procedure.

Hope it helps.

Rafael Soares


On Thu, Jul 24, 2008 at 12:10, Marcus Eby <[EMAIL PROTECTED]> wrote:

>
> I just found out that cloneNode doesn't pass the value in a file field
> when being cloned from inside an iframe in IE.
> Apparently this is an IE bug, and I've tried over 15 different ways of
> trying to clone the object, then change the values, and update the
> values, and even changing them before they get cloned, but nothing
> works.
>
> After trying so many different options, and still having no value
> being cloned, so that the function won't work, I have given up.
>
> If anyone else has had this problem and solved it, please post.
>
> After spending years hating IE, this has definitely helped me to start
> thinking about FF only site-app design. 
>
> Thanks
>
> Marcus
>


[jQuery] Re: Best event for changing the content of a div?

2008-11-05 Thread Chris

I could be mistaken here, but doesn't jQuery (or javascript for that
matter) need the DOM to be loaded before you can start selecting
things from it?
You could put the script elsewhere on the page, but you're still going
to have to wait for that div to load before you can change its
contents. If you to insert content before the page loads, you're going
to have to use some server-side programming, not javascript.

- Chris


On Nov 5, 11:12 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> If you don't want to put a script after the div it won't get any
> faster then DOM ready.
>
> You could although poll for that element. Say it had an id of
> 'asap' (untested):
>
> (function() {
>     var f = function() {
>         var div = document.getElementById('asap');
>         if (div) {
>             // alter content here...
>         } else {
>             setTimeout(f, 30);
>         }
>     };
>     f();
>
> })();
>
> --Klaus
>
> On 5 Nov., 16:30, the_woodsman <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I want to change the content of a div asap.
>
> > I know about document.ready, but if possible I'd rather do this
> > earlier. I'd also rather do it as an event instead of loading a script
> > file after the div appears in the page.
>
> > I tried the load() event, but this didn't seem to fire at all.
>
> > Anyone got any tips on this?
>
>


[jQuery] Re: [validate] Issues using requred:#radio:checked with custom AddMethid validator

2008-11-05 Thread Jörn Zaefferer
You have to modify your method to make it optional, like this:

$.validator.addMethod("dropdown", function(value, element) {
return this.optional(element) || element.selectedIndex>0;
},'');

Jörn

On Wed, Nov 5, 2008 at 6:23 PM, Pezza <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> Using JQuery + Validate plugin. When I create a new custom rule using
> a call to addMethod then use required:"myradio:checked" it will always
> trigger the validation to fail even if the radio is unchecked. This
> behaviour does not occur when you use the built in validation methods.
>
> $.validator.addMethod("dropdown", function(value, element) {
> return element.selectedIndex>0;
> },'');
>
> $("#myform").validate({
>rules:{
>mydropdown:{required:"#myradio:checked",dropdown:true}
>}
> });
>
> So even when #myradio is NOT checked the rule is saying that
> validation has failed. What I would like to happen would be for
> validated to check the "required" rule first, if the radio is
> unchecked then it should return valid and drop calls to any other
> validation methods.
>
> Any ideas or have I got something backwards.
>
> Thanks
>


[jQuery] Re: "on click" doesn't work!

2008-11-05 Thread MorningZ

Juts like Andy says

http://pastebin.com/m4cbd67f

btw, you wanted to use "change", not "click"   (as my code shows and
works)



On Nov 5, 12:49 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> It might help if you moved the jQuery code out of the HTML. It would help
> you focus on each seperately which could assist you in finding the problem.
> Plus, if you're just going to use jQuery inline, then why bother with using
> it at all?
>
> andy
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Miri
> Sent: Wednesday, November 05, 2008 10:53 AM
> To: jQuery (English)
> Subject: [jQuery] "on click" doesn't work!
>
> Hi everyone!
> I've been trying to find the problem in the code below, but I have no idea
> what it is.
> The problem is with the "on click" option - it just doesn't work..
> Can anyone please help me?!?!
> Thanks very much in advance..
> Miri.
>
> The code:
> #
> 
> #
>   Do you want to subscribe to our newsletter? #
>
> #
>   
> #
>      type="radio" name="subscribe" value="1" /> #
>     Yes, I want to subscribe #
>     
> #
>
> #
>      type="radio" name="subscribe" value="0" /> #
>     No, thanks
> #
>     
> #
>
> #
>     
> #
>       Email Address: 
> #
>        #
>     
> #
>   
> #
> 


[jQuery] Re: "on click" doesn't work!

2008-11-05 Thread Andy Matthews

It might help if you moved the jQuery code out of the HTML. It would help
you focus on each seperately which could assist you in finding the problem.
Plus, if you're just going to use jQuery inline, then why bother with using
it at all?


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Miri
Sent: Wednesday, November 05, 2008 10:53 AM
To: jQuery (English)
Subject: [jQuery] "on click" doesn't work!


Hi everyone!
I've been trying to find the problem in the code below, but I have no idea
what it is.
The problem is with the "on click" option - it just doesn't work..
Can anyone please help me?!?!
Thanks very much in advance..
Miri.

The code:
#

#
  Do you want to subscribe to our newsletter? #

#
  
#
 #
Yes, I want to subscribe #

#

#
 #
No, thanks
#

#

#

#
  Email Address: 
#
   #

#
  
#





[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Mike Alsup

> I have to disagree on this being a design flaw. This is one of my favorite
> design features of jQuery. I often think of it like SQL. You might construct
> a SQL statement like


I agree 100% with Richard.

One of the defining design characteristics of jQuery is how it
embodies implicit iteration.  So I can write this:

$('div').hide();

to hide all the divs on the page.  It doesn't matter if there are zero
divs or 100, they are all hidden.  Of course if I have a typo in my
code and execute something like this:

$('divv').hide();

no divs will be hidden.  But that does not make this a design flaw.
It makes it a typo.

Mike





[jQuery] Re: remove() Method Causes Flicker in Firefox

2008-11-05 Thread Joe

Any ideas on this?  Still stuck...

On Nov 1, 4:33 pm, Joe <[EMAIL PROTECTED]> wrote:
> I have to remove it, because the code directly following shows it
> loading the new image and appending it to the parent div.  So in order
> for the image that was faded out to not be there, it has to be
> removed.  Once all the rows of the table have been clicked on, they
> images are cached and then I can just alter the "src" attribute's
> value for the image.
>
> As far as the dimensions are concerned, I disagree.  The flicker only
> occurs in Firefox, and moreover, the images are dynamically created
> with a php script in the CMS that I built.  They all can't be the same
> size, because the images will never all be the same size, and in order
> to keep the aspect ratio intact, I have to allow them to have
> different widths and heights.
>
> So thanks for the suggestion, but still having an issue.
>
> And I'm glad you like the site...my own creation on the front end and
> all the work on the back end as well.
>
> Cheers.
>
> Joe
>
> www.subprint.com
>
> On Nov 1, 1:43 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > Not sure why you wouldremovethe photo... What happens when you hide
> > it.
>
> > On my G4 mac everything looks good except on the photo of "Little Dave
> > Thompson". It moves up and down as it comes in. Noflickerbut it
> > doesn't look right.
>
> > I think your problem is related to different dimension in your images.
> > When you display "Little Dave Thompson" you are removing an image with
> > different height dimensions. I'd recommend keep heights and widths the
> > same on all images. No need toremoveimages either. Just hide them,
> > check to see if they are there before you load them. (Easy to do in
> > JQuery)
>
> > The website looks great BTW. I have my own band (http://
> > RodeoClownsBand.com)
>
> > Regards,
>
> > -b
>
> > On Oct 31, 3:18 pm, Joe <[EMAIL PROTECTED]> wrote:
>
> > > Go here:
>
> > >http://www.theshedbbq.com/dev/franchise/events
>
> > > Click on one of the rows in the table and you'll see the image fade
> > > out and thenflicker.
>
> > > var livePhoto = $('img#eventImage');
> > > livePhoto.fadeOut('fast');
> > > livePhoto.remove();
>
> > > Not sure what is causing this but I use
> > > setTimeout( livePhoto.remove(), 50 but it did not work.
>
> > > Suggestions?


[jQuery] [validate] Issues using requred:#radio:checked with custom AddMethid validator

2008-11-05 Thread Pezza

Hi

Using JQuery + Validate plugin. When I create a new custom rule using
a call to addMethod then use required:"myradio:checked" it will always
trigger the validation to fail even if the radio is unchecked. This
behaviour does not occur when you use the built in validation methods.

$.validator.addMethod("dropdown", function(value, element) {
 return element.selectedIndex>0;
},'');

$("#myform").validate({
rules:{
mydropdown:{required:"#myradio:checked",dropdown:true}
}
});

So even when #myradio is NOT checked the rule is saying that
validation has failed. What I would like to happen would be for
validated to check the "required" rule first, if the radio is
unchecked then it should return valid and drop calls to any other
validation methods.

Any ideas or have I got something backwards.

Thanks


[jQuery] Day and Month Picker

2008-11-05 Thread Rob Bazinet

Hello;

I am new here, sorry if this may have been covered before but my
searching on the group did not return anything useful.

I need to be able to allow entry of just the month and day of a date,
no year.  I am aware of DatePicker but it doesn't seem to allow this.
Is there a way, using jQuery or a plugin, to accomplish this?

Right now I have two drop down lists, one for Month and the other for
Day but no validation is implemented for an invalid number of days in
a month if the user chooses Sept, they can choose 31 as the day.  I am
looking for the recommended best approach for this.

Thank you,
   Rob Bazinet


[jQuery] Accordion activate not working

2008-11-05 Thread KCWebMonkey

I have an accordion which i am trying to activate on page load, and
the .activate function doesn't appear to be working. can someone show
me how i'm implementing it incorrectly?

JavaScript:

$(document).ready(function() {
$('#childnav').accordion({
autoheight: false,
header: '.toggle',
event: 'click',
alwaysOpen: true,
active: false
});

$(".toggle").activate(0);
});

HTML:




About Us

Link 1
Link 2




New Homes

another link
another link




The Community

Arial PhotoGraph
Amenities
Schools
Utilities




News & Events

Link 1
Link 2
Link 1
Link 2
Link 1
Link 2




Contact Us

Link 1
Link 2
Link 1





[jQuery] "on click" doesn't work!

2008-11-05 Thread Miri

Hi everyone!
I've been trying to find the problem in the code below, but I have no
idea what it is.
The problem is with the "on click" option - it just doesn't work..
Can anyone please help me?!?!
Thanks very much in advance..
Miri.

The code:
#

#
  Do you want to subscribe to our newsletter?
#

#
  
#

#
Yes, I want to subscribe
#

#

#

#
No, thanks
#

#

#

#
  Email Address: 
#
  
#

#
  
#



[jQuery] Re: Trying to grasp basics of scrolling a TBODY

2008-11-05 Thread Jeffrey Kretz
Cool,

 

Glad you got it sorted out.

 

JK

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kenneth Downs
Sent: Wednesday, November 05, 2008 5:06 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Trying to grasp basics of scrolling a TBODY

 

Jeffrey Kretz wrote: 

Ken,

 

Do you have a test case page online somewhere I could take a look at?

 

I've successfully implemented a scrollTo-type function using offsets and
rows, and if I can see the page you're working with I might be able to
suggest something.


Jeffrey, thanks but I actually figured it out.  I made up a simple test,
which I'll be happy to post probably tomorrow.

What I realized is that there were a few more steps than I thought.  I had
figured that a TR would get an offset() automatically with respect to its
TBODY.  Instead I found I had to get the offset()  (or position, I forget
which one) for several items, and do a little arithmetic to get the position
of the TR relative to its TBODY.  Once I figured that out the remaining
arithmetic was fairly straightforward.

Also I realized I had to take into account the height of the TR, otherwise I
would scroll to the top of it and it would still be invisible :)




 

JK

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kenneth Downs
Sent: Sunday, November 02, 2008 3:58 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Trying to grasp basics of scrolling a TBODY

 

Dan Switzer wrote: 

Ken,

 

I'm trying to grasp the basics of scrolling to a particular row in a
TABLE.

Let's say you've got a TABLE, with a TBODY that has a fixed height and
overflow: scroll.

It appears I ought to be able to use core functions like offset() and
scrollTop() to work out where a row is and scroll the TBODY to that
position, but lots of trial and error has left me lost on why these
things don't seem to work as I expect.

The particular case I am looking at involves the user using arrow keys
to navigate up and down.  Its easy enough to use .next() to highlight
the next row, but if a user keeps doing it, and the next row is below
the viewable scroll region, I need to be able to slide up the display
to show the highlighted row.

This is an educational venture, not a practical one, I'd like to
understand it myself, not find and use a plugin that does it already.


Scrolling with the TBODY tag is spotty. IE6 doesn't support it at all--you
need to place your table in a DIV that has a fixed height and overflow set
to scroll.


Thankfully I have no interest in IE 6 :)

I currently have the DIV system you describe.  My best construction of why
it does not work is this:

1) There is a div that represents "TBODY".  It has "clear:both" as a CSS row
2) Each row is a div inside of the "TBODY" div
3) Each "cells" must be a div, firefox does not support widths on spans
(don't know about IE, doesn't matter if firefox won't do it)
4) The "cells" must be float: left
5) ...and at the end I get .offset() returning meaningless numbers for the
"row" divs.  All divs in the body return 0 as the offset.
6) For good measure, the .scrollTo() extension does not work at all on this
simulated TABLE, which I suspect is related to these bogus numbers.
7) I *think* the clear:both on the "tbody" div is causing this, but I really
don't know

So I monkeyed up a TABLE by hand and found all of the .offset() and related
functions appear to be giving real results, I just can't quite connect the
dots on how to put it all together.

FWIW, the only reason I used the entire simulated TABLE was because IE 7
does not support onclick() on a TR.  But I can just as well put the onclick
on TD elements and get where I need to go using a TABLE, if only I could
connect the dots on the scrolling stuff.






I'm not sure what browsers you're targeting, but if IE6 was one you were
having problems with, this is why.

-Dan







-- 
Kenneth Downs
Secure Data Software, Inc.
www.secdat.comwww.andromeda-project.org
631-689-7200   Fax: 631-689-0527
cell: 631-379-0010






-- 
Kenneth Downs
Secure Data Software, Inc.
www.secdat.comwww.andromeda-project.org
631-689-7200   Fax: 631-689-0527
cell: 631-379-0010


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Jeffrey Kretz

Richard is exactly correct IMO.

The separation of HTML and Javascript allows you do write more general
javascript in attached scripts that can be applied to any page.

$('img.ihover').hover( /* Do stuff */ );

Any pages with image class="ihover" will get the hover function.

Nothing will happen on pages with NO images that fit that criteria.

At any time you MUST have a result, you can do something like this:

var imgs = $('img.ihover');
if (!imgs.length)
{
   alert('No hover images found!');
}

It leaves it up to the developer to decide which selections are required and
which aren’t.

This isn't a flaw at all, it is part-and-parcel to the jquery philosophy:

1. Grab some elements
2. Do something to them.

JK




From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Richard D. Worth
Sent: Wednesday, November 05, 2008 8:22 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Can I make jquery not fail silently??


On Wed, Nov 5, 2008 at 10:08 AM, brian <[EMAIL PROTECTED]>
wrote:


> It's not a failure to run a query and find nothing - that's a
> perfectly valid use case.
I understand where you are coming from on the querying side, but
shouldn't calling a method on an empty object fail?  How can I fade
in...nothing?

The same way you can write a for-loop to loop over every item in an array of
integers and sum their values all together. If the array you provide to the
loop has a length 0, your sum is zero. Does that mean your loop should fail
because it went through 0 iterations?

You can read it as "Fade in any elements that match this query at this
time".
 

I'm going to still think of this as a huge design flaw.

I have to disagree on this being a design flaw. This is one of my favorite
design features of jQuery. I often think of it like SQL. You might construct
a SQL statement like

DELETE FROM tblUsers WHERE userid = 18

or

UPDATE tblUsers SET age=5 WHERE age=4

If no records match the query, nothing happens. But that doesn't make the
query or the statement invalid. Neither do you get an exception/warning. So
the $(selector) part of jQuery is like the WHERE clause, and the method you
call is like the DELETE, or UPDATE, SET.

Wouldn't the alternative be that you would have to check the length of the
jQuery object before every single method call?

- Richard



[jQuery] Re: Cycle Plug-in works with ajax on first call, not on subsquent calls

2008-11-05 Thread pedalpete

My apologies Mike,

I am using firebug with Firefox, and hadn't seen that error in quite a
while, I then realized that from my first post on this subject to when
you re-requested the url, I had re-introduced the error on the testing
site.

Now combining the fix with stopping and emptying the cycle, it all
seems to be working.

Thanks Mike, this plug-in is awesome!

On Nov 5, 4:14 am, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > Thanks Mike, here's the link and a description of how to get it to not
> > work..
>
> >http://zifimusic.com/cycle
>
> I'm guessing that you're not using Firefox with Firebug.  If you were,
> you could set a breakpoint and see that your 'allPops' div contains
> only a single element after the ajax call, so the markup is not as you
> expect when you callcyclethe 2nd time.  In addition,cyclelogs this
> message:
>
> [cycle] terminating; too few slides: 1
>
> Mike


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread Richard D. Worth
On Wed, Nov 5, 2008 at 10:08 AM, brian <[EMAIL PROTECTED]>wrote:

>
>
> > It's not a failure to run a query and find nothing - that's a
> > perfectly valid use case.
>
> I understand where you are coming from on the querying side, but
> shouldn't calling a method on an empty object fail?  How can I fade
> in...nothing?


The same way you can write a for-loop to loop over every item in an array of
integers and sum their values all together. If the array you provide to the
loop has a length 0, your sum is zero. Does that mean your loop should fail
because it went through 0 iterations?

You can read it as "Fade in any elements that match this query at this
time".


>
> I'm going to still think of this as a huge design flaw.


I have to disagree on this being a design flaw. This is one of my favorite
design features of jQuery. I often think of it like SQL. You might construct
a SQL statement like

DELETE FROM tblUsers WHERE userid = 18

or

UPDATE tblUsers SET age=5 WHERE age=4

If no records match the query, nothing happens. But that doesn't make the
query or the statement invalid. Neither do you get an exception/warning. So
the $(selector) part of jQuery is like the WHERE clause, and the method you
call is like the DELETE, or UPDATE, SET.

Wouldn't the alternative be that you would have to check the length of the
jQuery object before every single method call?

- Richard


[jQuery] [datepicker] 26 october occuring two times: datepicker bug?

2008-11-05 Thread Gauthier Segay

Hello,

I've weird thing with datepicker, my dates are offset by one day (13
november 2008 is friday), when checking where the inconsistency come,
I've find that 26 october is occuring twice.

Here is how I instanciate datepicker :

$('myselector').datepicker({dateFormat:'dd/mm/yy'});

Does the fact that the UTC offset changed (daylight saving time) at
this very date is a reason for such bug? any idea how can I workaround
it?

Thanks


[jQuery] Re: Best event for changing the content of a div?

2008-11-05 Thread Klaus Hartl

If you don't want to put a script after the div it won't get any
faster then DOM ready.

You could although poll for that element. Say it had an id of
'asap' (untested):

(function() {
var f = function() {
var div = document.getElementById('asap');
if (div) {
// alter content here...
} else {
setTimeout(f, 30);
}
};
f();
})();


--Klaus


On 5 Nov., 16:30, the_woodsman <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to change the content of a div asap.
>
> I know about document.ready, but if possible I'd rather do this
> earlier. I'd also rather do it as an event instead of loading a script
> file after the div appears in the page.
>
> I tried the load() event, but this didn't seem to fire at all.
>
> Anyone got any tips on this?


[jQuery] Best event for changing the content of a div?

2008-11-05 Thread the_woodsman

Hi,

I want to change the content of a div asap.

I know about document.ready, but if possible I'd rather do this
earlier. I'd also rather do it as an event instead of loading a script
file after the div appears in the page.

I tried the load() event, but this didn't seem to fire at all.

Anyone got any tips on this?


[jQuery] Re: Advice on sIEve/Drip?

2008-11-05 Thread Josh Nathanson


An important aspect of this is to focus on what happens when you reload the 
page or navigate away.  If the memory drops back down to its original state, 
you have helped the end user by not leaving them a "legacy" of used memory. 
It's much more difficult to try and keep memory from climbing in the first 
place.  If you can make it so the memory is reclaimed when you unload the 
page, you have gone a long way in helping the user.


-- Josh



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

To: "jQuery (English)" 
Sent: Wednesday, November 05, 2008 6:14 AM
Subject: [jQuery] Re: Advice on sIEve/Drip?





On Nov 4, 12:20 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:

OUCH.

With over 25,000 lines of javascript code (full featured CMS) that's a
nightmare to track down.

Am I out of luck? Are there no other alternative tools like sIEve that are
still in development?



Hi,

there is another tool by microsoft, you can try:
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx

but this tool doesn´t find all memory leaks.

this jquery-related info could be helpfull, too:
http://groups.google.com/group/jquery-dev/browse_thread/thread/4a99f6e9b2e33057/30099a04db7f87b9
http://www.outsidethediv.com/2008/10/removechild-vs-the-garbage-bin/

One last advice. You don´t have to fix all memory leaks in IE6. It
really depends on the cost-benefit-ratio (hard effort/work to fix it
vs. noticeable advancement for the enduser).

regards
alex 



[jQuery] Re: remote issue

2008-11-05 Thread Alexsandro_xpt

P.S.

I am mean about NewsLetter Form, find it on middle of the page in the
next text "Receba nosso informativo por e-mail:"


Thz.



On 5 nov, 13:17, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:
> Inhttp://jquery.bassistance.de/validate/demo/milk/valid on key down
> events, how is it work?
>
> On 5 nov, 13:15, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:
>
> > Why validate athttp://www.assessoriatecnica.com.brfiresubmit event
> > before remote is valid?


[jQuery] Re: Can Jquery fetch file, and display download dialog?

2008-11-05 Thread Bil Corry

tlphipps wrote on 11/5/2008 8:45 AM: 
> The default action for handling .mp3 downloads is determined by the
> user's browser and you cannot change that from your end.  But you can
> create specific server-side headers that will instruct the browser to
> download the file as an 'attachment' instead of trying to simply open
> the document.
> 
> The specific headers you need are:
> "Content-Disposition: attachment; filename="01-01-08-PM.mp3"

There are a couple of new header options recognized by IE8 that improve 
security for IE and tell it to force download.  They look like this:

Content-Type: audio/mpeg; authoritative=true;
X-Download-Options: noopen

You can read about "authoritative=true;" and "X-Download-Options" here:


http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx


- Bil



[jQuery] Re: remote issue

2008-11-05 Thread Alexsandro_xpt

In http://jquery.bassistance.de/validate/demo/milk/ valid on key down
events, how is it work?




On 5 nov, 13:15, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:
> Why validate athttp://www.assessoriatecnica.com.brfire submit event
> before remote is valid?


[jQuery] [validate] remote issue

2008-11-05 Thread Alexsandro_xpt

Why validate at http://www.assessoriatecnica.com.br fire submit event
before remote is valid?


[jQuery] Re: Can I make jquery not fail silently??

2008-11-05 Thread brian


> It's not a failure to run a query and find nothing - that's a
> perfectly valid use case.

I understand where you are coming from on the querying side, but
shouldn't calling a method on an empty object fail?  How can I fade
in...nothing?

I'm going to still think of this as a huge design flaw.

There needs to be a way to specify that it should fail on empty
results.  /s for strict or whatever.

This post is for 1) bitching purposes and 2) indexing purposes so that
future searchers find definitive proof that jquery fails silently and
that this is not considered a bug, despite obvious appearances.


[jQuery] please help with accordion

2008-11-05 Thread powrtoch


sorry to repost, but i'm really stumped on this one. what ive got is a very
basic accordion menu, but it performs really strangely in IE 7, shifting the
entire document below it and just looking terrible. you can see the problem
at

http://www.bulldogbucks.uga.edu/index2.html

and a basically-identical, but not integrated into any page, working version
at

http://www.bulldogbucks.uga.edu/accordion/jquery.accordion/jquery-accordion/demo/

any advice you can give me would be really appreciated, thanks!
-- 
View this message in context: 
http://www.nabble.com/please-help-with-accordion-tp20343174s27240p20343174.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Can Jquery fetch file, and display download dialog?

2008-11-05 Thread tlphipps

This is not something javascript/jquery can solve.  From a web
developer standpoint, you really only have one option and that is to
create server-side code (ASP, PHP, etc.) that will force a file
download box.

The default action for handling .mp3 downloads is determined by the
user's browser and you cannot change that from your end.  But you can
create specific server-side headers that will instruct the browser to
download the file as an 'attachment' instead of trying to simply open
the document.

The specific headers you need are:
"Content-Disposition: attachment; filename="01-01-08-PM.mp3"

On Nov 5, 8:11 am, Genu <[EMAIL PROTECTED]> wrote:
> Hey, thanks for the reply. I tried the above function, and now the
> link just doesn't do anything when I click on it. I don't understand
> where you got '.dialogBox' from, however.


[jQuery] Re: Advice on sIEve/Drip?

2008-11-05 Thread trixta



On Nov 4, 12:20 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> OUCH.
>
> With over 25,000 lines of javascript code (full featured CMS) that's a
> nightmare to track down.
>
> Am I out of luck?  Are there no other alternative tools like sIEve that are
> still in development?
>

Hi,

there is another tool by microsoft, you can try:
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx

but this tool doesn´t find all memory leaks.

this jquery-related info could be helpfull, too:
http://groups.google.com/group/jquery-dev/browse_thread/thread/4a99f6e9b2e33057/30099a04db7f87b9
http://www.outsidethediv.com/2008/10/removechild-vs-the-garbage-bin/

One last advice. You don´t have to fix all memory leaks in IE6. It
really depends on the cost-benefit-ratio (hard effort/work to fix it
vs. noticeable advancement for the enduser).

regards
alex


[jQuery] Re: Can Jquery fetch file, and display download dialog?

2008-11-05 Thread Genu

Hey, thanks for the reply. I tried the above function, and now the
link just doesn't do anything when I click on it. I don't understand
where you got '.dialogBox' from, however.


[jQuery] Re: multiple select boxes with the same name submiting via ajax

2008-11-05 Thread tlphipps

By using the # character in your selector, you're indicating that you
are targeting the element by ID. Having multiple items on a page with
the same ID will not work.

I would suggest you create a special class for these selects and then
target them that way.

example:





> $(document).ready(function(){
> $("select.priority").change(function() {
>
> jQuery.ajax({
> data: "prio=" + $(this).val() + "&ID=1",
> url: "do_priority.asp",
> timeout: 2000,
> error: function() {
>   console.log("Failed to submit");
> },
> success: function(r) {
>   $(this).removeAttr("disabled");
> }
>   });
>
> $(this).attr("disabled", "disabled");
>
> });
>
> });


On Nov 5, 6:18 am, williamstam <[EMAIL PROTECTED]> wrote:
> hi
>
> i hope somone can help
>
> i have a couple of records which all have (the idea anyways) have
> select boxes. when a user changes the select box it submits those
> changes and the record ID to another page using ajax to update the
> database. so far i have
>
> $(document).ready(function(){
>         $("#priority").change(function() {
>
>                 jQuery.ajax({
>             data: "prio=" + $("#priority").val() + "&ID=1",
>             url: "do_priority.asp",
>             timeout: 2000,
>             error: function() {
>               console.log("Failed to submit");
>             },
>             success: function(r) {
>               $("#priority").removeAttr("disabled");
>             }
>           });
>
> $("#priority").attr("disabled", "disabled");
>
>         });
>
> });
>
> it works like a charm with 1 record... as soon as there are more
> records it fails. i presume this is cause its finding multiple '$
> ("#priority")' select boxes in the page?
>
> the above code when you change the value of a select box it disables
> the box till ajax says that it "worked" then re enables it again.
>
> regards
>
> william


[jQuery] Re: Google Charts

2008-11-05 Thread Choan Gálvez


On Nov 5, 2008, at 5:59 AM, moscorp wrote:



gchart can't recognize series data in barVert...

can't work in
var valueArray = $('#mpngicnt').text(); //80,30,50
series: [ $.gchart.series([ valueArray ], 'red')],

but it works in
series: [ $.gchart.series([ 80,30,50 ], 'red')],

how can i solve it !


`$('selector').text()` returns a string. From what I read in your  
working code, you need to pass an array.


var valueArray = $.trim($('#mpngicnt').text()).split(','); //  
[ 80, 30, 50 ]

// I assume there is some code in the middle
series: [ $.gchart.series(valueArray, 'red')]

Now, back to jQuery related posts.
--
Choan


[jQuery] Re: jCarousel, localScroll, other options?

2008-11-05 Thread Ariel Flesler

Maybe SerialScroll ?

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

On Nov 5, 10:45 am, genius switch <[EMAIL PROTECTED]> wrote:
> Here is my issue, I have used jCarousel to accomplish what I need...
> however the markup is bothering my anal tendencies for pure
> semantics.
>
> I'm using jCarousel to scroll content blocks in a sexy way, however,
> in order to use jCarousel I must have my content blocks inside a list,
> each as a list item. This validates, and is functioning exactly how I
> want it to, however I can't get past the fact that this markup doesn't
> make sense.
>
> LocalScroll is my other option, but it doesn't slide sexy the way
> jCarousel does. Does anyone have any advice?
>
> Here is the test page:http://www.geniusswitchstudio.com/v2/template.htm
>
> Thanks!
>
> - C


[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-05 Thread Choan Gálvez


Hi.

On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:



Hi,

I'm trying do return a JSON with a $.ajax() method.

here is my entire function:

function carregaMes(d){
 if(!(_reunioes["reg"+d.month+d.year])){
$.ajax({
url: "reunioes.jsp",
data: "mes="+d.month+"&ano="+d.year,
async: false,
dataType: "json",
success: function(a){
_reunioes["reg"+d.month+d.year] = a;
}
});
return _reunioes["reg"+d.month+d.year];
 } else {
return _reunioes["reg"+d.month+d.year];
 }
}

Where _reunioes is an array in window object.

In FF its ok, but in IE its return "undefined". I tried to call a
normal ajax and use the jQuery.httpData() method to covert my xhr into
a JSON, but my IE tell me that in line where jQuery tries to convert
( data = eval("("+data+")"); ) has an error "Indentifier, sequency or
number expected".


I'd bet the input is not valid JSON. Check for extra commas at the end  
of your JSON array definition.


Best.
--
Choan


[jQuery] Re: best way to pass parameters to .load()

2008-11-05 Thread Choan Gálvez


Hi.

On Nov 5, 2008, at 1:02 AM, HiddenPhoenix wrote:



is there a difference in passing parameters to .load

$("#myDiv").load("myScript.php?var=x&var2=y&var3=z")

vs

$("#myDiv").load("myScript.php", {var:x, var2:y, var3:z})


In the first case, a GET request is performed. In the latter, the  
request is POSTed.




also is there a size limit to how much .load can handle? can
myScript.php return a couple hundred rows of data without issue?


You can return as much data as you want, it won't be a problem. But,  
adding lots of nodes to the document can be time consuming.


--
Choan


[jQuery] Re: Ajax cross site (same domain) problems

2008-11-05 Thread kudu

Thanks for the suggestion, I have checked document.domain and it
consistently reflects the correct (i.e. base domain) value. I have
gone to the extent of seting this very early in the process before any
other javascript has loaded and the problem persists.

On Nov 5, 7:43 am, ricardobeat <[EMAIL PROTECTED]> wrote:
> It should. Check your document.domain after all scripts have run to
> see if it's really changed.
>
> On Nov 4, 8:07 pm, kudu <[EMAIL PROTECTED]> wrote:
>
> > I am attempting to call page through ajax accross different sites
> > within the same doman.
> > The error displayed is: Access to restricted URI denied" code: "1012"
> > I have set  document.domain to reflect the shared domain
>
> > i.e.
> > calling foo.baz.com/myscript.php
> > from bar.baz.com
> > having set document.domain = "baz.com"
>
> > My understanding is that setting document.domain should open up the
> > same origin policy to allow calls between sub-domains within the same
> > base domain.


[jQuery] Re: Toggle and Nested Divs

2008-11-05 Thread n8cshaw

Thanks Ricardo. I have put the code up at http://jsbin.com/atiza

As for the double quotes on the Velocity call, those are evaluated on
the server prior to being sent to the client, so no worries there.

I appreciate the help with this! It seems like this should be a very
easy thing to do (I did the exact same thing with Prototype/
Scriptaculous on another site). I am not sure what I am missing.



On Nov 5, 7:27 am, ricardobeat <[EMAIL PROTECTED]> wrote:
> Try providing a test page or pasting your code 
> atwww.pastie.orgorwww.jsbin.com, that way people can actually read it! :)
>
> Can't figure out from this code what might be wrong, it's probably an
> event bubbling issue.
>
> And you have src="$content.getURI("images/icon_plus.gif")" that will
> cause serious parsing errors on the browser, use single quotes inside.
>
> - ricardo
>
> On Nov 4, 7:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > Hi all.
>
> > I have an outer div that contains several child divs (event search
> > form that lets the user pick dates, categories, etc...). The user can
> > toggle the outer div and the child divs as well. This all works for me
> > AS LONG AS the outer div is visible and not able to be toggled. When I
> > let the user toggle the outer div, when the outer div is toggled to
> > visible and the user tries to toggle a child div, the child div opens
> > and then closes again right away.
>
> > I believe this is happening because the child div is somehow
> > inheriting the parent's visibility. I debugged it and
> > showHideExactDates() is being run twice. So, it seems like it is
> > starting out as visible, even though it is not visible on the form.
>
> > Here is a snippet of the code:
>
> >  > src="$content.getURI("images/icon_plus.gif")"
> > name="searchFormShowHideIcon" id="searchFormShowHideIcon" border="0"
> > align="left" alt="+" />  > id="searchFormShowHideLink_text">Search Form
>
> > 
> >> title="show/hide exact date form fields"> > src="$content.getURI("images/icon_plus.gif")"
> > name="dateExactShowHideIcon" id="dateExactShowHideIcon" border="0"
> > align="left" alt="+" />  > id="dateExactShowHideLink_text">Specify Exact Dates
> > 
> > Occurs between  > name="dateRangeStartMonth" id="dateRangeStartMonth" title="date range
> > start month" value="$!dateRangeStartMonth" maxlength="2">/
> >  > id="dateRangeStartDay" title="date range start day" value="$!
> > dateRangeStartDay" maxlength="2">/
> >  > id="dateRangeStartYear" title="date range start year" value="$!
> > dateRangeStartYear" maxlength="4"> > id="dateRangeStartCalendarLink" title="event range start calendar date
> > picker"> > alt="Choose range start date" border="0" align="absmiddle"> 
> > and  > id="dateRangeEndMonth" title="date range end month" value="$!
> > dateRangeEndMonth" maxlength="2">/
> >  > id="dateRangeEndDay" title="date range end day" value="$!
> > dateRangeEndDay" maxlength="2">/
> >  > id="dateRangeEndYear" title="date range end year" value="$!
> > dateRangeEndYear" maxlength="4"> > id="dateRangeEndCalendarLink" title="event range end calendar date
> > picker"> > alt="Choose range end date" border="0" align="absmiddle">
> > 
> > 
>
> > function showHideSearchForm() {
> > jq("#eventSearchFormDiv").toggle("blind", {}, 1000);
> > }
>
> > //add the form submit handler
> > jq(document).ready(function() {
> > jq("#searchFormShowHideLink_image").click(showHideSearchForm);
> > jq("#searchFormShowHideLink_text").click(showHideSearchForm);
> > });
>
> > function showHideExactDates() {
> > alert("running showHideExactDates()");
> > jq("#dateExactDiv").toggle("blind", {}, 1000);
> > }
>
> > //add the form submit handler
> > jq(document).ready(function() {
> > jq("#dateExactShowHideLink_image").click(showHideExactDates);
> > jq("#dateExactShowHideLink_text").click(showHideExactDates);
> > jq("#dateRangeStartCalendarLink").datepicker();
> > jq("#dateRangeEndCalendarLink").datepicker();
> > });
>
> > Help please! I have been banging my head on this now for several
> > hours!
>
> > Thanks.


[jQuery] Re: Ajax cross site (same domain) problems

2008-11-05 Thread ricardobeat

It should. Check your document.domain after all scripts have run to
see if it's really changed.

On Nov 4, 8:07 pm, kudu <[EMAIL PROTECTED]> wrote:
> I am attempting to call page through ajax accross different sites
> within the same doman.
> The error displayed is: Access to restricted URI denied" code: "1012"
> I have set  document.domain to reflect the shared domain
>
> i.e.
> calling foo.baz.com/myscript.php
> from bar.baz.com
> having set document.domain = "baz.com"
>
> My understanding is that setting document.domain should open up the
> same origin policy to allow calls between sub-domains within the same
> base domain.


[jQuery] Re: order of script not right (explained inside)

2008-11-05 Thread FastNOC


My god. I cannot believe I dind't think of something so elemental.

Thank you!

ricardobeat wrote:
> 
> 
> CSS z-index property: http://www.w3schools.com/Css/pr_pos_z-index.asp
> 
> #dropdownpanel { z-index: 1 }
> 
> cheers,
> - ricardo
> 
> On Nov 5, 2:00 am, FastNOC <[EMAIL PROTECTED]> wrote:
>> I'm doing development on two sites right now. both are quite far from
>> finished. I liked the panel script
>> fromhttp://www.javascriptkit.com/script/script2/dropdownpanel.shtmlhere
>>  and it
>> works. You can see it here: (no this isn't advertising. almost all links
>> are
>> dead, there's no content and nothing to
>> buy).http://15.e-referrer.com/cms/index.php/red/tips/First Webiste (it
>> works
>> fine here)  (FYI it's a panel that comes down from the top when you click
>> the black button that says 'member login')
>>
>> Now, I decided to add it to the next site to use just the same. It works,
>> but the order is off and it's appearing underneath everything else on the
>> page. I can't figure out why. At first I thought it might be the order of
>> the css elements but that's not it.
>>
>> Can anyone take a guess why this is happening?
>>
>> http://e-places.net/index.phpSecond site where it's broke
>> --
>> View this message in
>> context:http://www.nabble.com/order-of-script-not-right-%28explained-inside%2...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/order-of-script-not-right-%28explained-inside%29-tp20335896s27240p20341371.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



  1   2   >