[jQuery] JQuery and ColdFusion

2009-11-19 Thread Westside
Hi,


I'm trying to use ColdFusion and JQuery but I'm having some problems
setting/reading session variables.  I have a login box that I use
jquery to do the ajax work.  In my ajax call I have this snippet


$(form).ajaxSubmit({


type: 'POST',

dataType: 'json',

url: '/myapp/model/System.cfc?method=authenticate&returnFormat=json'

success: function(resp, textStatus){
  if(resp[0]==true){
window.location.href = 'index.cfm?fuseaction=myapp.home';
  }

});


So within System.cfc there is a method called "authenticate", in this
method I'm trying to set some session variables (e.g, session.email,
session.title) that I can reference once the user is logged in.   So
if the response from the ajax call returns true, the user gets
redirected to this other page using window.location.href shown above.


For some reason though, these session variables don't exist
(session.email, session.title)  when I try to cfdump them out on the
'index.cfm?fuseaction=myapp.home' page.  I can dump them in the CFC
and see that they are getting set correctly, but outside the CFC, they
dont show up.  Can anyone please shed some light on why I can't see my
session variables?  It mus thave something to do with calling the CFC
directly or something


Thanks



Re: [jQuery] Re: how do i prevent having a paragraph tag for the text AFTER i expand?

2009-11-19 Thread Karl Swedberg
Sorry about that. I should have been more specific in the plugin  
documentation about what it was intended for. I didn't write the  
plugin to work across multiple block-level elements. It looks like  
that is how you're trying to use it. If I have some time in the next  
few days, I'll see if I can make the plugin work for multiple block- 
level elements, too.


--Karl


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




On Nov 19, 2009, at 5:24 PM, mikko wrote:


Greetings,

I'm having the same issue with a new line being inserted.  Here is the
live code:  http://www.hotel1000seattle.com/packages.php  The text
doesn't read correctly when expanded (skipped line).  Is there a way
to prevent this?

thanks,
-me

On Nov 9, 7:19 pm, Karl Swedberg  wrote:

it would be helpful to see a page with the html output rather than
your php variables. Also, try using a span rather than a div for the
expandText.

--Karl


Karl Swedbergwww.englishrules.comwww.learningjquery.com

On Nov 5, 2009, at 6:04 AM, Kei Simone wrote:




Hi



i noticed that whenever i expanded the text, the subsequent text
expanded.



and the expand prefix...



also tends to be on the next line.



Please advise.



This is my expand code.



$(document).ready(function() {



 // override some default options
 $('div.expandable div').expander({



   slicePoint:   160,  // default is 100
   expandText: ' Expand', // default is
'read more...'
   //expandSpeed:  '2000', // speed in milliseconds of the  
animation

effect for expanding the text
   //expandPrefix: '...',
expandEffect: 'fadeIn',
   collapseTimer:0, // re-collapses after 5 seconds; default is
0, so no re-collapsing
   userCollapseText: 'Collapse' , // default is '[collapse expanded
text]'



   afterExpand: function($thisElement) {



 var vendorParaID = $thisElement.attr('id');



 var underscore = vendorParaID.indexOf('_');



 var vendorID = vendorParaID.substring(0, underscore);



 $("#vendor_img_"+vendorID).replaceWith($preloadImgVendor
[vendorID]);



 var heightOfDIV = $thisElement.height();



 if(heightOfDIV > 290){
   $thisElement.attr({style : "height:290px;overflow:auto"});
 }



 //console.debug($thisElement);
   },
   onCollapse: function($thisElement, byUser) {
 //alert($thisElement.attr('id'));
 var vendorParaID = $thisElement.attr('id');
 var underscore = vendorParaID.indexOf('_');



 var vendorID = vendorParaID.substring(0, underscore);



 $("#vendor_img_"+vendorID).replaceWith($preloadImgVendorCrop
[vendorID]);



 var heightOfDIV = $thisElement.height();



 if(heightOfDIV > 68){
   $thisElement.removeAttr("style");
 }



 //console.debug($thisElement);
   }
 });



});



This is my div for the expandable.




   {$vender.description}



   




Re: [jQuery] What is the opposite of :checked?

2009-11-19 Thread ankit jain
in general the opposite of checked is unchecked but in technical language it
may be unselected..

On Fri, Nov 20, 2009 at 2:59 AM, Atkinson, Sarah <
sarah.atkin...@cookmedical.com> wrote:

>  That worked
>
>
>
> On 11/19/09 4:00 PM, "Charlie Griefer"  wrote:
>
> http://docs.jquery.com/Selectors/not
>
> On Thu, Nov 19, 2009 at 12:55 PM, Atkinson, Sarah <
> sarah.atkin...@cookmedical.com> wrote:
>
> What is the opposite of :checked?
>
> Is it :unchecked? Or would you use the not (!)
>
>
>
>


-- 
@^|

Re: [jQuery] AJAX w/dataType='json', doesn't correctly handle boolean response?

2009-11-19 Thread Michael Geary
You would normally expect that to work.

What content-type is your server putting in the header for the JSON data?
That could be throwing it off.

Also note that a bare primitive value (true, false, null, or a string or
number) is not valid JSON. The only valid JSON is either an object enclosed
in {} or an array enclosed in []. However, this is not what's causing your
problem. jQuery doesn't use a strict JSON parser - it simply evals the JSON
text - so a bare primitive value should work fine if everything else is OK.

-Mike

On Thu, Nov 19, 2009 at 11:08 AM, livefree75  wrote:

> Hi,
>
> I'm using the following code on the client side:
>   $.ajax({
>  dataType : 'json',
>  // other options
>  success : function(json_response)  {
> console.log(typeof response, response);   // Using Firefox's
> firebug
>  }
>   });
>
> And this PHP code on the server side:
>
>// php processing code
>   $response = some_boolean_value();
>   print json_encode($response);
> ?>
>
> Now, using Firebug, I can verify that the actual JSON response coming
> back is indeed either   true   or   false   (without the quotes),
> which should evaluate to Javascript boolean true or false.  However,
> when I obtain it in the success() method of my $.ajax() call, it comes
> in as a string.  (e.g.  "true"  or  "false").  i.e., the console.log()
> call renders:   string true
>
> Shouldn't it render:   boolean true  ?
>
> Is this a bug?
> Jamie
>


Re: [jQuery] Bolding a certain word - string manipulation?

2009-11-19 Thread Michael Geary
If the word "anything" is just part of the text inside the div, then it
doesn't have a DOM element (tag) of its own. This means you can't select it
with a jQuery selector or any kind of DOM manipulation, and you can't apply
a CSS style to it.

What you can do is rewrite the HTML content of your DIV element.

If you know for sure that there is only a single DIV with
class="tpSurveyQuestion", then it's simple:

var $question = $('.tpSurveyQuestion');
$question.html(
$question.html().replace( 'anything', 'anything' )
);

If there may be multiple DIVs that match that selector, you need to handle
each one individually:

$('.tpSurveyQuestion').each( function() {
var $question = $(this);
$question.html(
$question.html().replace( 'anything', 'anything' )
);
 });

-Mike

On Thu, Nov 19, 2009 at 3:18 PM, Rua  wrote:

>
> Hi I'm trying to select a specific word inside a div and would like to bold
> it, I can't seem to find how to do this anywhere!
>
> $(".tpSurveyQuestion:contains('anything')").css("font-weight","bold");
> --
> View this message in context:
> http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26421612.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>


[jQuery] Re: jQuery UI: Tabs: No spinner

2009-11-19 Thread MorningZ
add a  tag around the 's text and it should work

so

http://somesite.com/tabcontent.php";>This Tab

to

http://somesite.com/tabcontent.php";>This Tab


On Nov 19, 3:39 pm, dinos  wrote:
> I use UI Tabs with Ajax loading.
> The spinner is not working.
> Any ideas?


[jQuery] jQuery UI: Tabs: No spinner

2009-11-19 Thread dinos
I use UI Tabs with Ajax loading.
The spinner is not working.
Any ideas?


[jQuery] Re: how do i prevent having a paragraph tag for the text AFTER i expand?

2009-11-19 Thread mikko
Greetings,

I'm having the same issue with a new line being inserted.  Here is the
live code:  http://www.hotel1000seattle.com/packages.php  The text
doesn't read correctly when expanded (skipped line).  Is there a way
to prevent this?

thanks,
-me

