[jQuery] Re: Jquery simple problem

2009-04-01 Thread Nabeel Faruqui

remember that on this page we are using the ATLAS control also. I
think AJAX Atlas might be creating the issue. any resolutions ?

On Apr 1, 4:03 pm, Nabeel Faruqui  wrote:
> Hi,
> This is my simple jquery code. I have included it in the head of html
> document.
>
> 
>         jQuery(function() {
>                  jQuery('#slickbox').hide('fast');
>
>             jQuery('#slick-toggle').click(function() {
>         jQuery('#slickbox').toggle('blind',350);
>         return false;
>       });
>
>         });
>         
>
> the problem is that every time AJAX postback occures, and when i click
> the slickbox button, it is fired as many times the AJAX postback
> occures. i.e. If 3 postbacks, the slickbox.click function is fired 3
> times. I dont want that. I need that to be fired only one time.
>
> Let me know.


[jQuery] Re: Append asterisk to required field labels

2009-04-01 Thread JT

Example using CSS.

YOUR HTML

First Name

YOUR CSS
label.required:after {
content: ' *';
}

RESULT: First Name *

OR

label.required:before {
content: '* ';
}

RESULT: * First Name


[jQuery] just in Firefox 3.0.8 $ is not defined

2009-04-01 Thread Asinox

Hi, i dont know what happen but just in FF, Jquery show error

error:

$ is not defined


my code:


$(document).ready(function(){
 $('#demoOne').listnav();
});


yes, i have the url to the jquery and the plugin in nice place, but
idont know why just Firefox




[jQuery] Re: Append asterisk to required field labels

2009-04-01 Thread RobG



On Apr 1, 10:56 am, Baum  wrote:
> Hi,
>
> I am looking to use jQuery in conjunction with xVal for validation.
> One of the cool things I though jQuery would allow me to do is append
> an asterisk (*) to the label of "ALL" my fields that have a css class
> of "required". The example below only applies the asterisk to the
> first field.

How about using CSS?


--
Rob


[jQuery] jQuery live to have the original livequery plugin function: on element add binding?

2009-04-01 Thread goodwill

I wonder if jQuery core live function could have such functionality?
Now I am mixing both together, but there are some weird issues could
occur- like if I am trying to encapsulate a livequery to trigger when
a new div is added and setup live hook within, multiple hooks might
occur (i.e. the event function is called twice). I tried to replace my
inner function with livequery plugin too and the problem goes away, so
its somewhat the compatibility between the livequery and live
function. Ideally if the core live can gain the same function in
livequery, I could merge the code back and have one less plugin.


[jQuery] Re: Ajax Errors with Firefox 3.0.8 (latest release)

2009-04-01 Thread tallvanilla


Thanks James.

It would probably take an hour or more to reproduce a demo of the
errors in a publicly-accessible space, so I'm hoping this is a known
issue by now and that anyone who's also experienced it can shed some
light on it.

I had already checked the Mozilla security updates page. I don't
really understand it, but it all seems to deal with changes to XSL and
XUL. Doesn't this have something essential to do with how AJAX works?
The AJAX error message that Firefox 3.0.8 triggers in jQuery's AJAX
functions returns an XHR status of "200" and an XHR status text of
"OK".

jQuery version is 1.2.6. Probably not old enough to be the issue. Any
thoughts?

JOSH




On Apr 1, 5:22 pm, James  wrote:
> I have not experienced such issues using FF3.0.8 and the latest
> version of jQuery (1.3.2).
> Which version of jQuery are you using?
>
> If possible, are you able to provide some code or samples of the
> content being transferred that's not working?
> Here's the Security Updates page for 
> FF3.0.8:http://www.mozilla.org/security/known-vulnerabilities/firefox30.html#...
>
> On Apr 1, 1:08 pm, tallvanilla  wrote:
>
> > Many of our websites users began reporting AJAX errors on all jQuery-
> > enabled pages of our website. The common factor among these users is
> > that all are using the latest update to Firefox: version 3.0.8. From
> > what I've gathered, it might only affect "get" requests, but I can't
> > be sure of that yet.
>
> > Has anyone else experienced this problem yet, or is this too new to
> > have been identified as a bug? Is it more likely a bug in Firefox than
> > jQuery?
>
> > Unfortunately, I have no links to post. This all occurs in a secure,
> > members-only area of our website.
>
> > JOSH


