[jQuery] Potential Bug with next()

2009-04-09 Thread James Hughes
Please see the sample code below.  Running it in FF and checking the
console should give you the error I am seeing.  I know the code is
pretty weird - it is simply an experiment.  But when I warp a retrieved
Comment node (using contents) and do .next() it seems to skip the actual
sibling it should get.  Is this a bug?

 

html

head

script src=http://code.jquery.com/jquery-latest.js;/script

script

  $.annotated = function(filter, root){

 

  if(filter){

filter = (filter.constructor == String)?[filter]:filter;

  }

 

  var annotations = $(root ||
document).find('*').andSelf().contents(

[nodetype=8][nodevalu...@]

  );

  var annotated = annotations.map(

function(){

  var target = $(this).next();

  console.log(.next() == , target)

  console.log(but nextSibling ==, this.nextSibling)

  return target;

}

  );

 

  return $( $.unique(annotated.get()) );

  }

 

  $(function(){

$.annotated()

  });

/script

 

/head

body id=body

 

form id=frm1

input id=text001 type=text /br/

!...@constraints({mandatory:true})--input id=text002
type=text/br/

/form

/body

/html

 

 

James Hughes | Senior Software Engineer | Kainos | DD: +44 (0)28 9057
1100 | Fax: +44 (0)28 9057 1101 | j.hug...@kainos.com

 


--
This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] 413 FULL head

2009-02-25 Thread James Hughes
I realise this may not be related to jQuery specifically but sending the
contents of a textarea (rich content being edited in the browser) via an
ajax call.  I keep getting a 413 FULL head error in the Ajax call.  It
seems to be occurring because there is too much info being pushed via
the Ajax call.  Is there any easy way around this?

 

James.

 



This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Getting All DOM Elements except Ones with parent X

2009-02-16 Thread James Hughes
Hi,

 

I want to attach an event to all DOM elements except ones who are
children of a div with an id of #stylebox.  Is there a complex selector
that will do that?

 