On Nov 9, 7:19 pm, Karl Swedberg  wrote:
> it would be helpful to see a page with the html output rather than  
> your php variables. Also, try using a span rather than a div for the  
> expandText.
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Nov 5, 2009, at 6:04 AM, Kei Simone wrote:
>
>
>
> > Hi
>
> > i noticed that whenever i expanded the text, the subsequent text
> > expanded.
>
> > and the expand prefix...
>
> > also tends to be on the next line.
>
> > Please advise.
>
> > This is my expand code.
>
> > $(document).ready(function() {
>
> >  // override some default options
> >  $('div.expandable div').expander({
>
> >    slicePoint:       160,  // default is 100
> >    expandText:         ' Expand', // default is
> > 'read more...'
> >    //expandSpeed:      '2000', // speed in milliseconds of the animation
> > effect for expanding the text
> >    //expandPrefix: '...',
> >     expandEffect:     'fadeIn',
> >    collapseTimer:    0, // re-collapses after 5 seconds; default is
> > 0, so no re-collapsing
> >    userCollapseText: 'Collapse' , // default is '[collapse expanded
> > text]'
>
> >    afterExpand: function($thisElement) {
>
> >      var vendorParaID = $thisElement.attr('id');
>
> >      var underscore = vendorParaID.indexOf('_');
>
> >      var vendorID = vendorParaID.substring(0, underscore);
>
> >      $("#vendor_img_"+vendorID).replaceWith($preloadImgVendor
> > [vendorID]);
>
> >      var heightOfDIV = $thisElement.height();
>
> >      if(heightOfDIV > 290){
> >    $thisElement.attr({style : "height:290px;overflow:auto"});
> >      }
>
> >      //console.debug($thisElement);
> >    },
> >    onCollapse: function($thisElement, byUser) {
> >      //alert($thisElement.attr('id'));
> >      var vendorParaID = $thisElement.attr('id');
> >      var underscore = vendorParaID.indexOf('_');
>
> >      var vendorID = vendorParaID.substring(0, underscore);
>
> >      $("#vendor_img_"+vendorID).replaceWith($preloadImgVendorCrop
> > [vendorID]);
>
> >      var heightOfDIV = $thisElement.height();
>
> >      if(heightOfDIV > 68){
> >    $thisElement.removeAttr("style");
> >      }
>
> >      //console.debug($thisElement);
> >    }
> >  });
>
> > });
>
> > This is my div for the expandable.
>
> > 
> >                                {$vender.description}
>
> >                                


[jQuery] Aborted Javascript Request and Variable Append when trying to insert Javascript via AJAX

2009-11-19 Thread sconn
Hello,

I am attempting to insert a piece of javascript into a page using an
ajax call. Here are the files

testjs.html:
http://www.myurl.com/pixel.track?
CID=123456">http://www.myurl.com/
pixel.track?CID=LALALA" width="1" height="1" border="0">

test112.html:





  //loading the first step into the form area
  $(document).ready(function(){
$("#formwrapper").load("testjs.html");
  });






I am monitoring http requests via Firebug in Firefox and httpwatch in
IE 8.  In Firefox everything looks great.  In IE 8, however, I get two
requests to my javascript: one to the correct URL (http://
www.myurl.com/pixel.track?CID=123456), and one to
http://www.myurl.com/pixel.track?CID=123456&_=1258667775204.  This is
not expected behavior: I only want to make one request to this URL,
and I do not know where or why this _= variable is being appended.
Sometimes, the first request--the one to the correct URL--is logged as
"Aborted" by httpwatch; other times, it returns 200 for success.

When I execute this request by simply including that javascript in the
page (i.e., without using jQuery to make an AJAX call to it), I have
no problem.

Is there any way around this issue?


[jQuery] Bolding a certain word - string manipulation?

2009-11-19 Thread Rua

Hi I'm trying to select a specific word inside a div and would like to bold
it, I can't seem to find how to do this anywhere!

$(".tpSurveyQuestion:contains('anything')").css("font-weight","bold");
-- 
View this message in context: 
http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26421612.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] No reaction with $('a').click(), OK with dispatchEvent(...)

2009-11-19 Thread Olaf Bosch

Jon schrieb:

Hi,

I have an element like this: #a1
However, when I do this: $('#a1').click(); ... then my doSomething()
do not get called. Why?


Try the jQuery-Way:

#a1

$('#a1').click( function() {
doSomething();
return false;
});




--
Viele Grüße, Olaf

---
olaf.bo...@t-online.de
http://olaf-bosch.de/
http://ohorn.info/
http://www.akitafreund.de/
---


Re: [jQuery] How to collapse slideToggle sections by default?

2009-11-19 Thread Olaf Bosch

srikanthv schrieb:

How to collapse slideToggle sections by default?When page loads all
 sections should be collapsed. When I click it should expand. I
have below couple of sections and I am using jQuery


instert this ceil:


 $(document).ready(function(){


$('h4').next('div').hide();


$('h4').click(function () {
  $(this).next('div').slideToggle('slow');
});
});




--
Viele Grüße, Olaf

---
olaf.bo...@t-online.de
http://olaf-bosch.de/
http://ohorn.info/
http://www.akitafreund.de/
---


[jQuery] Re: Adding some buttons and callbacks

2009-11-19 Thread VANJ
Anyone? Thanks


[jQuery] Re: Load image when they are visible

2009-11-19 Thread CrustyDOD
Yes, that's it..

Was so looking for the wrong thing..

Thanks man.

On Nov 19, 9:08 pm, StephenJacob  wrote:
> I think this is what you're looking for. Haven't tested it myself, but
> this is what i found with a quick search in google for "jquery load
> images on scroll"
>
> http://www.appelsiini.net/2007/9/lazy-load-images-jquery-plugin
>
> On Nov 19, 2:37 pm, CrustyDOD  wrote:
>
> > Hey guys,
>
> > I've been searching all over if its possible to make the same effect
> > that YouTube has.
> > Loading images when they are visible.
>
> > If you have no idea what i'm talking about, go to YouTube, do a search
> > for some video and
> > when you scroll down the list of all found videos, thumbnails of each
> > video will be loaded once
> > they are visible (in the visible area of the browser).
>
> > Any ideas how to do this effect? Load images only when they are inside
> > the viewable
> > area of a browser..


Re: [jQuery] What is the opposite of :checked?

2009-11-19 Thread Atkinson, Sarah
That worked



On 11/19/09 4:00 PM, "Charlie Griefer"  wrote:

http://docs.jquery.com/Selectors/not

On Thu, Nov 19, 2009 at 12:55 PM, Atkinson, Sarah 
 wrote:
What is the opposite of :checked?

Is it :unchecked? Or would you use the not (!)




[jQuery] Re: What is the opposite of :checked?

2009-11-19 Thread KeeganWatkins
should also be pretty easy to roll your own :not-checked selector:

$.expr[":"]["not-checked"] = function(elem, i , m) {
// use === false to avoid undefined "checked" property
// creating false positives
return elem.checked === false;
}

On Nov 19, 3:00 pm, Charlie Griefer  wrote:
> http://docs.jquery.com/Selectors/not
>
> On Thu, Nov 19, 2009 at 12:55 PM, Atkinson, Sarah <
>
> sarah.atkin...@cookmedical.com> wrote:
> >  What is the opposite of :checked?
>
> > Is it :unchecked? Or would you use the not (!)
>
> --
> Charlie Grieferhttp://charlie.griefer.com/
>
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.


[jQuery] HEAD element or ScriptManager

2009-11-19 Thread newroz

Hi,
I have used jquery in my web site (.net 3.5 with master pages) the problem
is jquery works if it is added as a usual script tag in HEAD element, but if
add it as scriptreference in ScriptManger it generate error something like
"JScript runtime error object required".

I am newbie on javascript. what is difference to have javascript (jquery) in
head element or within HEAD element at all? 
and why it generates error (does not work) as script reference?

thanks
-- 
View this message in context: 
http://old.nabble.com/HEAD-element-or-ScriptManager-tp26421479s27240p26421479.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] What is the opposite of :checked?

2009-11-19 Thread Charlie Griefer
http://docs.jquery.com/Selectors/not

On Thu, Nov 19, 2009 at 12:55 PM, Atkinson, Sarah <
sarah.atkin...@cookmedical.com> wrote:

>  What is the opposite of :checked?
>
> Is it :unchecked? Or would you use the not (!)
>



-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Append to .load() element

2009-11-19 Thread knal
Hi there,

I have a (few) jQuery UI's accordions on a single page, ever accordion
exists of two elements; one visible, one hidden.
Initially the invisible one has no content, but it's loaded with
jQuery. My code looks like this:

[code]