[jQuery] Re: DOM manipulation

2009-04-01 Thread Mauricio (Maujor) Samy Silva




   $('.wrapper').height = '1000px';
and that will not work, because we don't have $('.wrapper') in working
what should I do, to accomplish the desirable result?


$('.wrapper').css('height', '1000px');

Maurício 



[jQuery] Re: DOM manipulation

2009-04-01 Thread James

Try:
$('.wrapper').height(1000);

On Apr 1, 2:49 pm, gryzzly  wrote:
> Hello.
> Let's say I have
> $(document).ready(function() {
>     $('.niceImage, .hiddenText').wrapAll(' div>');});
>
> then I want to access newly inserted to the DOM div with class wrapper
> and do something with it;
> $(document).ready(function() {
>     $('.niceImage, .hiddenText').wrapAll(' div>');
>     $('.wrapper').height = '1000px';});
>
> and that will not work, because we don't have $('.wrapper') in working
> copy of DOM.
>
> what should I do, to accomplish the desirable result?


[jQuery] DOM manipulation

2009-04-01 Thread gryzzly

Hello.
Let's say I have
$(document).ready(function() {
$('.niceImage, .hiddenText').wrapAll('');
});
then I want to access newly inserted to the DOM div with class wrapper
and do something with it;
$(document).ready(function() {
$('.niceImage, .hiddenText').wrapAll('');
$('.wrapper').height = '1000px';
});
and that will not work, because we don't have $('.wrapper') in working
copy of DOM.

what should I do, to accomplish the desirable result?


[jQuery] Re: will two JQuery libs conflicts?

2009-04-01 Thread brian

On Wed, Apr 1, 2009 at 8:03 PM, RobG  wrote:
>
>
>
> On Apr 2, 1:51 am, brian  wrote:
>> On Wed, Apr 1, 2009 at 11:01 AM, Xu  wrote:
>>
>> > Thanks. Can you elaborate it?
>> > You seem to suggest if my web page includes their actual JQuery file,
>> > there will be for sure problems.  Why is that? Thanks.
>>
>> Because you'll be redeclaring the methods. If you load a page like
>> this, you'll get an error:
>>
>> function foo()
>> {
>>   alert('foo');
>> }
>>
>> function foo()
>> {
>>   alert('foo again');
>> }
>
>
> Not necessarily.  The second declaration replaces the first, any call
> to foo will call the second function.  An error will only occur if the
> second function itself creates an error - if so, it will happen even
> if the first declaration is removed.
>

Oh, right--javascript!


[jQuery] Re: Ajax Errors with Firefox 3.0.8 (latest release)

2009-04-01 Thread James

I have not experienced such issues using FF3.0.8 and the latest
version of jQuery (1.3.2).
Which version of jQuery are you using?

If possible, are you able to provide some code or samples of the
content being transferred that's not working?
Here's the Security Updates page for FF3.0.8:
http://www.mozilla.org/security/known-vulnerabilities/firefox30.html#firefox3.0.8

On Apr 1, 1:08 pm, tallvanilla  wrote:
> Many of our websites users began reporting AJAX errors on all jQuery-
> enabled pages of our website. The common factor among these users is
> that all are using the latest update to Firefox: version 3.0.8. From
> what I've gathered, it might only affect "get" requests, but I can't
> be sure of that yet.
>
> Has anyone else experienced this problem yet, or is this too new to
> have been identified as a bug? Is it more likely a bug in Firefox than
> jQuery?
>
> Unfortunately, I have no links to post. This all occurs in a secure,
> members-only area of our website.
>
> JOSH


[jQuery] Re: will two JQuery libs conflicts?

2009-04-01 Thread RobG



On Apr 2, 1:51 am, brian  wrote:
> On Wed, Apr 1, 2009 at 11:01 AM, Xu  wrote:
>
> > Thanks. Can you elaborate it?
> > You seem to suggest if my web page includes their actual JQuery file,
> > there will be for sure problems.  Why is that? Thanks.
>
> Because you'll be redeclaring the methods. If you load a page like
> this, you'll get an error:
>
> function foo()
> {
>   alert('foo');
> }
>
> function foo()
> {
>   alert('foo again');
> }