I got as far as *:not( and then got stumped!!!

 

Thanks in advance

 

James.



This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Getting All DOM Elements except Ones with parent X

2009-02-16 Thread James Hughes
I think I answered my own question

 

*:not(#stylebox *)

 

Seems to work 

 

Thanks

 



From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of James Hughes
Sent: 16 February 2009 12:12
To: jquery-en@googlegroups.com
Subject: [jQuery] Getting All DOM Elements except Ones with parent X

 

Hi,

 

I want to attach an event to all DOM elements except ones who are
children of a div with an id of #stylebox.  Is there a complex selector
that will do that?

 

I got as far as *:not( and then got stumped!!!

 

Thanks in advance

 

James.

This e-mail is intended solely for the addressee and is strictly
confidential; if you are not the addressee please destroy the message
and all copies. Any opinion or information contained in this email or
its attachments that does not relate to the business of Kainos is
personal to the sender and is not given by or endorsed by Kainos. Kainos
is the trading name of Kainos Software Limited, registered in Northern
Ireland under company number: NI19370, having its registered offices at:
Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland.
Registered in the UK for VAT under number: 454598802 and registered in
Ireland for VAT under number: 9950340E. This email has been scanned for
all known viruses by MessageLabs but is not guaranteed to be virus free;
further terms and conditions may be found on our website -
www.kainos.com 



This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Calendar with jQuery or pure JavaScript??

2009-01-30 Thread James Hughes

 
I guess if you are competent in both it's doesn't really matter though I'd 
think jQuery would be better as you'd have less cross browser incompatabilites 
to deal with etc.  Also I'd look at the Date Picker in jQuery UI 
(http://jqueryui.com/demos/datepicker/inline.html).  I have played/hacked about 
with it in the past and manged to get the inline version to span an entire 
screen.  With a bit more work you could extend it.



From: jquery-en@googlegroups.com on behalf of AndreMiranda
Sent: Fri 30/01/2009 01:40
To: jQuery (English)
Subject: [jQuery] Calendar with jQuery or pure JavaScript??




Hi everyone!

I need to make a Schedule/Calendar just like Google Calendar, but with
some customizations...

Do you guys think it is better to make it with jQuery or straight
JavaScript??

Thanks!!!




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Calendar with jQuery or pure JavaScript??

2009-01-30 Thread James Hughes

From what I understand this sort of functionality is somewhere on the TODO 
list of the jqueryui date picker.  The Development wiki suggests an agenda 
calendar that holds sub elements (events etc) though I doubt there has been 
much work on it.  There are some non jquery examples knocking around out 
there.  



From: jquery-en@googlegroups.com on behalf of AndreMiranda
Sent: Fri 30/01/2009 09:59
To: jQuery (English)
Subject: [jQuery] Re: Calendar with jQuery or pure JavaScript??




Hi James!!

I already use DatePicker in my project and it will be associated with
my Schedule. I will have to make a daily schedule, for example, with
hour starting at 00:00h and ending at 23:00h and associate events with
it, like lunch with Paulo at 14:30h and so on...

It will be a hge challenge!!




On Jan 30, 6:53 am, James Hughes j.hug...@kainos.com wrote:
 I guess if you are competent in both it's doesn't really matter though I'd 
 think jQuery would be better as you'd have less cross browser 
 incompatabilites to deal with etc.  Also I'd look at the Date Picker in 
 jQuery UI (http://jqueryui.com/demos/datepicker/inline.html).  I have 
 played/hacked about with it in the past and manged to get the inline version 
 to span an entire screen.  With a bit more work you could extend it.

 

 From: jquery-en@googlegroups.com on behalf of AndreMiranda
 Sent: Fri 30/01/2009 01:40
 To: jQuery (English)
 Subject: [jQuery] Calendar with jQuery or pure JavaScript??

 Hi everyone!

 I need to make a Schedule/Calendar just like Google Calendar, but with
 some customizations...

 Do you guys think it is better to make it with jQuery or straight
 JavaScript??

 Thanks!!!




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Initial Event Registration

2009-01-30 Thread James Hughes

Hi,
 
Is there a plugin kicking around anywhere that would let me declare events on 
object in a more declarative manner eg instead of
 
$('#button1').click(function(){..}).blur(function(){...})
$('#button2').click(function(){..})
etc etc
$('#button3').click(function(){..})
 
Doing it this way
 
$.register(
'#button1:click' : function(){...},
'#button1:blur : function(){...},
'#button2:click' : function(){...}
'#button3:click' : function(){...}
)
 
or
 
$.register(
'#button1' :{
click:function(){...}
blur:function(){...}
} 
'#button2:click' : function(){...}
'#button3:click' : function(){...}
)
 
Anyone know of something like this?
 
James


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: autocomplete plugin by bassistance - loading of huge number of records

2009-01-29 Thread James Hughes

Personally I'd recommend only returing only a small subset of the results from 
the backend.  Rather than returning all 5000+ results needlessly (is anyone 
going to really look through them all or just keep filtering?).  Limit the DB 
query to 100 or so.  You'll need to set matchSubset = false though on the 
autocomplete object otherwise you autocomplete won't be accurate.  I will say 
this depends on the type of results being returned from the back end,  turning 
off matchSubset can have a performance hit if you have low network speeds etc 
as it will always make a call to the backend.
 
Also maybe you should be filtering after more keystrokes - are you really 
gaining anything by filtering at three if the result sets are so large?
 
Just my $0.02
 
James.



From: jquery-en@googlegroups.com on behalf of Saumin
Sent: Thu 29/01/2009 14:48
To: jQuery (English)
Subject: [jQuery] Re: autocomplete plugin by bassistance - loading of huge 
number of records




Hi Jörn
Thanks for your quick response. Would you have some sample code to do
that? It would be great if you can point me in a direction with
respect to jquery.autocomplete.js.

I appreciate it.
Saumin

On Jan 29, 3:28 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 I recommend hard limiting the items loaded from the server, in
 combination with scrolling. For example, load 100 items (should be
 fast enough), but display only 10. The other 90 can be checked by
 scrolling, while it is rather obvious that its easier to reduce the
 list by typing more.

 Jörn



 On Wed, Jan 28, 2009 at 10:07 PM, Saumin saumin.pa...@gmail.com wrote:

  hi,
  we are using theautocompleteplugin by bassistance.de. Our business
  people want the users to search database with half a million rows. We
  have minChars set as 3, but then also some combinations get around
  5000 rows. In that case, the user has to wait for at least 20+
  seconds. I know that the database query comes back with results in
  less than 1 second, but the function filllist() takes lot of time as
  there are lot of records. Is there anything somebody can suggest to
  make it load faster? If not, i wanted to introduce paging in this
  control. Has this been done? I would really appreciate a quick
  response.

  Thanks!- Hide quoted text -

 - Show quoted text -




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Suggester under browser's one

2009-01-26 Thread James Hughes

Try this,
 
input type=text name=cc autocomplete=off /
 


From: jquery-en@googlegroups.com on behalf of ilmarik
Sent: Mon 26/01/2009 13:19
To: jQuery (English)
Subject: [jQuery] Suggester under browser's one




I'm building simple mechanism to show user's list of possible choices
after s/he writes some letters to input box. but, browser remembers
last choices (after form submit) and shows its own suggest over my
suggester. Is there any way to hide/stop showing browser's original
suggester?




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Implementing a Knob Control

2009-01-26 Thread James Hughes

Do you mean a gague control?  IE some sort of rotary control vs a slider?

 


From: jquery-en@googlegroups.com on behalf of legofish
Sent: Mon 26/01/2009 14:49
To: jQuery (English)
Subject: [jQuery] Implementing a Knob Control




Hi,
I need to implement a knob control for one of my projects (eg. a
volume knob). Ideally I would like to use jquery. I have spent some
time searching for any resources to get started. Not only I can't find
anything in jquery, I can't find anything even resembling a knob
implementation in javascript in general. I did find a few sites who
sell VB or .net knob controls, but nothing in js.

anyway, not sure if anyone can help, but any hints towards a resource
or starting point would be much appreciated.




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Is A Child Of?

2009-01-22 Thread James Hughes

 
Hi,
 
This is probably a really easy question an I apologise if it appear stupid but 
I am clueless right now.  Given 2 jQuery objects (a,b) how can I tell if b is a 
child of a?
 
James


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Is A Child Of?

2009-01-22 Thread James Hughes

Excellent.  Funny it seems like such a common task when you think about it 
though I've never needed it before and given the verbosity of the solution it 
seems not many other people have need it either :-P
 
Anyways thanks again you saved my sanity.
 
James.



From: jquery-en@googlegroups.com on behalf of Richard D. Worth
Sent: Thu 22/01/2009 09:39
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Is A Child Of?


My first thought was to try these and neither worked

$(b, a).length

a.find(b).length

Also, no luck here

$(b[0], a[0]).length

a.find(b[0]).length

In the end this is the one I could get to work

$(b).parents().filter(function() { return this === a[0]; }).length

- Richard


On Thu, Jan 22, 2009 at 4:25 AM, James Hughes j.hug...@kainos.com wrote:




Hi,

This is probably a really easy question an I apologise if it appear 
stupid but I am clueless right now.  Given 2 jQuery objects (a,b) how can I 
tell if b is a child of a?

James http://www.kainos.com/ 







This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Identify last keeypess

2009-01-21 Thread James Hughes

Stick autocomplete=off in your input tag and that should do it
 
input type=text name=login autocomplete=off /
Though this might cause XHTML validation to fail if that's an issue



From: jquery-en@googlegroups.com on behalf of rob303
Sent: Tue 20/01/2009 16:40
To: jQuery (English)
Subject: [jQuery] Re: Identify last keeypess




Thanks again.  On reflection I think you are right James.  I should
probably disable autocomplete for this field and doing so would
resolve my issue.

However, I've taken a quick look at the nocomplete plugin and that's
not really what I want as it breaks some other functionality I have on
those inputs.

Is there a simple an elegant way to do it?

Thanks!

Rob.

On Jan 20, 3:24 pm, James Hughes j.hug...@kainos.com wrote:
 On a side note...

 Do you want/need autocomplete becasue it is possible to stop a textfield 
 being capable of autocomplete.  I ask simply becasue your example uses a 
 login field and sometimes it's not security concious to allow autocomplete on 
 some login fields.

 Otherwise you'll just have to log what key was pressed in an external 
 variable EVERYTIME a key is pressed and check that variale at the start of 
 every keypress event.

 James




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] [UI Slider] Specifying Initial Value

2009-01-20 Thread James Hughes

Hello,
 
Can someone confirm if this is possible?  I generate a page that has 10+ 
sliders on it.  Each has a different initial value when the page loads.  Is 
there a way to set the inital value as part of the div element?  The reason I 
ask is that I'd like to do a blanket $('slider-class').slider({...opts...}) 
rather than having to do 
$('slider-class').each(function(){$(this).slider({value:somevalue})}) .  I 
realise they are quite similar but it looks less neat when it's done.  Surely 
there must be way to specify say div class=slider-class initialValue=3/ for 
example?
 
James.


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Identify last keeypess

2009-01-20 Thread James Hughes

Rob,
 
Is this some sort of autocomplete text box or is it a select input?
 
James



From: jquery-en@googlegroups.com on behalf of rob303
Sent: Tue 20/01/2009 13:44
To: jQuery (English)
Subject: [jQuery] Identify last keeypess




Hi,

I've been searching the web for an answer to this but haven't been
able to find one.

I have a form which is using an image as it's submit button and I want
users to be able to submit the form by pressing enter.  Simple enough:

// submit the login form if the user hits enter
$('.login_input').keypress(function(event) {
  if(event.keyCode == 13) {
$('#login').submit();
  }
});

That works fine.  However, if the user is presented with a list of
options for the text input by their browser and they use the up and
down arrows keys to highlight, then enter to select an option the form
gets submitted.  Not ideal!  So, my question is how can I identify the
last key press before the user hits enter?  Ideally my logic will be
something like:

$('.login_input').keypress(function(event) {
  if(LAST KEYPRESS IS NOT UP OR DOWN ARROW) {
if(event.keyCode == 13) {
  $('#login').submit();
}
  }
});

Hopefully, that makes sense!  Many thanks in advance for any help.

Rob.




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Identify last keeypess

2009-01-20 Thread James Hughes

On a side note...
 
Do you want/need autocomplete becasue it is possible to stop a textfield being 
capable of autocomplete.  I ask simply becasue your example uses a login field 
and sometimes it's not security concious to allow autocomplete on some login 
fields.
 
Otherwise you'll just have to log what key was pressed in an external variable 
EVERYTIME a key is pressed and check that variale at the start of every 
keypress event.
 
James



From: jquery-en@googlegroups.com on behalf of rob303
Sent: Tue 20/01/2009 14:58
To: jQuery (English)
Subject: [jQuery] Re: Identify last keeypess




Hi James,

Thanks for the reply.  It's just a standard text input:

input class=login_input type=text name=user value= /

When the user clicks and starts to type the browser may, depending on
what's been entered before, give a list of options.  Some users might
use the down or up arrow keys to highlight one of the options and then
hit submit to select it.  This, I think, is standard browser behaviour
- unless I have it wrong?  Unfortunately for me, hitting enter at that
point will submit the form.

Any help would be much appreciated!

Rob.

On Jan 20, 1:56 pm, James Hughes j.hug...@kainos.com wrote:
 Rob,

 Is this some sort of autocomplete text box or is it a select input?

 James

 

 From: jquery-en@googlegroups.com on behalf of rob303
 Sent: Tue 20/01/2009 13:44
 To: jQuery (English)
 Subject: [jQuery] Identify last keeypess

 Hi,

 I've been searching the web for an answer to this but haven't been
 able to find one.

 I have a form which is using an image as it's submit button and I want
 users to be able to submit the form by pressing enter.  Simple enough:

 // submit the login form if the user hits enter
 $('.login_input').keypress(function(event) {
   if(event.keyCode == 13) {
 $('#login').submit();
   }

 });

 That works fine.  However, if the user is presented with a list of
 options for the text input by their browser and they use the up and
 down arrows keys to highlight, then enter to select an option the form
 gets submitted.  Not ideal!  So, my question is how can I identify the
 last key press before the user hits enter?  Ideally my logic will be
 something like:

 $('.login_input').keypress(function(event) {
   if(LAST KEYPRESS IS NOT UP OR DOWN ARROW) {
 if(event.keyCode == 13) {
   $('#login').submit();
 }
   }

 });

 Hopefully, that makes sense!  Many thanks in advance for any help.

 Rob.




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] JSON with ajaxComplete

2009-01-16 Thread James Hughes

Hello,
 
I have a generic ajaxComplete event that does soe generic stuff to my screen 
once ajax calls complete.  All calls will return a JSON object with at least a 
success property.  The thing is the ajaxComplete arguments don't have my 
response in JSON (regardless of specifying type in the call).  It does 
obviously contain the responseText but my question is do I just call an eval on 
this or os there a cleaner jQuery way to do this?
 
Regards,
 
James.


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] jQuery API in XML or JSON Format

2008-12-17 Thread James Hughes

Hello,
 
I was wondering if anyone knew where I could get my hands on the 1.2.6 API 
documentation in either JSON or XML format (preferably XML)?  I looked at the 
visualjquery website but for some reason the JSON payload when pasted into 
another page (var payload = { long object }) seems to actually execute 
all the code within it.  So is there any resources out there for doing that?
 
James
 


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: [validate] Remote Call Failing

2008-12-15 Thread James Hughes

Ah.  I thought i was.  That explains it! 
 
Thanks for the response
 
James.
 
 


From: jquery-en@googlegroups.com on behalf of Jörn Zaefferer
Sent: Mon 15/12/2008 12:44
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: [validate] Remote Call Failing



Updating to 1.5 should fix the issue.

Jörn

On Mon, Dec 15, 2008 at 11:14 AM, James Hughes j.hug...@kainos.com wrote:

 Hello,

 I am trying to set up a remote validation field using the Validate plugin but 
 for some reason it's not working.  Here is my code,

 $(#myform).validate({
  rules: {
name: {
remote: {
url: /remote-validation/sample/remoteValidate,
data: { field: 'name' }
}
},
age:{
required:true,
number:true
}
  }
 });


 The error I am getting is below.

 s.url.match is not a function
 http://localhost:9090/remote-validation/js/jquery/jquery-1.2.6.js
 Line 2605

 Now if I specify the remote as a string url rathern than an options object it 
 seems to work but that doesn't suit my needs.  It appears I SHOULD be able to 
 use an options object but it's simply not working.  Am I doing something 
 wrong?

 James







This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] [validate] Remote Call Failing