$('.project').each(function(){
var cur_project_id = $(this).attr( "id" );
$( "#"+cur_project_id+" .summary" ).after( "" );
$( "#"+cur_project_id+" .bodytext" ).load( cur_project_id+".html
div.bodytext" );
});

[code]

As you can see, first i dynamically create the container for the
secondary content, and then i fill it up (out of sight). Works like a
charm, but only when i try to add the following nothing happens:

[code]

$( "#"+cur_project_id+" .bodytext p" ).append( 'Click this link' );

[/code]

But if i append it to, say $( "#"+cur_project_id+" .head" ) all are
influenced, the 'real' one, and the dynamically created one.

Any clues how to solve this?

Thanks.


[jQuery] What is the opposite of :checked?

2009-11-19 Thread Atkinson, Sarah
What is the opposite of :checked?

Is it :unchecked? Or would you use the not (!)


Re: [jQuery] jquery 1.3.2 syntax error line 324 in IE6

2009-11-19 Thread Karl Swedberg
nothing here looks like it would cause a syntax error. Maybe the  
problem is in your formLogin() function?


--Karl


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




On Nov 19, 2009, at 2:00 AM, viperasi wrote:

Whether jquery-1.3.2.js or jquery-1.3.2.min.js,i always got the  
error.Other browsers without error.

Below is the code:

$(function(){
$('#username').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
$('#password').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
$('#valicode').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
});

Can anyway help me please? I think it's something really simple and  
I'm just being stupid.


Many thanks for reading and sorry for my poor English.

https://twitter.com/viperasi
my fridge!:http://bit.ly/ohBHG
有事您说话




Re: [jQuery] Trouble with IE breaking script

2009-11-19 Thread Atkinson, Sarah
Yea I'm kinda figuring it out trying another approch that I found here
http://www.quirksmode.org/dom/w3c_css.html


On 11/19/09 3:12 PM, "Charlie Griefer"  wrote:

This may just be another example of IE sucking.  I get an error on IE 6, 
"unexpected call to method or property access".

Googling that error message (and adding 'style' to the search) suggests that 
manipulating the style attribute dynamically on IE is somewhat... problematic :\

On Thu, Nov 19, 2009 at 11:45 AM, Atkinson, Sarah 
 wrote:


Yes In the function that this bit of code resides


On 11/19/09 2:43 PM, "Charlie Griefer" http://charlie.grie...@gmail.com> > wrote:

leftOffset is a variable you're defining somewhere?

On Thu, Nov 19, 2009 at 11:39 AM, Atkinson, Sarah 
http://sarah.atkin...@cookmedical.com> > wrote:

IE 7 haven't tried any others. And it doesn't work it doesn't text and it cause 
another function that hides and shows a div to not work as well.  The only fire 
bug error I get is "Reload to activate window console" although IE has a 
message saying error on page


On 11/19/09 2:35 PM, "Charlie Griefer" http://charlie.grie...@gmail.com>   > wrote:

What version of IE?
Define "break"?

On Thu, Nov 19, 2009 at 11:29 AM, Atkinson, Sarah 
http://sarah.atkin...@cookmedical.com>  
 > wrote:
I'm having trouble with IE
This code seems to break in IE

var cssString= "label.error{left:"+leftOffset+"px;}";$('head 
style').text(cssString);








Re: [jQuery] Trouble with IE breaking script

2009-11-19 Thread Charlie Griefer
This may just be another example of IE sucking.  I get an error on IE 6,
"unexpected call to method or property access".

Googling that error message (and adding 'style' to the search) suggests that
manipulating the style attribute dynamically on IE is somewhat...
problematic :\

On Thu, Nov 19, 2009 at 11:45 AM, Atkinson, Sarah <
sarah.atkin...@cookmedical.com> wrote:

>
>
> Yes In the function that this bit of code resides
>
>
> On 11/19/09 2:43 PM, "Charlie Griefer"  wrote:
>
> leftOffset is a variable you're defining somewhere?
>
> On Thu, Nov 19, 2009 at 11:39 AM, Atkinson, Sarah <
> sarah.atkin...@cookmedical.com> wrote:
>
>
> IE 7 haven’t tried any others. And it doesn’t work it doesn’t text and it
> cause another function that hides and shows a div to not work as well.  The
> only fire bug error I get is "Reload to activate window console" although IE
> has a message saying error on page
>
>
> On 11/19/09 2:35 PM, "Charlie Griefer"  http://charlie.grie...@gmail.com> > wrote:
>
> What version of IE?
> Define "break"?
>
> On Thu, Nov 19, 2009 at 11:29 AM, Atkinson, Sarah <
> sarah.atkin...@cookmedical.com  >
> wrote:
>
> I’m having trouble with IE
> This code seems to break in IE
>
> var cssString= "label.error{left:"+leftOffset+"px;}";$('head
> style').text(cssString);
>
>
>
>
>
>


-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: Load image when they are visible

2009-11-19 Thread StephenJacob
I think this is what you're looking for. Haven't tested it myself, but
this is what i found with a quick search in google for "jquery load
images on scroll"

http://www.appelsiini.net/2007/9/lazy-load-images-jquery-plugin


On Nov 19, 2:37 pm, CrustyDOD  wrote:
> Hey guys,
>
> I've been searching all over if its possible to make the same effect
> that YouTube has.
> Loading images when they are visible.
>
> If you have no idea what i'm talking about, go to YouTube, do a search
> for some video and
> when you scroll down the list of all found videos, thumbnails of each
> video will be loaded once
> they are visible (in the visible area of the browser).
>
> Any ideas how to do this effect? Load images only when they are inside
> the viewable
> area of a browser..


Re: [jQuery] Trouble with IE breaking script

2009-11-19 Thread Atkinson, Sarah


Yes In the function that this bit of code resides

On 11/19/09 2:43 PM, "Charlie Griefer"  wrote:

leftOffset is a variable you're defining somewhere?

On Thu, Nov 19, 2009 at 11:39 AM, Atkinson, Sarah 
 wrote:

IE 7 haven't tried any others. And it doesn't work it doesn't text and it cause 
another function that hides and shows a div to not work as well.  The only fire 
bug error I get is "Reload to activate window console" although IE has a 
message saying error on page


On 11/19/09 2:35 PM, "Charlie Griefer" http://charlie.grie...@gmail.com> > wrote:

What version of IE?
Define "break"?

On Thu, Nov 19, 2009 at 11:29 AM, Atkinson, Sarah 
http://sarah.atkin...@cookmedical.com> > wrote:
I'm having trouble with IE
This code seems to break in IE

var cssString= "label.error{left:"+leftOffset+"px;}";$('head 
style').text(cssString);






Re: [jQuery] Trouble with IE breaking script

2009-11-19 Thread Charlie Griefer
leftOffset is a variable you're defining somewhere?

On Thu, Nov 19, 2009 at 11:39 AM, Atkinson, Sarah <
sarah.atkin...@cookmedical.com> wrote:

>
> IE 7 haven’t tried any others. And it doesn’t work it doesn’t text and it
> cause another function that hides and shows a div to not work as well.  The
> only fire bug error I get is "Reload to activate window console" although IE
> has a message saying error on page
>
>
> On 11/19/09 2:35 PM, "Charlie Griefer"  wrote:
>
> What version of IE?
> Define "break"?
>
> On Thu, Nov 19, 2009 at 11:29 AM, Atkinson, Sarah <
> sarah.atkin...@cookmedical.com> wrote:
>
> I’m having trouble with IE
> This code seems to break in IE
>
> var cssString= "label.error{left:"+leftOffset+"px;}";$('head
> style').text(cssString);
>
>
>
>


-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


Re: [jQuery] Trouble with IE breaking script

2009-11-19 Thread Atkinson, Sarah

IE 7 haven't tried any others. And it doesn't work it doesn't text and it cause 
another function that hides and shows a div to not work as well.  The only fire 
bug error I get is "Reload to activate window console" although IE has a 
message saying error on page

On 11/19/09 2:35 PM, "Charlie Griefer"  wrote:

What version of IE?
Define "break"?

On Thu, Nov 19, 2009 at 11:29 AM, Atkinson, Sarah 
 wrote:
I'm having trouble with IE
This code seems to break in IE

var cssString= "label.error{left:"+leftOffset+"px;}";$('head 
style').text(cssString);




[jQuery] Load image when they are visible

2009-11-19 Thread CrustyDOD
Hey guys,

I've been searching all over if its possible to make the same effect
that YouTube has.
Loading images when they are visible.

If you have no idea what i'm talking about, go to YouTube, do a search
for some video and
when you scroll down the list of all found videos, thumbnails of each
video will be loaded once
they are visible (in the visible area of the browser).

Any ideas how to do this effect? Load images only when they are inside
the viewable
area of a browser..


Re: [jQuery] Trouble with IE breaking script

2009-11-19 Thread Charlie Griefer
What version of IE?
Define "break"?

On Thu, Nov 19, 2009 at 11:29 AM, Atkinson, Sarah <
sarah.atkin...@cookmedical.com> wrote:

>  I’m having trouble with IE
> This code seems to break in IE
>
> var cssString= "label.error{left:"+leftOffset+"px;}";$('head
> style').text(cssString);
>



-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Trouble with IE breaking script

2009-11-19 Thread Atkinson, Sarah
I'm having trouble with IE
This code seems to break in IE

var cssString= "label.error{left:"+leftOffset+"px;}";$('head 
style').text(cssString);


[jQuery] AJAX w/dataType='json', doesn't correctly handle boolean response?

2009-11-19 Thread livefree75
Hi,

I'm using the following code on the client side:
   $.ajax({
  dataType : 'json',
  // other options
  success : function(json_response)  {
 console.log(typeof response, response);   // Using Firefox's
firebug
  }
   });

And this PHP code on the server side:



Now, using Firebug, I can verify that the actual JSON response coming
back is indeed either   true   or   false   (without the quotes),
which should evaluate to Javascript boolean true or false.  However,
when I obtain it in the success() method of my $.ajax() call, it comes
in as a string.  (e.g.  "true"  or  "false").  i.e., the console.log()
call renders:   string true

Shouldn't it render:   boolean true  ?

Is this a bug?
Jamie


Re: [jQuery] Re: IDEs of jQuery

2009-11-19 Thread Ankur_Patel
to Michael, I am also use NetBeans but how can i get jQuery all library like
php functions,properties

On Thu, Nov 19, 2009 at 8:58 PM, devilmike  wrote:

> This isn't specifically for jQuery, but NetBeans handles it extremely
> well. I use the Early Access for PHP version.
>
> Michael
>
>
>
> On Nov 19, 4:13 am, Ankur_Patel  wrote:
> > Can any one tell me name of jQuery IDEs... like dreamweaver use of IDE as
> > HTML,PHP,ASP,XML,CSS
> >
> > Any IDE there for jQuery code so we can write codes easy & fast
> >
> > Thanx
>


Re: [jQuery] Re: Modifying a CSS class's properties SOLVED

2009-11-19 Thread Atkinson, Sarah

It is possible I used this:
$('style').text('label.error{left:' + leftOffset +'px;}');
On 11/19/09 1:33 PM, "discern"  wrote:

I don't know if that is possible (although almost anything, it seems,
is possible with jQuery), but what if you had a secondary class in
your CSS and used addClass('secondary') to the element. It would
inherit styles from the original and apply the secondary styles.



Re: [jQuery] Re: Modifying a CSS class's properties

2009-11-19 Thread Atkinson, Sarah
The problem is is that I need to calculate the styles when the page loads.  And 
the calculation results in a couple of hundred different numbers.


On 11/19/09 1:33 PM, "discern"  wrote:

I don't know if that is possible (although almost anything, it seems,
is possible with jQuery), but what if you had a secondary class in
your CSS and used addClass('secondary') to the element. It would
inherit styles from the original and apply the secondary styles.



[jQuery] Re: Modifying a CSS class's properties

2009-11-19 Thread discern
I don't know if that is possible (although almost anything, it seems,
is possible with jQuery), but what if you had a secondary class in
your CSS and used addClass('secondary') to the element. It would
inherit styles from the original and apply the secondary styles.


[jQuery] Modifying a CSS class's properties

2009-11-19 Thread Atkinson, Sarah
Can I modify a CSS Class's properties not on an element but on the css class 
it's self so that and element that is given that class in the future will still 
have those changes?  Perhaps modify a class that is actually in the header?


[jQuery] why mouse position inside div is different in Firefox and IE

2009-11-19 Thread Latha
I am having h3 tag containing anchor tag , i want to know the position
of the mouse while hover.
Why the following works differently in IE and FF.

var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
Can anyone give me the solution for this issue to fix in IE and FF


RE: [jQuery] Can't get image's dimension under a hidden object

2009-11-19 Thread Josh Nathanson
One little trick I've used is to use absolute positioning to move the image
way off the page, like left = -5000, then display the image, get the
dimensions, then hide it again.  This way your layout won't be disturbed.

 

-- Josh

 

 

 

From: Michael Geary [mailto:m...@mg.to] 
Sent: Thursday, November 19, 2009 9:39 AM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Can't get image's dimension under a hidden object

 

I don't think even case 1 will work in all browsers. Some browsers won't
bother loading the image if it has display:none. But they will all load it
if it has visibility:hidden.

Here's how I do it:

jQuery.imageDimensions = function( src, callback ) {
jQuery('')
.css({ visibility:'hidden' })
.appendTo('body')
.load( function() {
var width = this.width;
var height = this.height;
jQuery(this).remove();
callback( width, height );
})
.attr({ src:src });
};

and then use:

$.imageDimensions( 'xxx', function( width, height ) {
// here you have the image width and height
});

That's a little different from what you're doing - I'm not working with an
IMG tag already in the document - but if you pull the src attribute from the
img tag and pass it to this function it should work.

-Mike

On Thu, Nov 19, 2009 at 7:16 AM, David .Wu  wrote:

1.

$(window).load(function() {
   alert($('#img1').width());
});

2.

   

$(window).load(function() {
   alert($('#img2').width());
});

case 1 can get the dimension, but case 2 can't, how to get it?

 



[jQuery] Re: mediocre css skills combined with noob to jquery and .cycle

2009-11-19 Thread Nate Heldman
ok...solved the issue of timing.  the system we use is placing br tags
in spite of the fact that this was all coded in their html module.  i
got around it by eliminating all returns and spaces in the code. (the
a tags had nothing to do with the timing issues...only the spaces and
returns...just in case someone else runs into a similar issue)

i'm still having a strange issue with all four images loading
initially on top of each other, and then moving into the slideshow.
can you shed some light on why that might be?

On Nov 13, 4:54 pm, "danny.copel...@gmail.com"
 wrote:
> ### Insight:
>
> Cycle is trying to fade those break tags as well. It just finds all
> direct children of "#homepage", in your case, and those are the 
> tags and the  tags...
>
> On Nov 13, 5:52 pm, "danny.copel...@gmail.com"
>
>  wrote:
> > Oh, wait! No, what the actual problem is is that you have s after
> > each anchor...remove those and you should be golden. You can still
> > play around with the delay option to get the timing right afterwards.
>
> > Also, those are HTML break tags, if yr ever going to use that to give
> > content a line-break, pls use , which is valid XHTML - the same
> > as your DOCTYPE declares.
>
> > Good luck!
>
> > Dan


Re: [jQuery] Can't get image's dimension under a hidden object

2009-11-19 Thread Michael Geary
I don't think even case 1 will work in all browsers. Some browsers won't
bother loading the image if it has display:none. But they will all load it
if it has visibility:hidden.

Here's how I do it:

jQuery.imageDimensions = function( src, callback ) {
jQuery('')
.css({ visibility:'hidden' })
.appendTo('body')
.load( function() {
var width = this.width;
var height = this.height;
jQuery(this).remove();
callback( width, height );
})
.attr({ src:src });
};

and then use:

$.imageDimensions( 'xxx', function( width, height ) {
// here you have the image width and height
});

That's a little different from what you're doing - I'm not working with an
IMG tag already in the document - but if you pull the src attribute from the
img tag and pass it to this function it should work.

-Mike

On Thu, Nov 19, 2009 at 7:16 AM, David .Wu  wrote:

> 1.
> 
> $(window).load(function() {
>alert($('#img1').width());
> });
>
> 2.
> 
>
> 
> $(window).load(function() {
>alert($('#img2').width());
> });
>
> case 1 can get the dimension, but case 2 can't, how to get it?
>


[jQuery] Before/Append/Prepend/After Margin Rendering Bug?

2009-11-19 Thread discern
I have a large div with several divs (they mimic s). In those are
two input type="text" fields and two buttons. None of the elements are
floating, but the "buttons" are actually s that are display: inline-
block.

If I .prepend() or .after() a new div to one of the existing divs
(using the function below), each input and button has just a little of
its left margin removed.

I can fix it with addClass('shift'), where shift is "margin-left: 8px !
important," to the new div with jquery, but it seems kludgy to have to
do so, when the HTML of the new div is exactly the same as the
existing divs.

function x() {
...
$.ajax({
type:"POST",
url:"/ajax-url.php",
data:{var:var},
dataType:'json',
error:function(){stderr();},
success:function(json){
if(json.error) {
stderr(json.error);
$("#"+json.field).focus().select();
return;
} else {
// The shift occurs with append(), prepend(), before() and after()
$("#tr"+id).after(json.row);
// I can fix it by adding:
$("#tr"+json.id).addClass('shift');
// CSS: .shift { margin-left: 8px !important; }
}
}
});
}


Has anyone else experience this?


[jQuery] Re: IDEs of jQuery

2009-11-19 Thread MorningZ
More topics like this with lots of replies

http://groups.google.com/group/jquery-en/search?hl=en&group=jquery-en&q=ide&qt_g=Search+this+group


Re: [jQuery] Problem with plugins

2009-11-19 Thread Michael Geary
Can you post a link to a test page?

It's impossible to tell what is wrong from the .js file you attached. It's
not even JavaScript code: it's PHP code.

The browser doesn't ever see your PHP code. All it sees is the *output* of
the PHP code. There could be any number of things wrong, but there's no way
to tell what they may be without seeing that actual output in a test page.

-Mike

On Thu, Nov 19, 2009 at 8:03 AM, Paulo Henrique wrote:

> Can someone help me find any problem with the code attached?
> I am using it on a website, but its happening a problem with some of my
> plugins... I use all of them on other websites and they all work fine,
> but on this one, some aren't working.
> When I call the editable plugin, it throws an error message saying editable
> is not a function... the same happens with sortable, from jquery-ui...
> On another website I'm working, this happens with ALL jquery plugins.
>
> Does anyone know what might be causing this?
>
>
> Att.
> Paulo Henrique Vieira Neves
> Bsc. Sistemas de Informação
> +55 38 9141 5400
> MSN: paulode...@live.com
> GTALK: paulode...@gmail.com
> SKYPE: paulodemoc
>


[jQuery] How to collapse slideToggle sections by default?

2009-11-19 Thread srikanthv

How to collapse slideToggle sections by default?When page loads all
 sections should be collapsed. When I click it should expand. I
have below couple of sections and I am using jQuery

 $(document).ready(function(){
$('h4').click(function () {
  $(this).next('div').slideToggle('slow');
});
});


All sections:

What is jQuery? 

jQuery is a lightweight JavaScript library that emphasizes
interaction between JavaScript and HTML. 
It was released in January 2006 at BarCamp NYC by John Resig.
jQuery is free, open source software Dual-licensed under the MIT
License and the GNU License


What are jQuery features

DOM element selections using the cross-browser open source selector
engine 
DOM traversal and modification (including support for CSS 1-3 and
basic XPath)
Events



Re: [jQuery] IE radio button show nothing after click or change

2009-11-19 Thread Jacob Siu
Thanks. I figure it out later

On Thu, Nov 12, 2009 at 1:35 PM, Andrei Eftimie  wrote:

> I'm not sure about this right now, but from memory, IE will change the
> value after the element has loses its focus.
>
> On Thu, Nov 12, 2009 at 7:54 PM, 2daughtersdad 
> wrote:
> > In IE7 my radio button do not display 'checked' when  I click on it.
> > (ie I would not change to show which button has been clicked)
> > I work fine in Firefox. Need Help. Thanks in advance.
> >
> > I am using jquery-1.3.2.min.js and the following work fine as well.
> >
> > $("input[name='radioname']").click(function() {
> >alert ( $("input[name='radioname']:checked").val()  );
> > });
> > $("input[name='radioname']").change(function() {
> >alert ( $("input[name='radioname']:checked").val()  );
> > });
> >
>
>
>
> --
> Andrei Eftimie
> http://eftimie.com
> +40 758 833 281
>
> Punct
> http://designpunct.ro
>


[jQuery] jqgrid dynamic select option with json

2009-11-19 Thread bertaudmarc
Hi,
I tried to build a dynamic string for populating a select but my
string seems to have a bad format !

var manufacturers= $.ajax( {url:'abcd.php',
async:false }).responseText;

{name:'manufacturer', index:'manufacturer', editable:true,
edittype:'select',
editoptions:{ value: manufacturers}  },

abcd.php

while($row = mysql_fetch_array($result))
{
$response->rows[$i]=array($row['Manufacturer']);
$i++;
};
echo json_encode($response);

$responce has the following format

{"rows":[["manu1"],["manu2"],["manu3"]]}

Could you tell me what is the correct format ?
Thank's


[jQuery] InvalidHandler problem for validation

2009-11-19 Thread Atkinson, Sarah
My problem is simple it seems that the invalidHandler function runs first. I 
need it to either run last or I need to be able to add extra class features to 
the errors.

Or is it possible to alter a style sheet's class on document load?


[jQuery] Re: Slide with jQuery.

2009-11-19 Thread srikanthv
How can I make this  section under  by default collapsed?

On Nov 19, 7:39 am, Leonardo K  wrote:
> $("h4").click(function(){
>        $(this).next('div').slideToogle();
>
> }).trigger('click');
> On Thu, Nov 19, 2009 at 04:11, srikanthv  wrote:
> > I have to implement slide on each  question. by default question
> > will be collapse. when I click on on question it should be slide down
> > (expand). How can I implement this on jQuery? Please forward me
> > solution.
>
> > What is jQuery? 
> > 
> > jQuery is a lightweight JavaScript library that emphasizes
> > interaction between JavaScript and HTML. 
> > It was released in January 2006 at BarCamp NYC by John Resig.
> > jQuery is free, open source software Dual-licensed under the MIT
> > License and the GNU License
> > 
>
> > What are jQuery features
> > 
> > DOM element selections using the cross-browser open source selector
> > engine 
> > DOM traversal and modification (including support for CSS 1-3 and
> > basic XPath)
> > Events
> > 


Re: [jQuery] $.get xml document with xhtml fragments in IE

2009-11-19 Thread ugurlu.b

I had the same problem, where I have to rely on an XHTML+XML output already
processed through XSLT, from which I need to extract parts of and insert
them into the DOM.

I've taken your code and changed it a little to get it more universal.

if (!document.ELEMENT_NODE) {
document.ELEMENT_NODE = 1;
document.ATTRIBUTE_NODE = 2;
document.TEXT_NODE = 3;
document.CDATA_SECTION_NODE = 4;
document.ENTITY_REFERENCE_NODE = 5;
document.ENTITY_NODE = 6;
document.PROCESSING_INSTRUCTION_NODE = 7;
document.COMMENT_NODE = 8;
document.DOCUMENT_NODE = 9;
document.DOCUMENT_TYPE_NODE = 10;
document.DOCUMENT_FRAGMENT_NODE = 11;
document.NOTATION_NODE = 12;
}


/* translate the current node to a string, keeping all attributes, text
nodes and attribute names. */
function domToString(node) {
if (!node) return "";
var desc = "";
//Text nodes do not have child elements,
//so return immediately after processing.
if (node.nodeType == document.TEXT_NODE) {
if (typeof (node.nodeValue) != 'undefined') desc += node.nodeValue;
}
else {
//node name.
desc += "<" + node.nodeName;
for (i = 0; i < node.attributes.length; i++) {
if (node.attributes[i].specified) {
desc += " " + node.attributes[i].nodeName + "=\"" +
node.attributes[i].nodeValue + "\"";
}
}
/*
If node has no children, then use compact notation
This is important for elements like , where some browsers 
interpret the opening tag of  as .
On the other hand, elements like script and style must have a
closing tag.
*/

if (node.hasChildNodes() || node.nodeName == 'script' ||
node.nodeName == 'style') {
desc += ">";
$(node).contents().each(function() {
desc += domToString(this);
});
desc += "";
}
else {
desc += "/>";
}
}

return desc;
}

Usage: domToString(node), which returns a string.







dbu wrote:
> 
> 
> thanks NightWatchman for the input. it might work, but i really did not
> feel like changing the complete xml generating code...
> 
> i'm surprised nobody else has run into this problem - or cared to share
> his insights on any forum or blog post or whatever (i googled a lot
> before posting here...).
> 
> anyways, what worked for me:
> 
> 
> var desc="";
> 
> /* translate the current node to a string, keeping all attributes, text
> nodes and attribute names. */
> function domToString() {
> if (this.nodeName == "#text") {
> if (this.nodeValue != 'undefined') desc += this.nodeValue;
> return;
> }
> desc += "<" + this.nodeName;
> for (i=0; i if (this.attributes[i].specified) {
> desc += " " +
> this.attributes[i].nodeName+"='"+this.attributes[i].nodeValue+"'";
> }
> }
> 
> desc += ">";
> $(this).contents().each(domToString);
> desc += "";
> }
> 
> desc=""; //reset desc if you use it more than once.
> $("text",node).children().each(domToString);
> 
> 
> then i get the html string in desc, and can use that with .html() or
> .append() or whatever. or in my case the google maps api, which also
> accepts html code as string.
> 
> i know, the global variable is not really nice, but i did not find a
> better solution right on the spot and this works for me...
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/%24.get-xml-document-with-xhtml-fragments-in-IE-tp22378044s27240p26421378.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Problems with quotes

2009-11-19 Thread MorningZ
Why are you using both ".text()" and ".html()" ?


On Nov 19, 5:59 am, heohni 
wrote:
> Hi,
>
> I have databse entries like: CUBE Streamer  'sloping'
> ULTEGRA 3 x 10 (99€/Woche)
>
> I use this text with jquery and I am writing this text into a div.
> When reloading my page, because of a form validation, the text gets
> automatically like this:
>
> CUBE Streamer \'sloping\' ULTEGRA 3 x 10 (99€/Woche)
>
> This way, I write the text into the div:
> 
> $('#selected_cat_name').text(cat_name).html(cat_name);
>
> When I Is there a way to avoid getting the \?submit my form another
> time, the text looks like CUBE Streamer \\\'sloping\\\' ULTEGRA 3 x 10
> (99€/Woche)


[jQuery] Problem with plugins

2009-11-19 Thread Paulo Henrique
Can someone help me find any problem with the code attached?
I am using it on a website, but its happening a problem with some of my
plugins... I use all of them on other websites and they all work fine,
but on this one, some aren't working.
When I call the editable plugin, it throws an error message saying editable
is not a function... the same happens with sortable, from jquery-ui...
On another website I'm working, this happens with ALL jquery plugins.

Does anyone know what might be causing this?


Att.
Paulo Henrique Vieira Neves
Bsc. Sistemas de Informação
+55 38 9141 5400
MSN: paulode...@live.com
GTALK: paulode...@gmail.com
SKYPE: paulodemoc


code.js
Description: JavaScript source


[jQuery] Problem combining validation plugin and datepicker from ui (validate)

2009-11-19 Thread bobbykjack
OK, my requirement is wildly advanced, but I need to combine the ui
datepicker with the validation plugin. Ultimately, I need to ensure a
date is at least 1 month in the future.

The problem I'm encountering is the exact ordering of events. It
appears as if the validator check's the input's data before the
datepicker has written to it (after a date has been picked).

There's a demo here:
http://www.fiveminuteargument.com/jquery-validation-date-picker.html

and you should notice the problem (the date 'seen' lagging behind by
one) once you've picked the second date, and onwards.

Any advice much appreciated,

- Bobby


[jQuery] Re: how to remove jqgrid space at far right of grid

2009-11-19 Thread bertaudmarc
Hi,

Did you play with scrollOffset, rows number and records number ?
e.g: if record < row then scrollOffset = 0
I never tried this.
You are right, this space is annoying.
I checked the forum of the author. He said that this space is normal.

On 13 nov, 21:46, davebrown  wrote:
> Should have realised before, but I'm pretty sure that space is being reserved
> for a scrollbar if required.
>
> So in that case I can see now why its there, but it would still be nice to
> only have it present when a scrollbar is required.
>
>
>
> davebrown wrote:
>
> > Hi all,
>
> > Can anyone tell me how to get rid of the right hand spacing after the
> > columns so my column will fill the grid container.
>
> > e.g.
>
> >  http://old.nabble.com/file/p26340877/jqgrid-screenshot.jpg
>
> > Thank you
>
> > Dave.
>
> --
> View this message in 
> context:http://old.nabble.com/how-to-remove-jqgrid-space-at-far-right-of-grid...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: No reaction with $('a').click(), OK with dispatchEvent(...)

2009-11-19 Thread KeeganWatkins
if you have to keep your JavaScript inline, you should use the onclick
attribute instead of using the "javascript:" pseudo-protocol. it was
never fully standardized, and is a lingering piece of old-school
JavaScript usage. so for your example above, use:
#a1

an even better solution (as you are already using jQuery), would be to
use the built-in binding jQuery provides, which allows you to a.) keep
your JS out of the markup, and b.) have more than one handler if you
need to:
$(function() {
$("#a1").click(function() {
// handle event here
});
});

On Nov 19, 8:21 am, Jon  wrote:
> Hi,
>
> I have an element like this: #a1
> However, when I do this: $('#a1').click(); ... then my doSomething()
> do not get called. Why?
>
> If I make my own click function, like this:
> function clickAt(targetElement) {
>         var evt = document.createEvent("HTMLEvents");
>         evt.initEvent("click", "true", "true");
>         return targetElement.dispatchEvent(evt);
>
> }
>
> ... and call it this way: clickAt($('#a1')[0]); ... then my doSomething
> () do get called.
>
> If you like, you can try it out here:  test/jq-test.html>
>
> /Jon


[jQuery] Re: IDEs of jQuery

2009-11-19 Thread KeeganWatkins
Aptana (built on Eclipse) also has great jQuery support.
http://aptana.com/

On Nov 19, 9:28 am, devilmike  wrote:
> This isn't specifically for jQuery, but NetBeans handles it extremely
> well. I use the Early Access for PHP version.
>
> Michael
>
> On Nov 19, 4:13 am, Ankur_Patel  wrote:
>
> > Can any one tell me name of jQuery IDEs... like dreamweaver use of IDE as
> > HTML,PHP,ASP,XML,CSS
>
> > Any IDE there for jQuery code so we can write codes easy & fast
>
> > Thanx


Re: [jQuery] Re: validation: how do I call a function to perform after a validation is done?

2009-11-19 Thread Atkinson, Sarah
Ok I'm using this
  invalidHandler: function(form, validator)  {
PossitionStuff.possitionErrors();  },
And it works but it doesn't fire till the second validation I need it to fire 
on the first go around too


On 11/18/09 4:06 PM, "StephenJacob"  wrote:

Hmm, i'm not really sure how to pull that off.  I would look into the
showErrors option or possibly the Valid function.

http://docs.jquery.com/Plugins/Validation/validate

http://docs.jquery.com/Plugins/Validation/valid

Good luck and let us know how things turn out for ya!


On Nov 18, 3:47 pm, "Atkinson, Sarah" 
wrote:
> I want the function to trigger when there are errors  it's to alter the 
> position of both the errors and other elements on the page.
>
> So I got the function to fire but I can't seem to changes the css on the 
> error boxes.
> $('label .error').css({'left' : basePossitionOffset.left});
> Does not work.
>
> I should be able to alter the error messages just like anyother element in 
> the DOM right?
>
> On 11/18/09 3:34 PM, "StephenJacob"  wrote:
>
> It depends on your method of validation. Here is the form/validation
> system I use for my contact form. Hope this helps!
>
> 
> 
> 
> 
>
> $(document).ready(function() {
>
> $("#contactForm").validate({
> rules: {
> fullname: {
> required: true,
> minlength: 2
> },
> email: {
> required: true,
> email: true
> },
> company: {
> required: true,
> minlength: 2
> },
> phone: {
> required: true,
> minlength: 2
> },
> },
> messages: {
> fullname: 'Please enter your 
> full name. span>',
> email: 'Please enter a valid 
> email address b>.',
> company: 'Please enter your 
> company. span>',
> phone: 'Please enter your 
> phone number. span>'
> },
> submitHandler: function(form) {
>
> $('#contactForm').ajaxSubmit({
> resetForm: true,
> target: '#success',
> success: function() {
> 
> $("#success").fadeIn('slow').fadeTo(5000, 1).fadeOut('slow');
> }
> });
> }
> });
>
> });
>
> 
>
> 
>
> //FORM GOES HERE
>
> 
>
> On Nov 18, 3:08 pm, "Atkinson, Sarah" 
> wrote:
>
> > Do I have to create a custom method and stick a function in there?



[jQuery] Re: IDEs of jQuery

This isn't specifically for jQuery, but NetBeans handles it extremely
well. I use the Early Access for PHP version.

Michael



On Nov 19, 4:13 am, Ankur_Patel  wrote:
> Can any one tell me name of jQuery IDEs... like dreamweaver use of IDE as
> HTML,PHP,ASP,XML,CSS
>
> Any IDE there for jQuery code so we can write codes easy & fast
>
> Thanx


[jQuery] Can't get image's dimension under a hidden object

1.

$(window).load(function() {
alert($('#img1').width());
});

2.



$(window).load(function() {
alert($('#img2').width());
});

case 1 can get the dimension, but case 2 can't, how to get it?


[jQuery] re-firing a click event on a link.

hi

i've got a page (asp.net) where I trap the click event of a link.
i then do some dirty checking and present a dialog to the user,

var clickedLink;

$('.checkdirty').click(function(event) {
 if(isDirty == false){
  return true;
  }
  clickedLink = $(this);
  $('#dirtysave-dialog').dialog('open');
  return false;
});

do you want to loose your changes Yes/No etc.

 $('#dirtysave-dialog').dialog({ bgiframe: true, autoOpen: false,
height: 125, width: 425, modal: true,
 title: "You have unsaved changes, do you want to continue
and loose changes?!!",
 buttons: {
 "Yes": function() {
 isDirty = false;
 $(this).dialog("close");
 $(clickedLink).click();
 },
 "No": function() {
 $(this).dialog("close");
 }
},
open: function(type, data) {
$(this).parent().appendTo("form");
}
});

if they click yes i then clear the isDirty flag and call click on the
link. this goes back in to the click event handler, does the check

if(isDirty == false){
 return true;
}

returns true but the event never happens

i need to click the link again manually for it to fire.

any ideas??


[jQuery] Nested Accordion menu upto 4 levels deep

Hello All,

Is there any site/plugin that provides the accordion menu to be 4 levels
deep? I know this could be achieved using treeview plugin but  I want an
accordion menu.

container1
-container1.1
--container1.2
---container1.3
Menu Item1.3.1
Menu Item1.3.2
container2
-container2.1
--container2.2
---container2.3
Menu Item2.3.1
Menu Item2.3.2

Any help will be appreciated.

Thanks in advance,

Chandan Luthra
Intelligrape Software Pvt. Ltd.
site: www.intelligrape.com
blog: www.intelligrape.com/blog


[jQuery] superfish navbar issue in Afterburner or JA-Purity Templates

Hello, this is a repost of my first post.

The Superfish navbar menu reverts to a "classic" dropdown menu when in
NAV module of Afterburner template or HORNAV module of JA-Purity
template.  It works fine in other module positions and other types of
menu displays behave as they should.

I tried to compare code when the navbar displays correctly in other
module positions and when it doesn't in the NAV (or HORNAV) modules
positions but the CSS is similar.  [I've only been with CSS and
Javascript for a few days] and that is why I suspect a bad parameter
handling in a script [without conviction!] that happens only  if the
navbar setting is chosen.

I tried on different test sites and the same happens.
I tried disabling JavaScript and the same happens.
MooTools can be on or off with same results.

I'm developping on localhost with FF and the help of FireBug.

I tried so many -small- code changes and settings variations that I am
confused and unable to say if it is CSS or script related.  I've got
the unnerving beginner's feeling that it is a simple affair
Who will show me the way?


[jQuery] No reaction with $('a').click(), OK with dispatchEvent(...)

Hi,

I have an element like this: #a1
However, when I do this: $('#a1').click(); ... then my doSomething()
do not get called. Why?

If I make my own click function, like this:
function clickAt(targetElement) {
var evt = document.createEvent("HTMLEvents");
evt.initEvent("click", "true", "true");
return targetElement.dispatchEvent(evt);
}

... and call it this way: clickAt($('#a1')[0]); ... then my doSomething
() do get called.

If you like, you can try it out here: 

/Jon


[jQuery] Re: crossSlide with preloaded images

ANY HELP PLS.

On Nov 18, 9:03 pm, Vivek  wrote:
> Hi,
>
> I am using CrossSlide plugin (http://www.gruppo4.com/~tobia/cross-slide.shtml
> ) for my website however the images loads slowly. How can i make my
> images to preload for CrossSlide.
>
> Thanks


[jQuery] jq 1.3.2 in IE6 syntax error line 324

Either jquery-1.2.3.js or jquery-1.3.2.min.js, i got the error in
IE6,other browsers without error.
the code:

$(function(){
$('#username').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
$('#password').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
$('#valicode').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
});

Can anyway help me please? I think it's something really simple and
I'm just being stupid.

Many thanks for reading and sorry for my poor English.


[jQuery] Wait the function end the post and then do this

Tenho uma função que chama outra função

function refreshEstado(estado, cidade){
$.post(
'../busca_estados.php',{
UF: $mUF
},
function(data){
$('#result-estado').html(data);
refreshCidade(cidade);

/*block marked with []*/
$('#tx_uf').removeAttr("disabled");
$('#tx_cidade').removeAttr("disabled");
);
}

another function:

function refreshCidade(cidade){
$.post(
'../cad_cidade/busca_cidade.php',{
UF: $('#tx_uf').val(),
CIDADE: cidade
},
function(data){
$('#result-cidade').html(data);
}
);
}

I want only when the function refreshCidade () ends his post the
refreshEstado () execute the block marked with [] and what comes after
it


Re: [jQuery] Slide with jQuery.

$("h4").click(function(){
   $(this).next('div').slideToogle();
}).trigger('click');

On Thu, Nov 19, 2009 at 04:11, srikanthv  wrote:

> I have to implement slide on each  question. by default question
> will be collapse. when I click on on question it should be slide down
> (expand). How can I implement this on jQuery? Please forward me
> solution.
>
>
> What is jQuery? 
> 
> jQuery is a lightweight JavaScript library that emphasizes
> interaction between JavaScript and HTML. 
> It was released in January 2006 at BarCamp NYC by John Resig.
> jQuery is free, open source software Dual-licensed under the MIT
> License and the GNU License
> 
>
>
> What are jQuery features
> 
> DOM element selections using the cross-browser open source selector
> engine 
> DOM traversal and modification (including support for CSS 1-3 and
> basic XPath)
> Events
> 
>


Re: [jQuery] Re: IE loops while infinite (jQuery). Firefox works fine. Anyone can help fixing script for IE?

2009/11/19 hagbardceline 

> @Michel
>
> Yes, basically you're totally right. Your script is much nicer and
> does not nest loops.
> Logic is not exactly as it should be.
>
> The idea is:
>
> After each closing h3 tag () inside modAccordion container append
> an opening div () tag.
> Before every opening h3 tag () but not before the first opening h3
> tag add a closing div () tag.
> Finally before the closing div tag from the modAccordion container,
> add a closing div () tag.
>

Isn't it what my script does precisely ?

$(".modAccordion > h3").each(function() {
var switch = true;
 $(this).nextAll()
.select(function() { return switch && (switch = ! $(this).is('h3')); })
.wrapAll('');
});

line 1 : round all h3 in .modAccordion and for each
line 3 : | select all next elements
line 4 : | | pick those of these elements that are just before the next h3
(the resulting selection is placed between current h3's closing tag and next
h3's opening tag)
line 5 : | | wrap all these elements in one and the same div with
class="new" (between current h3 and next h3 according to line 4)


> But you got me close!
>

Thanx anyway, I appreciate your help.
>
>
As long as you're close that's fine by me anyway.

Kind regards.

Michel Belleville


[jQuery] Re: IE loops while infinite (jQuery). Firefox works fine. Anyone can help fixing script for IE?

@Michel

Yes, basically you're totally right. Your script is much nicer and
does not nest loops.
Logic is not exactly as it should be.

The idea is:

After each closing h3 tag () inside modAccordion container append
an opening div () tag.
Before every opening h3 tag () but not before the first opening h3
tag add a closing div () tag.
Finally before the closing div tag from the modAccordion container,
add a closing div () tag.

But you got me close!

Thanx anyway, I appreciate your help.

Regards,

hagbard (aka Boris)

On 19 Nov., 10:14, Michel Belleville 
wrote:
> If I may be so bold, perhaps you'd be better off using iterators and avoid
> nesting while loops based on the same numeric condition.
>
> For exemple, let's imagine I'd like to round up all h3 nodes and their
> immediate following siblings in neat s here's what I'd do :
>
> $(".modAccordion > h3").each(function() {
> var switch = true; // will be used in the select iteration to stop the
> selection when reaching the next h3 element
> $(this).nextAll() // selects all the next siblings
> .select(function() { return switch && (switch = ! $(this).is('h3')); }) //
> stops the selection when the next h3 is reached
> .wrapAll(''); // wrap all remaining (the immediate
> next siblings before encountering the next h3) in a div with class="new"
>
> });
>
> This should be less messy than nested whiles, while doing the same thing if
> I read your method right.
>
> Michel Belleville
>
> 2009/11/19 hagbardceline 
>
> > I have the following script (see below), which dynamically adds div
> > between closing and opening h3 tags.
> > The script works fine in Firefox but IE is infinite looping the first
> > while.
>
> > Does anyone have an idea how to fix the script for IE?
>
> > Thx!
> > hagbard
>
> >  >  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> > http://www.w3.org/1999/xhtml"; xml:lang="en-us">
> > 
>
> > 
> >  > src="http://tablesorter.com/jquery-latest.js";>
> > 
>
> > jQuery(function(){
>
> >   var nodes = new Array();
> >   nodes = $(".modAccordion").children();
> >   $(".modAccordion").children().remove();
>
> >   var i = 0;
> >   var headerTest = /.(Head)./;
>
> >   while(i < nodes.length)
> >   {
> >      var testNode = nodes[i].toString();
>
> >      if((testNode.match(headerTest))){
> >         $(".modAccordion").append(nodes[i]);
> >         i++;
>
> >         var newDiv = document.createElement("div");
> >         newDiv.className="new";
>
> >         while(i < nodes.length && !((nodes[i].toString()).match
> > (headerTest)))
> >         {
> >            newDiv.appendChild(nodes[i]);
> >            i++;
> >         }
> >         $(".modAccordion").append(newDiv);
> >      }
>
> >   }
>
> > });
>
> > 
> > 
> > div.new
> > {
> >   background: #00ff00;
>
> > }
>
> > .modAccordion
> > {
> >   background: #ff;
>
> > }
>
> > 
> > TableSorter
> > 
> > 
> > 
> >  header 1
> >   some text
> >   some other text
> >  header 2
> >   some text
> >   
> >     list element 1
> >     list element 2
> >   
> >  header 3
> >   some text
> >   some other text
> >   some more text
> >   some different text
> > 
> > 
> > 


Re: [jQuery] JQuery Dialog, bug when page loading?

Try this

http://www.learningjquery.com/2008/10/1-way-to-avoid-the-flash-of-unstyled-content

- Richard

On Thu, Nov 19, 2009 at 2:48 AM, Nicu Marcu  wrote:

> Very good solution, working OK. I try to do something like this on tabs,
> but tabs are hidden permanently. On page loading, tabs are display for a few
> sec, without being organize in tabs. How can I resolve this bug with tabs?
>
> 2009/11/18 Richard D. Worth 
>
> Hide the dialog in the html by putting it in a hidden container, or putting
>> style="display:none;" on the element itself. When you call .dialog('open')
>> that attribute will be removed.
>>
>> - Richard
>>
>>
>> On Wed, Nov 18, 2009 at 4:20 AM, NMarcu  wrote:
>>
>>> Hello all,
>>>
>>>I have a question, I'm not sure if is a Dialog bug or I do
>>> something wrong. When page is loading(at the beginning). I can see for
>>> a short time(approx 1 sec) the component of the Dialog. If I use a
>>> confirmation Dialog, with the question: "Are you sure?", I get this
>>> messages on the page body on page loading. This goes out  after 1 sec,
>>> but this is not acceptable.
>>>
>>>
>>
>
>
> --
> All the best,
>
> Nicolae MARCU
>


[jQuery] Re: superfish navbar - how do I center the whole bar?

Go see there :

http://css-tricks.com/quick-css-trick-how-to-center-an-object-exactly-in-the-center/



On Oct 20, 4:35 am, Shawn  wrote:
> I'm using anavbarwith superfish. I simply put my menu list inside a
> wrapper so the markup looks like this:
>
> 
> ...
> ...
> ...
> 
> 
>
> now I want to make thenavbar-wrapper 100% of width and thenavbarto
> be centered in it, I thought it should be simple just do the following
> css trick
>
> div.navbar-wrapper{ width:100%; text-align:center; }
>
> However this didn't work, the supersish menu just didn't get
> centered.
>
> How can I fix this? Thanks.


[jQuery] jquery 1.3.2 syntax error line 324 in IE6

Whether jquery-1.3.2.js or jquery-1.3.2.min.js,i always got the error.Other
browsers without error.
Below is the code:

$(function(){
$('#username').keydown(function(event){
 if(event.keyCode==13){
formLogin();
}
 });
$('#password').keydown(function(event){
if(event.keyCode==13){
 formLogin();
}
});
 $('#valicode').keydown(function(event){
if(event.keyCode==13){
formLogin();
 }
});
});

Can anyway help me please? I think it's something really simple and I'm just
being stupid.

Many thanks for reading and sorry for my poor English.

https://twitter.com/viperasi
my fridge!:http://bit.ly/ohBHG
有事您说话


[jQuery] Slide with jQuery.

I have to implement slide on each  question. by default question
will be collapse. when I click on on question it should be slide down
(expand). How can I implement this on jQuery? Please forward me
solution.


What is jQuery? 

jQuery is a lightweight JavaScript library that emphasizes
interaction between JavaScript and HTML. 
It was released in January 2006 at BarCamp NYC by John Resig.
jQuery is free, open source software Dual-licensed under the MIT
License and the GNU License



What are jQuery features

DOM element selections using the cross-browser open source selector
engine 
DOM traversal and modification (including support for CSS 1-3 and
basic XPath)
Events



[jQuery] Can't get the image width

1.

alert($('#img1').width());

2.



alert($('#img2').width());

case 1 can get the width of the image, but case 2 will fail, how to
solve this problem?



[jQuery] Re: Change all CSS background images url

Hi All:

  Definitively the best solution is to use relative URL in CSS.

   Thank you all for help.


On 17 nov, 16:07, Liam Byrne  wrote:
> Why are you using a root-relative URL ?
>
> If the entire site is in a folder, and then you move everything into
> another folder, everything will stay relative.
>
> Therefore, having the path as "img" (or whatever the relative path to
> that folder is) should work, no ?
>
> Liam
>
> nomen wrote:
> > Hi all:
>
> >     I have a website. All my images are in "/img" directory.
> >     Now, my client needs to put the site in a subdirectory, so, my
> > images are now in "/subdir/img".
> >     In the future, maybe we have to change the site to another
> > subdirectory.
> >     I don t want to change all my CSS anytime the client changes the
> > subdirectory.
> >     So my question is:
> >         Is there a simple way to change all CSS background-image
> > property with the next logic:
>
> >                "Change all the existing CSS background-image
> > properties in this way:
> >                    if the url starts with "/img" change to "/subdir/
> > img" else do nothing"
>
> >    Thank you for your help in advance.
>
> > 
>
> > No virus found in this incoming message.
> > Checked by AVG -www.avg.com
> > Version: 8.5.425 / Virus Database: 270.14.67/2506 - Release Date: 11/16/09 
> > 07:43:00


[jQuery] Problems with quotes

Hi,

I have databse entries like: CUBE Streamer  'sloping'
ULTEGRA 3 x 10 (99€/Woche)

I use this text with jquery and I am writing this text into a div.
When reloading my page, because of a form validation, the text gets
automatically like this:

CUBE Streamer \'sloping\' ULTEGRA 3 x 10 (99€/Woche)

This way, I write the text into the div:

$('#selected_cat_name').text(cat_name).html(cat_name);

When I Is there a way to avoid getting the \?submit my form another
time, the text looks like CUBE Streamer \\\'sloping\\\' ULTEGRA 3 x 10
(99€/Woche)


[jQuery] Re: Simple XML parsing - getting the element tag

On Nov 18, 5:17 pm, "Bryan Garaventa"  wrote:
> What happens when you replace
>       alert ("element content is: " + $(this).text());
> with
> alert(this.nodeName);
> ?

Perfect! This gives me the exact information I need :)

Thanks for the help!

Seb


Re: [jQuery] Re: Functions

What you are looking for is "event delegation".

In your last version, you are attaching a "click" event handler to
every  you add to your table. It can be time and resource
consuming.

A better way is to bind the "click" event to the container where you
will load your dynamic content and wait for the event to bubble up to
the container. Using jQuery, you can retrieve the clicked  using
the "target" property of the event object.

// I assume here that "tb" is not loaded dynamically and is already
here at page load
$(document).ready(function()
{
$("#tb").bind('click', function(event)
{
// Find the clicked  in the table.
// Using closest since user can click on 
// or any element inside of .
var $a = $(event.target).closest('a');

// $a contains the clicked 
// Do whatever you want...
});
});


Denis Caggiano a écrit :
> Now Im get confused...
> Wil, Is the code that you suggested equal that I wrote?
>
> Mine
> $("#tb a").click(function() {
>alert(this.id);
> });
>
> Wil
> $("#tb a").click(function() {
>alert('Test');
>  });
>
> Tks


[jQuery] Re: jQuery plugin not working in Firefox?!

Think I found out what the problem is!

This is how my js code looked:


 $(window).load(function(){
 $('body').dragscroll();
});

When I now tried