Not necessarily.  The second declaration replaces the first, any call
to foo will call the second function.  An error will only occur if the
second function itself creates an error - if so, it will happen even
if the first declaration is removed.


--
Rob


[jQuery] Re: jQuery/ HTML help needed

2009-04-01 Thread Warfang

Woah, thanks! It worked! I was bent on the idea that selectors had to
have quotation marks. I suppose (in this case at least) thats untrue.
Thank you.

On Mar 31, 11:14 pm, Ricardo  wrote:
> Actually this is the perfect opportunity to put those href's into use:
>
> 
>         slide 1
>         slide 2
>         slide 3
> 
>
> 
>         slide 1
>         slide 2
>         slide 3
> 
>
> The script:
> $('#tab_links a').click(function(){
>    var activeTab = $(this).attr('href');
>    $(activeTab).fadeIn(500);
>    return false;
>
> });
>
> Even with your way you could have kept the IDs valid and have it work
> the same:
> ...
> slide 2
>
> var activeTab = $(this).attr('id').substring(5);
> $('#'+activeTab).fadeIn(500);
>
> (you could also use $(this).attr('id').replace('link_', '') )
>
> cheers,
> - ricardo
> On Mar 31, 10:25 pm, James  wrote:
>
> > You're making it more complicated than it really is.
> > Using something similar to Jonathan's method:
>
> > // Change your id to something like 'link_1', like here:
> > slide 1
>
> > var activeTabID = $(this).attr('id');  // -> link_1
> > var activeTab = activeTabID.split('_')[1];  // -> 1
> > $('#tab_'+activeTab).fadeIn(500);  // fadeIn element with ID 'tab_1'
>
> > On Mar 31, 3:04 pm, Warfang  wrote:
>
> > > Could I do something like this?...
>
> > >   var activeTab = $(this).attr('id');
> > >   $(''#(activeTab)'').fadeIn(500);
>
> > > Those are two single quotes by the way. That is what I would like to
> > > accomplish.


[jQuery] Ajax Errors with Firefox 3.0.8 (latest release)

2009-04-01 Thread tallvanilla

Many of our websites users began reporting AJAX errors on all jQuery-
enabled pages of our website. The common factor among these users is
that all are using the latest update to Firefox: version 3.0.8. From
what I've gathered, it might only affect "get" requests, but I can't
be sure of that yet.

Has anyone else experienced this problem yet, or is this too new to
have been identified as a bug? Is it more likely a bug in Firefox than
jQuery?

Unfortunately, I have no links to post. This all occurs in a secure,
members-only area of our website.

JOSH


[jQuery] Re: Append asterisk to required field labels

2009-04-01 Thread James

I'm not sure what the asp.net MVC release of jquery is and if it's
been modified from the original, but on my 1.3.2 (from jquery.com),
the code works. So there is no problem with jQuery 1.3.2 regarding each
().
There must be something else that's causing the issue. Do you still
have somewhere in your code the deprecated syntax with the @ in the
selectors?
Eg. $("inp...@type=text]")

On Mar 31, 5:51 pm, Baum  wrote:
> Thanks James.
>
> I am just getting started with jQuery so the syntax is rather new.
> What I found is that the jquery-1.3.2.js file that I am using as part
> of the asp.net MVC release does not appear to work with each syntax (I
> only get the first input field back). I reverted back to 1.2.6 and it
> appears to work.
>
> This leads me to believe there is a problem with 1.3.2...
>
> Baum
>
> On Mar 31, 9:04 pm, James  wrote:
>
> > How about something like:
>
> > $required = $(".required"); // list of elements with 'required' class.
> > $.each($required, function(i) {
> >      var id = $(this).attr('id');
> >      var $label = $("label[for="+id+"]");
> >      $label.text( $label.text()+'*' );
>
> > });
>
> > The requirement is that all your .required input's ID should have a
> > corresponding label with a matching 'for' ID. (It's not going to bomb
> > or anything if it doesn't.)
>
> > On Mar 31, 3:46 pm, Baum  wrote:
>
> > > One note the javascript included in the original post is incorrect...I
> > > was playing around and pasted the wrong copy...remove the each(). Also
> > > var size = $(".required").size(); is equal to 1 but var size = $
> > > ("input").size(); is equal to 2.
>
> > > Thanks.
>
> > > On Mar 31, 7:56 pm, Baum  wrote:
>
> > > > Hi,
>
> > > > I am looking to use jQuery in conjunction with xVal for validation.
> > > > One of the cool things I though jQuery would allow me to do is append
> > > > an asterisk (*) to the label of "ALL" my fields that have a css class
> > > > of "required". The example below only applies the asterisk to the
> > > > first field.
>
> > > > How can I get all of the fields from my page that have a
> > > > class="required", find the label (previous element) for each, and
> > > > append some text (an asterisk) to the label for that field?
>
> > > > Example
> > > > ==
>
> > > > 
> > > > $(document).ready(function() {
> > > >            //$('label.required').append(' * > > > strong> ');
> > > >            $(".required").each().prev().not('input').not('br').not
> > > > ('select').append(' * ');
> > > >        });
> > > > 
>
> > > > 
>
> > > > LastName
> > > > 
>
> > > > Thanks,
>
> > > > Baum
>
>


[jQuery] Re: Getting all children, not just immediate children??


Can you provide the relevant markup?

On Apr 1, 2:21 pm, Brian Gallagher  wrote:
> Don't know how the space got there, but not in my original.
> I just quickly tried $(this).find("div.toggletarget").slideToggle(); but it
> didn't work as I suspected.
>
> As you can see in my snippit post I left the commented line in :
> $(this).parent('div.togglecontainer').find('div.toggletarget').slideToggle( );
>
> The was I see this is : this, the togglebutton, get it's parent
> togglecontainer and find it's child toggletarget. This doesn't work though.
> Is my logic wrong?
>
> Any other ideas?
>
> Thanks
>
> -Brian
>
> On Wed, Apr 1, 2009 at 8:48 PM, mkmanning  wrote:
>
> > siblings() returns..siblings. Brothers/sisters, which aren't
> > descendants.
> > To get immediate children (sons/daughters), use children()
> > To get descendants (sons/daughters, grandchildren, great-
> > grandchildren, etc.) then use find()
>
> > btw, do you mean to have a space here: .slideToggl e(); ?
>
> > On Apr 1, 10:04 am, Hector Virgen  wrote:
> > > $(this).siblings() only returns the immediate descendents of 'this'.
>
> > > Try using $(this).find() instead.
> > > -Hector
>
> > > On Wed, Apr 1, 2009 at 9:28 AM, sinkingfish 
> > wrote:
>
> > > > Hi I trying to write a script which allows for easily hiding and
> > revealing
> > > > content by just specifying the correct class names.
>
> > > > The problem I'm having is that my current script will only toggle
> > elements
> > > > if the 'toggletarget' is a immediate sibling of the 'togglebutton'. My
> > > > problem is that the 'togglebutton' may or may not be nested within
> > div's,
> > > > tables etc.
>
> > > > Is their a way to find all the children of an element? Am I missing
> > > > something?
>
> > > > Ta
>
> > > > $(function(){
> > > >        $("div.togglecontainer span.togglebutton").click(function() {
> > > >                $(this).siblings("div.toggletarget").slideToggle();
>
> > //$(this).parent('div.togglecontainer').find('div.toggletarget').slideToggl
> > e();
> > > >            }).css('cursor', 'pointer');
> > > >        $('div.toggletarget').hide();
> > > > });
> > > > --
> > > > View this message in context:
> > > >http://www.nabble.com/Getting-all-children%2C-not-just-immediate-chil.
> > ..
> > > > Sent from the jQuery General Discussion mailing list archive at
> > Nabble.com.


[jQuery] Re: JQuery/PHP debugging technique - any suggestions on how to do this?


Thanks. I've installed the add-on. I'll give it a whirl.

On Apr 1, 8:00 pm, Hector Virgen  wrote:
> You should try using Firebug. You can print directly to the Firebug console
> from within PHP, or you can just echo "some message" and look at the
> response tab of the firebug console.
> -Hector
>
> On Wed, Apr 1, 2009 at 11:56 AM, LinkGuru  wrote:
>
> > Hi, I am looking for some help debugging jQuery being used with PHP in
> > the way described. I basically want a way of tracing where it gets to
> > in the PHP because the usual methods of writing out statements to the
> > page or embedding javascript alerts are not available to me in this
> > scenario. I will now explain.
>
> > I have some PHP (in a file called addToProj.php) which relies on the
> > last 3 lines of code being something similar to the following so that
> > jQuery can pick up returned data (including data for debugging
> > purposes)
>
> >                $json_array["status"]="point end";
> >                echo json_encode($json_array);
> > ?>
>
> > The jquery looks something like this, with the unimportant lines
> > removed.
>
> >                $(".actionOptAdd").bind("click",
> >                        function()
> >                        {
> > .
> > .
> > .
> >                                $.getJSON('lib/addToProj.php',
> >                                {}, function(data)
> >                        }, function(data)
> >                                {
> >                                   $.each(data, function(i,item)
> >                                   {
> >                                    if ( i == "status"
> > )$('#field).val(item);
> >                                   });
> >                                });
> >                        }
> >                );
> > //===
> > I am using json to return data to the jQuery (at the end of the day I
> > will need to return more than one data item) and then updating a field
> > on my html page. At the moment the return data is just for tracking
> > down where I have got to in the PHP. I should point out that I can't
> > insert statements like
>
> > echo "alert('got here xx');";
>
> > in my PHP (for some strange reason) to debug the PHP. Also, I can't
> > place lines like
>
> >                $json_array["status"]="message for debugging";
> >                echo json_encode($json_array);
> >                return();
>
> > at various points in the php, because it breaks the code. Also just
> > doing print 'something'; can't be done in this case.
>
> > Has anyone got an idea of how I can solve the above. Your replies will
> > be greatly appreciated.
> > What is the easiest way of


[jQuery] Re: Good Server-Side tabs to compliment jQuery tabs


You can just use the CSS used by jQuery UI by adding the necessary
classes to the HTML right away. Here's an example of the static HTML:
http://jquery-ui.googlecode.com/svn/trunk/tests/static/tabs/tabs.html

You can easily create themes with Themeroller:
http://jqueryui.com/themeroller/

--Klaus



On 1 Apr., 19:07, expresso  wrote:
> Trying to find a decent solution to server-side tabs for when users have
> JavaScript turned off.  I'll be using jQuery tabs but looking for a CSS tab
> solution (that allows images for the tabs also) that works cross browser.
>
> Anyone used any decent CSS scripts or have an example of actual tabs you've
> deployed that have been working for you in case users have JScript turned
> off?
>
> Looking for a good CSS tab solution that will be used on a huge e-commerce
> site so this has to be very reliable.
>
> I guess I will have those tabs sitting in the page.  And then jQuery can
> just use the same list elements and enact on them if the user has JScript
> turned on?
> --
> View this message in 
> context:http://www.nabble.com/Good-Server-Side-tabs-to-compliment-jQuery-tabs...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Getting all children, not just immediate children??

Don't know how the space got there, but not in my original.
I just quickly tried $(this).find("div.toggletarget").slideToggle(); but it
didn't work as I suspected.

As you can see in my snippit post I left the commented line in :
$(this).parent('div.togglecontainer').find('div.toggletarget').slideToggle();

The was I see this is : this, the togglebutton, get it's parent
togglecontainer and find it's child toggletarget. This doesn't work though.
Is my logic wrong?

Any other ideas?

Thanks

-Brian



On Wed, Apr 1, 2009 at 8:48 PM, mkmanning  wrote:

>
> siblings() returns..siblings. Brothers/sisters, which aren't
> descendants.
> To get immediate children (sons/daughters), use children()
> To get descendants (sons/daughters, grandchildren, great-
> grandchildren, etc.) then use find()
>
> btw, do you mean to have a space here: .slideToggl e(); ?
>
> On Apr 1, 10:04 am, Hector Virgen  wrote:
> > $(this).siblings() only returns the immediate descendents of 'this'.
> >
> > Try using $(this).find() instead.
> > -Hector
> >
> > On Wed, Apr 1, 2009 at 9:28 AM, sinkingfish 
> wrote:
> >
> > > Hi I trying to write a script which allows for easily hiding and
> revealing
> > > content by just specifying the correct class names.
> >
> > > The problem I'm having is that my current script will only toggle
> elements
> > > if the 'toggletarget' is a immediate sibling of the 'togglebutton'. My
> > > problem is that the 'togglebutton' may or may not be nested within
> div's,
> > > tables etc.
> >
> > > Is their a way to find all the children of an element? Am I missing
> > > something?
> >
> > > Ta
> >
> > > $(function(){
> > >$("div.togglecontainer span.togglebutton").click(function() {
> > >$(this).siblings("div.toggletarget").slideToggle();
> >
> > >
> //$(this).parent('div.togglecontainer').find('div.toggletarget').slideToggl
> e();
> > >}).css('cursor', 'pointer');
> > >$('div.toggletarget').hide();
> > > });
> > > --
> > > View this message in context:
> > >http://www.nabble.com/Getting-all-children%2C-not-just-immediate-chil.
> ..
> > > Sent from the jQuery General Discussion mailing list archive at
> Nabble.com.
>


[jQuery] Re: jQuery.noConflict() and firefox 2: errors - is this a bug?


Yes you do need it, unless you're doing all your javascript before the
body is loaded.

As the docs say, you need to call noConflict before loading other
libraries, so your code would look like this:


http://www.w3.org/1999/xhtml";>


Unbenanntes Dokument
   
   
 jQuery.noConflict();
   
   
   
 // Use jQuery via jQuery(...)
 jQuery(document).ready(function(){
   jQuery("div").hide();
 });

 // Use Prototype with $(...), etc.
 $('someid').hide();
   







On Mar 18, 5:25 am, mcologne  wrote:
> if i put first jquery.js and then prototype, i don't need
> jQuery.noConflict().
>
> it works without.
>
> i assume that  jQuery.noConflict() does not work properly.
>
> On 18 Mrz., 01:51, James  wrote:
>
> > For jQuery.noConflict(), according 
> > to:http://docs.jquery.com/Core/jQuery.noConflict
>
> > NOTE: This function must be called after including the jQuery
> > javascript file, but before including any other conflicting library,
> > and also before actually that other conflicting library gets used, in
> > case jQuery is included last. noConflict can be called at the end of
> > the jQuery.js file to globally disable the $() jQuery alias.
> > jQuery.noConflict returns a reference to jQuery, so it can be used to
> > override the $() alias of the jQuery object.
>
> > In other word, put your jQuery.noConflict(); before you include your
> > prototype.js file.
>
> > On Mar 17, 2:37 pm, Eric Garside  wrote:
>
> > > Do you have a link to an accessible site? It would help substantially
> > > in debugging the issue.
>
> > > On Mar 17, 2:50 pm, mcologne  wrote:
>
> > > > the path is correct... it works with firefox 3... and:
>
> > > > if i remove the prototype.js, it works with firefox 2 too...
>
> > > > On 17 Mrz., 19:07, MorningZ  wrote:
>
> > > > > That error would *have* to mean that the jQuery library is not
> > > > > properly loaded (probably the wrong path/location to the jQuery file)
>
> > > > > Use Firebug's "Net" panel to confirm that it is properly found/loaded
>
> > > > > On Mar 17, 1:05 pm, mcologne  wrote:
>
> > > > > > hi,
>
> > > > > > i have problems using jQuery.noConflict() and firefox 2.
>
> > > > > > my firefox version: pc firefox 2.0.0.20
> > > > > > the same with mac firefox 2.0.0.4
>
> > > > > > i'm using only the first example 
> > > > > > fromhttp://docs.jquery.com/Using_jQuery_with_Other_Libraries
>
> > > > > > it doesn't work, the following errors occur in firebug:
>
> > > > > > Security error" code: "1000
> > > > > > jQuery(document).ready is not a function
>
> > > > > > what shall i do?
> > > > > > anybody an idea if this is a bug?
>
> > > > > > best regards m
>
> > > > > > code i use below
>
> > > > > >  > > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> > > > > > http://www.w3.org/1999/xhtml";>
> > > > > > 
> > > > > >  > > > > > />
> > > > > > Unbenanntes Dokument
> > > > > > http://www.prototypejs.org/javascripts/prototype.js";> > > > > > script>
> > > > > >