2008-12-15 Thread James Hughes

Hello,

I am trying to set up a remote validation field using the Validate plugin but 
for some reason it's not working.  Here is my code,

$(#myform).validate({
  rules: {
name: {
remote: {
url: /remote-validation/sample/remoteValidate,
data: { field: 'name' }
}
},
age:{
required:true,
number:true
}
  }
});

 
The error I am getting is below.
 
s.url.match is not a function
http://localhost:9090/remote-validation/js/jquery/jquery-1.2.6.js
Line 2605
 
Now if I specify the remote as a string url rathern than an options object it 
seems to work but that doesn't suit my needs.  It appears I SHOULD be able to 
use an options object but it's simply not working.  Am I doing something wrong?
 
James


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Intercept and Append Param to All Ajax Requests

2008-12-12 Thread James Hughes

Hi,
 
This has me confused.  I want to intercept ALL ajax requests on a page and 
before sending the request append another parameter to the request.  So far 
this is what I have 
 
$.ajaxSetup({
beforeSend : function(xhr, opts){
this.data = $.extend({_kdfrequest:action}, this.data );
}
});  
 
$.ajax({
type:GET,
data:initial.params,
url:initial.url
}); 
 
This does everything except actually append the extra parameter.  Am I doing 
something wrong?
 
James


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: pleeease heeelp me nowwwwww

2008-12-10 Thread James Hughes

Are you mixing any other frameworks on the page e.g. Prototype?
 
 


From: jquery-en@googlegroups.com on behalf of [EMAIL PROTECTED]
Sent: Wed 10/12/2008 09:36
To: jQuery (English)
Subject: [jQuery] Re: pleeease heeelp me noww




ok, the code is:

var flag=false;
$().ready(function(){


$(div#peik).hide();
$('div#cardbanki  div').hide();
$('div#pardakht  div').hide();

..





the error is on first div (like i said in first post)
and if you want url , i must say that it's a persian eshop site
http://www.finaleshop.com http://www.finaleshop.com/ 
you must buy a product and then goto checkout_confirmation.php page
(i suggest that pm me to talk about it ! :-s )


On Dec 10, 12:33 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 nooo,
 it wasn't helpful

 if anybody can help me please send a pm me at yahoo messsenger at
 ( [EMAIL PROTECTED])
 thankks :-s

 On Dec 10, 12:22 pm, JQueryProgrammer [EMAIL PROTECTED] wrote:

  Try this:

  $(function() {
  // your code goes here.

  });

  Also while including the jquery file, write it as:

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

  Check whether this helps.

  On Dec 10, 2:17 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

   hi

   i have written jquery for a site;
   after a while for sth that i don't know it don't work anymore
   and direbug give an error like this:

   $(div#peik) is null
$(div#peik).hide();

   and when i try to write

$(document).ready()

   in firebug, it return :

   TypeError: $(document) is null

   whyyy is that?
   pleeeas answer as soon as posible
   thanks




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Error getting value from server

2008-12-10 Thread James Hughes

What I tend to do in this instance is keep all but config options in an 
external js file.
 
The at the top of my jsp (applicable to ASP as well) page I have a Global 
Config oject
 
var ApplicationConfig = {
sessionId : c:out value=${sessionId} default:'null'/,
otherValue : c:out value=${otherValue} default:'null'/,
}
 
Then in my sepearte JS file I can use these via ApplicationConfig.sessionId.  
It permits dynamic variables while keeping most of the Javascript off the page.
 



From: jquery-en@googlegroups.com on behalf of MorningZ
Sent: Wed 10/12/2008 12:05
To: jQuery (English)
Subject: [jQuery] Re: Error getting value from server




Actually my issue is that I am trying to keep my
html file neat and tidy by putting all my javascript code in a
separate js file

Pick your poison:

- Use inline JS if you want dynamic variables
- Lose the dynamic variables if you want external JS

Your IIS server sees as request for .js (and .css and .html etc
etc) and passes it right back to the client as *plain text*, there is
no ASP processing applied to it





On Dec 10, 5:51 am, brian [EMAIL PROTECTED] wrote:
 This really ought to be asked on an ASP list but I'll try to explain.

 On Wed, Dec 10, 2008 at 3:48 AM, JQueryProgrammer

 [EMAIL PROTECTED] wrote:

  Sorry for the spam. Actually my issue is that I am trying to keep my
  html file neat and tidy by putting all my javascript code in a
  separate js file.

 Believe me: sometimes ya gotta add some inline JS. I know, it's fugly.

  But my javascript code refers to some server side
  variable values which exists in an asp file. I have included that asp
  file in my main asp file along with the js file. But the js file
  dosn't seems to get server variable values. Here is a broad view of my
  code.

  mainpage.asp
  -- !--#include virtual = /mywebsite/child1.asp --
  -- script type=text/javascript src=child1.js/script

  child1.asp
  -- CONST myvar = 100

 Is it CONST or VAR? It's probably not worth sidetracking you at this point 
 but,
 anyway ...

  child1.js
  -- alert(%= myvar%);

 I think you need to step back and re-think this process. Your
 child1.js file is not read by
 the ASP interpreter. Thus, your %= % tags are meaningless therein.
 The only thing
 that reads that JS file is whatever browser that downloaded it. And
 its JS engine doesn't know
 or care about myvar.

 What you should be aiming for is to have ASP (on the server) write
 some text which will be
 sent to the browser where it will (hopefully) be interpreted by the
 browser's JS engine.

 So:

 child1.asp (let's say myservervalue = 'foobar')
 ---

 // this should look something like the following:
 // (is this even a real ASP comment?)

 script type=text/javascript
 var myvalue = %= myservervalue %;
 /script
 script type=text/javascript src=child1.js/script

 The ASP script will (again, hopefully) resolve the %= myservervalue
 % to some string. When the browser
 fetches the page its JS interpreter will see:

 var myvalue = foobar;

 Accordingly, the page will now  have a variable named, myvalue which
 is, foobar.

 child1.js
 

 alert(myvalue);

 The variable that was declared is called, myvalue not %= myvalue
 %. We're on the Javascript Ranch
 now. No need for the flappy tags. You should see a bright, shining
 foobar alert.

 If the page reaches the browser and it still has the % % business
 (view source), it's not working.




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: TableSorter vs CMS

2008-12-10 Thread James Hughes

Does address/1A/js/jquery-1.2.6.min.js exist?  Can you access it via the 
address bar in the browser?
 
Check the Net tab of firebug and see the get request for the JS file - is the 
response a 404 or the contents of the file?
 
James 


From: jquery-en@googlegroups.com on behalf of David Blomstrom
Sent: Wed 10/12/2008 13:08
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: TableSorter vs CMS



I'm checking that right now. If the links to my style sheets are OK (and they 
are), then the links to my JavaScripts should be OK.

However, there is aother possible problem that just occurred to me. I pasted my 
JQuery files in MySite, while the page I'm viewing is in MySite2. I essentially 
have several content management systems sharing includes from one master CMS. 
All my other JavaScript functions have worked correctly but maybe JQuery is 
different?


I'll past the JQuery file into MySite 2, change the link and see if that makes 
a difference...


On Wed, Dec 10, 2008 at 5:03 AM, James Hughes [EMAIL PROTECTED] wrote:



if it saying - 2. $ is not defined

jQuery isn;t included on the page correctly.  Are your directory and 
file names alright?



From: jquery-en@googlegroups.com on behalf of David Blomstrom
Sent: Wed 10/12/2008 13:01
To: jquery-en@googlegroups.com

Subject: [jQuery] Re: TableSorter vs CMS





On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL 
PROTECTED] wrote:



   There is a lot to grasp for you, but what you are doing is 
rather simple.


   Forget the AJAX callback and onSuccess. This is the answer 
to a common problem that you dont have,

   since your not using any AJAX.

   For firebug, you need to activate the console, and look there if 
there is no js error.

OK, I activated Firebug's console, and it reports three errors:
1.  xAddEventListener is not defined
xAddEventListener(window, 'load',
2. $ is not defined
$(document).ready(function()
3. xAddEventListener is not defined
xAddEventListener(window, 'load',

   then in the bottom line of the console, paste this:

   $('table').css('border','10px solid red');

   If your table becomes red, then jquery is there. Otherwise, you 
to load jquery correctly, with the right path.

I pasted it in, but nothing turned red. When you say I have to load 
JQuery correctly, are you simply saying I need the correct path for my links to 
the JavaScript files?
After doing this, I copied the source code, pasted it into my static 
test page, then repeated the process. This time Firebug lists just one error 
(the first error listed above). When I pasted the code into the bottom of the 
console, there was once again no effect; nothing turns red.
However, the table on the static web page is working. The columns are 
sortable and they have alternating colors.
Thanks.



   Olivier

   On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL 
PROTECTED] wrote:


   Thanks for the tips, but I'm confused. You're suggesting 
I use an AJAX callback function and initiate the PHP onSuccess. I searched for 
AJAX callback and onSuccess on JQuery's website but found no information 
about either one.

   I downloaded Firebug, but I'm not yet sure how to use 
it. It displays my webpage on top, with the source code appearing in a bottom 
panel. I don't see any obvious indications of JavaScript errors.


   Thanks.


   On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL 
PROTECTED] wrote:



   I was having the same problem... It depends how 
you call the PHP...
   Best bet is using jquery's AJAX callback 
function and initiate the PHP
   onSuccess...

   i did the same thing here: (use firebug to 
explore the code):
   (everything in the tbody is print()'d by PHP...

   http://www.themeans.info/cms/galleryManager.php

   On Dec 9, 2:24 pm, David Blomstrom [EMAIL 
PROTECTED]
   wrote:

With the help of this group, I got my first 
JQuery function to work - a
combination sortable table columns/alternate 
row colors script. The only

[jQuery] Re: TableSorter vs CMS

2008-12-10 Thread James Hughes

Never worry, if we never made mistakes we'd never learn.  And it's great that 
Firebug is now your friend.
 
James



From: jquery-en@googlegroups.com on behalf of David Blomstrom
Sent: Wed 10/12/2008 13:18
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: TableSorter vs CMS



Wow, you were right - my link/path file was incorrect. I assumed it was OK 
because the links to my style sheets were OK, but there was a PHP error on the 
JavaScript link.

I feel about bad about fueling such a lengthy discussion on a stupid mistake. 
If it's any consolation, I learned how to use Firebug (and got some other 
valuable tips besides). :)


Thanks for all the help.


On Wed, Dec 10, 2008 at 5:11 AM, James Hughes [EMAIL PROTECTED] wrote:



Does address/1A/js/jquery-1.2.6.min.js exist?  Can you access it via 
the address bar in the browser?

Check the Net tab of firebug and see the get request for the JS file - 
is the response a 404 or the contents of the file?

James



From: jquery-en@googlegroups.com on behalf of David Blomstrom

Sent: Wed 10/12/2008 13:08

To: jquery-en@googlegroups.com
Subject: [jQuery] Re: TableSorter vs CMS



I'm checking that right now. If the links to my style sheets are OK 
(and they are), then the links to my JavaScripts should be OK.

However, there is aother possible problem that just occurred to me. I 
pasted my JQuery files in MySite, while the page I'm viewing is in MySite2. I 
essentially have several content management systems sharing includes from one 
master CMS. All my other JavaScript functions have worked correctly but maybe 
JQuery is different?


I'll past the JQuery file into MySite 2, change the link and see if 
that makes a difference...


On Wed, Dec 10, 2008 at 5:03 AM, James Hughes [EMAIL PROTECTED] wrote:



   if it saying - 2. $ is not defined

   jQuery isn;t included on the page correctly.  Are your directory 
and file names alright?

   

   From: jquery-en@googlegroups.com on behalf of David Blomstrom
   Sent: Wed 10/12/2008 13:01
   To: jquery-en@googlegroups.com

   Subject: [jQuery] Re: TableSorter vs CMS





   On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL 
PROTECTED] wrote:



  There is a lot to grasp for you, but what you are doing 
is rather simple.


  Forget the AJAX callback and onSuccess. This is the 
answer to a common problem that you dont have,

  since your not using any AJAX.

  For firebug, you need to activate the console, and look 
there if there is no js error.

   OK, I activated Firebug's console, and it reports three errors:
   1.  xAddEventListener is not defined
   xAddEventListener(window, 'load',
   2. $ is not defined
   $(document).ready(function()
   3. xAddEventListener is not defined
   xAddEventListener(window, 'load',

  then in the bottom line of the console, paste this:

  $('table').css('border','10px solid red');

  If your table becomes red, then jquery is there. 
Otherwise, you to load jquery correctly, with the right path.

   I pasted it in, but nothing turned red. When you say I have to 
load JQuery correctly, are you simply saying I need the correct path for my 
links to the JavaScript files?
   After doing this, I copied the source code, pasted it into my 
static test page, then repeated the process. This time Firebug lists just one 
error (the first error listed above). When I pasted the code into the bottom of 
the console, there was once again no effect; nothing turns red.
   However, the table on the static web page is working. The 
columns are sortable and they have alternating colors.
   Thanks.



  Olivier

  On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL 
PROTECTED] wrote:


  Thanks for the tips, but I'm confused. You're 
suggesting I use an AJAX callback function and initiate the PHP onSuccess. I 
searched for AJAX callback and onSuccess on JQuery's website but found no 
information about either one.

  I downloaded Firebug, but I'm not yet sure how to 
use it. It displays my

[jQuery] Re: TableSorter vs CMS

2008-12-10 Thread James Hughes

if it saying - 2. $ is not defined
 
jQuery isn;t included on the page correctly.  Are your directory and file names 
alright?
 


From: jquery-en@googlegroups.com on behalf of David Blomstrom
Sent: Wed 10/12/2008 13:01
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: TableSorter vs CMS




On Wed, Dec 10, 2008 at 4:14 AM, Olivier Percebois-Garve [EMAIL PROTECTED] 
wrote:



There is a lot to grasp for you, but what you are doing is rather 
simple.


Forget the AJAX callback and onSuccess. This is the answer to a 
common problem that you dont have,

since your not using any AJAX.

For firebug, you need to activate the console, and look there if there 
is no js error.

OK, I activated Firebug's console, and it reports three errors:
1.  xAddEventListener is not defined
xAddEventListener(window, 'load',
2. $ is not defined
$(document).ready(function()
3. xAddEventListener is not defined
xAddEventListener(window, 'load',

then in the bottom line of the console, paste this:

$('table').css('border','10px solid red');

If your table becomes red, then jquery is there. Otherwise, you to load 
jquery correctly, with the right path.

I pasted it in, but nothing turned red. When you say I have to load JQuery 
correctly, are you simply saying I need the correct path for my links to the 
JavaScript files?
After doing this, I copied the source code, pasted it into my static test page, 
then repeated the process. This time Firebug lists just one error (the first 
error listed above). When I pasted the code into the bottom of the console, 
there was once again no effect; nothing turns red.
However, the table on the static web page is working. The columns are sortable 
and they have alternating colors.
Thanks.



Olivier

On Wed, Dec 10, 2008 at 1:02 PM, David Blomstrom [EMAIL PROTECTED] 
wrote:


Thanks for the tips, but I'm confused. You're suggesting I use 
an AJAX callback function and initiate the PHP onSuccess. I searched for AJAX 
callback and onSuccess on JQuery's website but found no information about 
either one.

I downloaded Firebug, but I'm not yet sure how to use it. It 
displays my webpage on top, with the source code appearing in a bottom panel. I 
don't see any obvious indications of JavaScript errors.


Thanks.


On Tue, Dec 9, 2008 at 2:31 PM, taylormade [EMAIL PROTECTED] 
wrote:



I was having the same problem... It depends how you 
call the PHP...
Best bet is using jquery's AJAX callback function and 
initiate the PHP
onSuccess...

i did the same thing here: (use firebug to explore the 
code):
(everything in the tbody is print()'d by PHP...

http://www.themeans.info/cms/galleryManager.php

On Dec 9, 2:24 pm, David Blomstrom [EMAIL PROTECTED]
wrote:

 With the help of this group, I got my first JQuery 
function to work - a
 combination sortable table columns/alternate row 
colors script. The only
 problem is that it works on my static page but not on 
a dynamic page in my
 content management system (PHP).

 The weird thing is that I copied the source code from 
a dynamic page into my
 static page, and it does work - but only on the 
static page.

 On my dynamic page, the sortable column function 
doesn't work at all. The
 zebra stripes function works only to the extent that 
any row I mouseover
 acquires a colored background.

 Does anyone have a hunch what's going on?

 Thanks.

 * * * * *

 script src=/1A/js/jquery-1.2.6.min.js 
type=text/javascript/script
 script src=/1A/js/tablesorter/jquery.tablesorter.js
 type=text/javascript/script
 script language=JavaScript type=text/JavaScript
  $(document).ready(function()
   {
   $(#myTable).tablesorter({ widgets: ['zebra']} );
   }
  );
 /script





-- 
David Blomstrom
Writer  Web Designer (Mac, M$  Linux)

[jQuery] Re: Select option value not working

2008-12-09 Thread James Hughes

$('input[value=GO]').click(function(){});
 



From: jquery-en@googlegroups.com on behalf of JQueryProgrammer
Sent: Tue 09/12/2008 10:32
To: jQuery (English)
Subject: [jQuery] Re: Select option value not working




Great. Thanks. lso is it possible to select an element based on the
value it has.

I have an button like input type=button value=GO /

I want to attach an event to this button. How can I..?

On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 Heh yeah that too. :) Sorry I missed that detail.

 Karl Rudd

 On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

  It could be to do with the select isn't an input tag, it's a select
  tag, try $(select[name='myselect'] option:selected).val(); instead

  Rik

  2008/12/9 Karl Rudd [EMAIL PROTECTED]:

  The SELECT's value is what you want:

 $(input[name='myselect']).val()

  The only time you need to check is individual OPTIONs are selected is
  if you have a multi-select list box.

  Karl Rudd

  On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
  [EMAIL PROTECTED] wrote:

  $(input[name='myselect'] option:selected).val(); is not working. It
  gives undefined. Can anyone please help.

  --
  Rik Lomas
 http://rikrikrik.com http://rikrikrik.com/ 




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Select option value not working

2008-12-09 Thread James Hughes

or more specificly, i think,  $(':button[value=GO]').click(...



From: jquery-en@googlegroups.com on behalf of JQueryProgrammer
Sent: Tue 09/12/2008 10:32
To: jQuery (English)
Subject: [jQuery] Re: Select option value not working




Great. Thanks. lso is it possible to select an element based on the
value it has.

I have an button like input type=button value=GO /

I want to attach an event to this button. How can I..?

On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 Heh yeah that too. :) Sorry I missed that detail.

 Karl Rudd

 On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

  It could be to do with the select isn't an input tag, it's a select
  tag, try $(select[name='myselect'] option:selected).val(); instead

  Rik

  2008/12/9 Karl Rudd [EMAIL PROTECTED]:

  The SELECT's value is what you want:

 $(input[name='myselect']).val()

  The only time you need to check is individual OPTIONs are selected is
  if you have a multi-select list box.

  Karl Rudd

  On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
  [EMAIL PROTECTED] wrote:

  $(input[name='myselect'] option:selected).val(); is not working. It
  gives undefined. Can anyone please help.

  --
  Rik Lomas
 http://rikrikrik.com http://rikrikrik.com/ 




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com