[jQuery] Re: Click Links in the Nnavigation Bar

2009-01-30 Thread Pedram

Dear Karl ,
I know You are Expert in these Issues do you have any idea for me
Thanks

On Jan 29, 5:44 pm, Pedram pedram...@gmail.com wrote:
 Hi Folks ,
   I have some links in my Navigation bar such as below , I Used FIND
 in my code , does anyone has any better solution for me ,
   I also used Event Delegation in the system .

 ul
   lia href=# class=activea/a/li
   lia href=#b/a/li
   lia href=#c/a/li
   lia href=#d/a/li
 /ul

   $(ul).bind(click,function(e){
       var clicked=$(e.target);
       $(this).find(a.active).removeClass(active);
       clicked.addClass(active);
   });


[jQuery] Re: Using $_POST to transmit large key/pair

2009-01-30 Thread Beres Botond

You want to use POST, but you are sending your data as GET (without
url encoding).
So I'm pretty sure it cuts before #, because # is a non-alphanumeric
character and you haven't urlencoded your data.

Data in URL  = GET, not POST, even if you are using $.post .

http://docs.jquery.com/Post

So either urlencode your data before putting it in the request or send
it as POST.

Also I'm not sure how it worked for you on server-side, if you were
expecting $_POST... I assume you were expecting
$_REQUEST instead, which is not a good idea in my opinion.




On Jan 30, 8:08 am, Mark Livingstone namematters...@msn.com wrote:
 I have the following code:

 $.post(order_send_email.php?order_message='+order_message)

 my 'order_message' is:

 'Dear '+data['salutation']+ +data['first_name']+ +data['last_name']
 +', \n\nThis is to inform you that your order #'+key+ and payment in
 the amount of...';

 When using $.POST... the message gets cut before #. Is there a limit
 on how much cam be transmitted or am I doing something wrong?

 Thanks.


[jQuery] Re: cancel jQuery binded event handlers

2009-01-30 Thread 1nd1go


 Having both inline and bound event handlers will always cause
 confusion.

true, but onclick inline handler is appended by a4j framework, which I
can't influence :( The only thing I can do is to append guard to that
handler, like in the first example.

 You could use event.stopImmediatePropagation in the first handler, but
 unfortunaly that is only available through jQuery-added listeners
 (1.3.1).

Exactly. Does any body know how can I reach jQuery created event
object in first handler. I think this could be a solution...


[jQuery] Re: Long Image Scroller (jCarousel)

2009-01-30 Thread Sbudah

I declare you a God.

It works although I still need to change it from being a background
image to a div that changes position but this has helped me and has
most definitely given me ideas. You may see it in action at
http://www.myfuche.com/

Thanks Liam.

On Jan 29, 11:41 pm, Liam Byrne l...@onsight.ie wrote:
 MUCH simpler than that.

 1) Put the image into the background of the 500px div
 2) Capture / track the mouse position
 3) Divide the x-position by 5
 4) Use that to set the x-axis percentage of the background position

 Just make sure you set the IE6 background image cache so that it doesn't
 flicker in that browser.

 Liam

 Sbudah wrote:
  Hi Guys,

  I have a long image that is about 2200 px wide that I need to display
  within a 500px div. I need a solution similar to jCarousel (Lite) that
  would allow users to scroll horizontal either using a Mouse Wheel or
  simply hover a button (preferably right or left half of the image to
  move to the sides).

  So far I have managed to do it if I cut the image into pieces and use
  jCarousel Lite (with Fraction Config) to scroll but I need something
  that would scroll through the whole image without cutting it.

  I'd hate to use Flash; please help!

  Thanks,

  Sbudah
  

  No virus found in this incoming message.
  Checked by AVG -http://www.avg.com
  Version: 8.0.176 / Virus Database: 270.10.15/1923 - Release Date: 
  29/01/2009 07:13


[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] jquery validate rules using css for dynamic controls

2009-01-30 Thread Bhavin

Hi,

In my application, controls are generated dynamically. I want to know
if I can configure rules by giving CSS classes and NOT by specifiying
element name while validating the fields.

I tried following code and works in some scenarios:

var isValid = $(#questionAnswerForm).validate({
  errorLabelContainer: #messageBox,
   wrapper: li
});
if(isValid != null  !isValid.form()){
 return false;
  }

I am using struts controls like html:radio, html:text etc. If I
specify error message in title and class=required then works for
radio, text,textarea.

But how can I configure rules in this situation for e-mail, date,
number, checkbox, fileupload control, matrix control fields? Can I
specify CSS class in rules under validate() ?





[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....

2009-01-30 Thread Stefano Corallo


On 28 Gen, 17:03, Ricardo Tomasi ricardob...@gmail.com wrote:
 It isn't possible to have error/success callbacks for JSONP. You can't
 cancel the request either. Once you add a script tag to the head,
 the browser fires a GET request and it can't be interrupted - even if
 you remove the script before the response comes, the script will still
 run.


ok. got it!

 (the only event that fires on the script tag is 'onload', but it only
 tells you if the content has successfully loaded, not the opposite.
 There is no way to know if an error happened)

 Also, you're misunderstanding the way JSONP works - there is no need
 for a 'success' function, that is the callback function which will be
 called when the response is loaded. Thats 'jsonFlickerFeed' in my
 example.


Ok i've understood how jsonp work, but there's something that i can't
understand.
I try to explain better i can (sorry for my bad english)

1)Using the $.ajax method, an example:
$.ajax({
   type: methodType,
   url: theURL,
   data: params,
   dataType:jsonp,
   success: function(data){
console.log(onClick success);
   }
});

in the jquery core is built a temporary jsonp function to handle the
data returned by the server, if the succes function is defined the
temporary function call the succe function and pass the returned
data ... specifically at line 3314 of the jquery.1.3.1.js :

// Handle JSONP-style loading
window[ jsonp ] = function(tmp){
data = tmp;
success();
complete();
// Garbage collect
window[ jsonp ] = undefined;
try{ delete window[ jsonp ]; } catch(e){}
if ( head )
head.removeChild( script );
};

the tmp is the data returned by the server.

Now in your example you use the jsonFlickrFeed function but without
handling the returned data from the server:

jsonFlickrFeed = function(){ alert('flickr loaded'); };
$.jsonp({
  url: 'http://api.flickr.com/services/feeds/photos_public.gne?
tags=hackdayindialang=en-usformat=jsoncallback=jsonFlickrFeed',
  timeout: 10,
  onTimeout: function(url){ console.error('jsonp script timed out:
'+url) }
});

how to access the data returned from the server? How to modify the
$.jsonp function to call the success function defined and pass in the
data returned from the server ... this is sure possible case jquery in
$.ajax call do it, but i don't know how :-/

Many thanks, really!

I hope i've been clear, sorry for my english!


[jQuery] Re: issue with ajax function

2009-01-30 Thread Beres Botond

A parameter has to be key=value, in some form, otherwise how is it
identified?

contentType: application/json; charset=utf-8,

This should only be set if your webservice expects the input parameter
in JSON format as well, and not only the response is JSON.
Is this the case?

How does the code of your webservice look like? (the part which gets
the input parameter)



On Jan 29, 6:50 pm, graphicsxp graphic...@googlemail.com wrote:
 Thanks.. I tried that but I'm getting an error before the webservice
 is reached :  Invalid JSON primitive: pText.

 Like I said, my webservice's method expects a string, not a JSON key-
 value  pair. I'd be surprised if we can't pass a simple string to a
 webservice ?

 On 29 jan, 16:24, MorningZ morni...@gmail.com wrote:



  Right from the docshttp://docs.jquery.com/Ajax/jQuery.ajax#options

  Object must be Key/Value pairs

  something that

  data: pText=some text

  is not  (it's a string)

  so with that pointed out, try

  $.ajax({
            url: Publication.asmx/GetPublication,
            data: { pText: some text },
            type: POST,
            contentType: application/json; charset=utf-8,
            dataType: json,

  });

  On Jan 29, 10:58 am, graphicsxp graphic...@googlemail.com wrote:

   Hi,

   I'm trying to send a string to my webservice. The method I call
   expects a string parameter and returns a string of JSON data.

   I've tried this way :

    $.ajax({
             url: Publication.asmx/GetPublication,
             data: pText=some text,
             type: POST,
             contentType: application/json; charset=utf-8,
             dataType: json,

   });

   in which case I get the following error and the webservice is not even
   reached :

   Invalid JSON primitive: pText

   and this way :

    $.ajax({
             url: Publication.asmx/GetPublication,
             data: pText=some text,
             type: POST,
             dataType: json,

   });

   in which case the webservice is reached but then when the ajax call
   returns I get the following error :

   parseerror

   What do i need to do to fix this ?

   Thanks


[jQuery] Re: issue with ajax function

2009-01-30 Thread graphicsxp

This should only be set if your webservice expects the input parameter
in JSON format as well, and not only the response is JSON.
Is this the case?

Yes, I thought that too. I've removed the contentType parameter. In
this case the webservice is reached.
But when the AJAX call returns I get the error 'parseerror' .

The webservice method looks like :


 [WebMethod]
public string GetPublication(String pText) {
  String result = ;

  result = @{results: [
{
id: 4,
value: guardian.co.uk
}
]};

  return result;
}


On 30 jan, 09:30, Beres Botond boton...@gmail.com wrote:
 A parameter has to be key=value, in some form, otherwise how is it
 identified?

 contentType: application/json; charset=utf-8,

 This should only be set if your webservice expects the input parameter
 in JSON format as well, and not only the response is JSON.
 Is this the case?

 How does the code of your webservice look like? (the part which gets
 the input parameter)

 On Jan 29, 6:50 pm, graphicsxp graphic...@googlemail.com wrote:

  Thanks.. I tried that but I'm getting an error before the webservice
  is reached :  Invalid JSON primitive: pText.

  Like I said, my webservice's method expects a string, not a JSON key-
  value  pair. I'd be surprised if we can't pass a simple string to a
  webservice ?

  On 29 jan, 16:24, MorningZ morni...@gmail.com wrote:

   Right from the docshttp://docs.jquery.com/Ajax/jQuery.ajax#options

   Object must be Key/Value pairs

   something that

   data: pText=some text

   is not  (it's a string)

   so with that pointed out, try

   $.ajax({
             url: Publication.asmx/GetPublication,
             data: { pText: some text },
             type: POST,
             contentType: application/json; charset=utf-8,
             dataType: json,

   });

   On Jan 29, 10:58 am, graphicsxp graphic...@googlemail.com wrote:

Hi,

I'm trying to send a string to my webservice. The method I call
expects a string parameter and returns a string of JSON data.

I've tried this way :

 $.ajax({
          url: Publication.asmx/GetPublication,
          data: pText=some text,
          type: POST,
          contentType: application/json; charset=utf-8,
          dataType: json,

});

in which case I get the following error and the webservice is not even
reached :

Invalid JSON primitive: pText

and this way :

 $.ajax({
          url: Publication.asmx/GetPublication,
          data: pText=some text,
          type: POST,
          dataType: json,

});

in which case the webservice is reached but then when the ajax call
returns I get the following error :

parseerror

What do i need to do to fix this ?

Thanks


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

2009-01-30 Thread AndreMiranda

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] forms :: fire javascript on enter (without reloading the whole page)

2009-01-30 Thread dirk w

hello,
i've a text inpput field and a button. if you click on the button a
java script gets called (and all works fine) but if you type some text
and push the enter button than the whole page gets reloaded on the
form submit. i know how to prevent the browser to reload the whole
page (by catching the enter button action) but i don't know how to
make it do the same like pressing the submit button:

# HTML
form id=searchForm action=
 input type=text name=searchText id=searchText value=
size=50 maxlength=50/
 input type=button name=searchButton id=searchButton
class=button buttonText value=Search /
/form

# JS
$(form:first).submit(function()
{
return false;
   /* INSTEAD OF DOING NOTHING THIS SHOULD DO THE SAME
THAN THE FOLLOWING ACTION */
});

// fire the search when people click on the search button
$(#searchButton).click(function()
{
var url = 'http://gdata.youtube.com/feeds/api/videos?q=' +
$('#searchText').val() +

'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5';

$.getScript(url);

});


your help is much appreciated. i really love jquery, especially
because of it's community, never got so great responses than in this
user group.

thanks in advance!
dirk


[jQuery] jQuery Fill (use notemplate)

2009-01-30 Thread a.karimzadeh

When you want to fill a part of your html with specific data once and
show it. You can use $(selector).bind(data,{fill:true}); which require
jBind plugin.

jBind will bind will first find the html content of matched selector
and fill it's content with assigned data. You can find out more by
downloading it's sample package or reading it's documentation.

This feature is added in version 1.5.3
read more here :
http://arashkarimzadeh.com/index.php/articles/6-jquery/14-jquery-fill-by-data.html


[jQuery] Re: forms :: fire javascript on enter (without reloading the whole page)

2009-01-30 Thread Bohdan Ganicky

Hi,
just stick with the submit event. It's fired either when user presses
Enter or clicks the submit button:

$(#searchForm).submit(function() {
var url = 'http://gdata.youtube.com/feeds/api/videos?q=' + $
('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-
results=7format=5';
$.getScript(url);

return false;
});

--
Bohdan

On Jan 30, 11:25 am, dirk w dirkwendl...@googlemail.com wrote:
 hello,
 i've a text inpput field and a button. if you click on the button a
 java script gets called (and all works fine) but if you type some text
 and push the enter button than the whole page gets reloaded on the
 form submit. i know how to prevent the browser to reload the whole
 page (by catching the enter button action) but i don't know how to
 make it do the same like pressing the submit button:

 # HTML
 form id=searchForm action=
      input type=text name=searchText id=searchText value=
 size=50 maxlength=50/
      input type=button name=searchButton id=searchButton
 class=button buttonText value=Search /
 /form

 # JS
         $(form:first).submit(function()
         {
                 return false;
                /* INSTEAD OF DOING NOTHING THIS SHOULD DO THE SAME
 THAN THE FOLLOWING ACTION */
         });

         // fire the search when people click on the search button
         $(#searchButton).click(function()
         {
                 var url = 'http://gdata.youtube.com/feeds/api/videos?q='+
                 $('#searchText').val() +
                 
 'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5';

                 $.getScript(url);

         });

 your help is much appreciated. i really love jquery, especially
 because of it's community, never got so great responses than in this
 user group.

 thanks in advance!
 dirk


[jQuery] Re: Problem with superfish example

2009-01-30 Thread Joel Birch

Hi Kieren,

Note that if you browse to the example.html online, what you are
seeing in the browsers that the menu does appear to work in is a CSS-
only menu, as the paths to the JS files are set to be correct only
when example.html is viewed from within the zip file's main folder.
What you are seeing in IE6 is due to that browser not being capable of
displaying CSS-only dropdowns.

I have now changed the paths so that example.html works correctly when
browsed to online. I hope this avoids further confusion. Thanks for
the feedback.

Joel Birch.


[jQuery] cycle plugin

2009-01-30 Thread Molly

I am a newbie using the cycle plug-in to (manually) scroll through
images.  I want to prevent going from the last image forward to the
first (or first back to last) and disable the controls that do this.
I presume I need to use autostop and/or autostopCount but can't figure
out how.  Any help much appreciated.


[jQuery] Re: [validate] dynamic message

2009-01-30 Thread thomas

Jörn,

many thanks - this has worked wonderfully!

The only remaining question I have is as follows:

messages generated by specified validation methods clear automatically
after the form field gets updated:

so in the chain of required,digits,minlength,maxlength each message
comes and goes as needed. This seems not be the case with the solution
you have suggested. Once specified the this.settings.messages
[element.name] sticks and does not clear.

How to reset it back to nothing and re-launch validation chain when
the form value changes?

With kind regards,
Thomas


On Jan 26, 11:18 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Try this workaround - update validator.settings.messages[element.name]
 with the appropiate value inside your validation method:

 $.validator.addMethod(dynamic_check, function(value, element, param) {
       if(incorrect(value, param)){
         this.settings.messages[element.name] = some dynamic message
 + dynamicValue;
         return false;
       }

 }, whatever));
 On Sun, Jan 25, 2009 at 10:33 PM, thomas thomas.bik...@gmail.com wrote:

  Thanks Jörn,

  but is there a way to change param dynamically during JS runtime?

  As example in your custom-methods-demo.html I'd like 11 to be a
  function of value ...
  math: {equal: 11}

  In my barcoding example, I'd like not only tell user that barcode
  number is wrong, but also what the check digit should be for what he
  has typed. In order to pass it into template Entered number is wrong
  the check digit must be {0} I need to be able to alter param
  somehow ...

  Regards,
  Thomas

  On Jan 25, 2:29 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  You can use $.format to create dynamic messages, but that works only
  when the dynamic part is specified as a parameter.

  $.validator.addMethod(dynamic_check, function(value, element, param) {
         if(incorrect(value, param)){
         return false;}

  }, $.format('dynamic message goes here with param {0}'));

  Jörn

  On Sat, Jan 24, 2009 at 10:54 AM, thomas thomas.bik...@gmail.com wrote:

   Hello group!

   Very happy to have deployed validation plugin ( I mostly need to check
   validity of EAN/UPC numbers for barcode generation). You can see it in
   action here:http://www.barcoderobot.com/ean-13.html

   The question I am struggling with though is howto return a
   'dynamically generated' message. Say, '13 digits are required, you
   have XX'?

   $.validator.addMethod(dynamic_check, function(value) {
          if(_value is incorrect_){
          return False;}
   }, 'dynamic message goes here');


[jQuery] Re: issue with ajax function

2009-01-30 Thread Beres Botond

So the AJAX call actually returns some result now?

If you alert() the result, before trying to do anything with it, what
do you get?


On Jan 30, 11:35 am, graphicsxp graphic...@googlemail.com wrote:
 This should only be set if your webservice expects the input parameter
 in JSON format as well, and not only the response is JSON.
 Is this the case?

 Yes, I thought that too. I've removed the contentType parameter. In
 this case the webservice is reached.
 But when the AJAX call returns I get the error 'parseerror' .

 The webservice method looks like :

  [WebMethod]
     public string GetPublication(String pText) {
       String result = ;

       result = @{results: [
             {
                 id: 4,
                 value: guardian.co.uk
             }
         ]};

       return result;
     }

 On 30 jan, 09:30, Beres Botond boton...@gmail.com wrote:



  A parameter has to be key=value, in some form, otherwise how is it
  identified?

  contentType: application/json; charset=utf-8,

  This should only be set if your webservice expects the input parameter
  in JSON format as well, and not only the response is JSON.
  Is this the case?

  How does the code of your webservice look like? (the part which gets
  the input parameter)

  On Jan 29, 6:50 pm, graphicsxp graphic...@googlemail.com wrote:

   Thanks.. I tried that but I'm getting an error before the webservice
   is reached :  Invalid JSON primitive: pText.

   Like I said, my webservice's method expects a string, not a JSON key-
   value  pair. I'd be surprised if we can't pass a simple string to a
   webservice ?

   On 29 jan, 16:24, MorningZ morni...@gmail.com wrote:

Right from the docshttp://docs.jquery.com/Ajax/jQuery.ajax#options

Object must be Key/Value pairs

something that

data: pText=some text

is not  (it's a string)

so with that pointed out, try

$.ajax({
          url: Publication.asmx/GetPublication,
          data: { pText: some text },
          type: POST,
          contentType: application/json; charset=utf-8,
          dataType: json,

});

On Jan 29, 10:58 am, graphicsxp graphic...@googlemail.com wrote:

 Hi,

 I'm trying to send a string to my webservice. The method I call
 expects a string parameter and returns a string of JSON data.

 I've tried this way :

  $.ajax({
           url: Publication.asmx/GetPublication,
           data: pText=some text,
           type: POST,
           contentType: application/json; charset=utf-8,
           dataType: json,

 });

 in which case I get the following error and the webservice is not even
 reached :

 Invalid JSON primitive: pText

 and this way :

  $.ajax({
           url: Publication.asmx/GetPublication,
           data: pText=some text,
           type: POST,
           dataType: json,

 });

 in which case the webservice is reached but then when the ajax call
 returns I get the following error :

 parseerror

 What do i need to do to fix this ?

 Thanks


[jQuery] Re: [validate] dynamic message

2009-01-30 Thread Jörn Zaefferer

Ah, good question. Try this:

$.validator.addMethod(dynamic_check, function(value, element, param) {
 if(incorrect(value, param)){
   this.settings.messages[element.name].dynamic_check = some
dynamic message
+ dynamicValue;
   return false;
 }
}, whatever));

That sets the new message only for this method.

Jörn

On Fri, Jan 30, 2009 at 12:09 PM, thomas thomas.bik...@gmail.com wrote:

 Jörn,

 many thanks - this has worked wonderfully!

 The only remaining question I have is as follows:

 messages generated by specified validation methods clear automatically
 after the form field gets updated:

 so in the chain of required,digits,minlength,maxlength each message
 comes and goes as needed. This seems not be the case with the solution
 you have suggested. Once specified the this.settings.messages
 [element.name] sticks and does not clear.

 How to reset it back to nothing and re-launch validation chain when
 the form value changes?

 With kind regards,
 Thomas


 On Jan 26, 11:18 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 Try this workaround - update validator.settings.messages[element.name]
 with the appropiate value inside your validation method:

 $.validator.addMethod(dynamic_check, function(value, element, param) {
   if(incorrect(value, param)){
 this.settings.messages[element.name] = some dynamic message
 + dynamicValue;
 return false;
   }

 }, whatever));
 On Sun, Jan 25, 2009 at 10:33 PM, thomas thomas.bik...@gmail.com wrote:

  Thanks Jörn,

  but is there a way to change param dynamically during JS runtime?

  As example in your custom-methods-demo.html I'd like 11 to be a
  function of value ...
  math: {equal: 11}

  In my barcoding example, I'd like not only tell user that barcode
  number is wrong, but also what the check digit should be for what he
  has typed. In order to pass it into template Entered number is wrong
  the check digit must be {0} I need to be able to alter param
  somehow ...

  Regards,
  Thomas

  On Jan 25, 2:29 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  You can use $.format to create dynamic messages, but that works only
  when the dynamic part is specified as a parameter.

  $.validator.addMethod(dynamic_check, function(value, element, param) {
 if(incorrect(value, param)){
 return false;}

  }, $.format('dynamic message goes here with param {0}'));

  Jörn

  On Sat, Jan 24, 2009 at 10:54 AM, thomas thomas.bik...@gmail.com wrote:

   Hello group!

   Very happy to have deployed validation plugin ( I mostly need to check
   validity of EAN/UPC numbers for barcode generation). You can see it in
   action here:http://www.barcoderobot.com/ean-13.html

   The question I am struggling with though is howto return a
   'dynamically generated' message. Say, '13 digits are required, you
   have XX'?

   $.validator.addMethod(dynamic_check, function(value) {
  if(_value is incorrect_){
  return False;}
   }, 'dynamic message goes here');


[jQuery] plugins.jquery.com does not have 1.3.x

2009-01-30 Thread Mika Tuupola



When submitting a new plugin or plugin release there is no 1.3.x  
option in the plugins.jquery.com pulldown. Can someone add it?


--
Mika Tuupola
http://www.appelsiini.net/



[jQuery] next() working in ff but not in iex

2009-01-30 Thread elduderino


Hi,

I'm having a problem wit using next(). I have this code which i've built in
to a simple test page which you could run to see my problem (obviously you
need jquery included in the same directory).

IN firefox next finds the div and I get the alert back...as expected. the
div is a sibling of the list item and so should allow me to get to the
alert. However in IEx this does not happen.

Any ideas why? I thought jquery was supposed to deal with browser
inconsitency?!

anyways heres my code. Thanks in advance for any replies Smile

Code:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleUntitled Document/title
script type=text/javascript src=jquery.js/script
script type=text/javascript
function accordion() {
   var y = $('ul#accordion li');
   y.css({'color' : 'red'})
   y.click(
  function() {
 var current = $(this).next();
 if ((current.is('div'))  (current.is(':visible'))) {
alert('hi');
 }
  }
   );
}
/script
/head
body
ul id=accordion
liAnalysis/li
div class=accordionContent
pLorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum./p
/div
liAnalysis/li
div class=accordionContent
pLorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum./p
/div
liAnalysis/li
div class=accordionContent
pLorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum./p
/div
liAnalysis/li
div class=accordionContent
pLorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard dummy
text ever since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum./p
/div
/ul
script type=text/javascript
accordion();
/script
/body
/html
-- 
View this message in context: 
http://www.nabble.com/next%28%29-working-in-ff-but-not-in-iex-tp21745633s27240p21745633.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: eval(JSON_DATA) how safe is it?

2009-01-30 Thread Trend-King

Thank you for that really great oppinion.

my code is ready for use ;-)

On 29 Jan., 23:11, Eric Garside gars...@gmail.com wrote:
 If that's the case, then you're certainly not exposing any important
 information, but it's still not as efficient. With Javascript and JSON
 alike, the longer the data, the longer it takes to load (this isn't
 super relevant with tiny bits of info that are under 1k or so), but
 when you get into transferring larger strings of HTML and animation,
 it can build up processing time.

 The nice thing about JS is that it can take a lot of load off your
 server if you use it correctly. If you're using PHP or something like
 that on the backend to generate HTML, or even transfer strings of pre-
 written HTML over an AJAX call, that's still something your server has
 to do. However, if you program the logic you need for those kinds of
 displays into your initial javascript, you can farm a lot of the
 display tasks off to Javascript.

 I'd suggest using keywords to trigger events on your page. For
 example, you posted at one point you send strings like this across:

  $(#cart_info).fadeIn(500);setTimeout(function(){$(#cart_info).fadeOut(5­00)},2000);

 You can do this a lot easier if you use keyword strings instead.

 Lets assume you send the following response:
 {animations: 'cartHighlight,boxSlideIn'}

 And have some kind of javascript like this:

 $(function(){
    var animation_library = {
        cartHighlight: function(){
           $(#cart_info).fadeIn(500);
           setTimeout(function(){$(#cart_info).fadeOut(500)},2000);
        },
        boxSlideIn: function(){
           $('#textBox').slideDown(500);
        },
        boxSlideOut: function(){
           $('#textBox').slideUp(500);
        },
        cartSuccess: function(){
            $('#cart_info').append('div class=ui-highlightYou have
 added an item into your cart!/div');
        }
    }

    function checkAnimations(animations){
       $.each(animations, function(){
          if (!animation_library[this]) return;
          animation_library[this]();
       })
    }

    $.post('someurl.php', function(data){
        // ... do some stuff here ...
       checkAnimations(data.animations)
    }

 });

 That will trim down your json responses a lot, and farm all the
 effects stuff out to your visitor's computer instead!

 On Jan 29, 3:58 pm, Trend-King i...@trend-king.de wrote:



  the data i handle is the same data the user would see if he klicks on
  the link via page reload.

  the only diference is the data is beeing requestet via ajax and only
  has the needed information in it. i say it like this only boxes are
  updated.

  for example if the user clicks the add to cart without javascript he
  gets a reload and the item is added to cart with javascript on it
  makes the same uri call with an get variable ajax=1 and then it only
  returns the updated elements in an json array and each update the dom.

  greet

  Trend-King schrieb:

   thank you :-( now i am scared to do something with javascript or ajax
   or JSON.

   who or how can i check the security of my script?

   is it as easy as you say to hack javascript?

   Eric Garside schrieb:
Technically yes. But only if you don't trust your own server. :)

Like, because of the security concern, you can ONLY ajax from the same
domain. (*.whatever.com can only perform an AJAX request on
*.whatever.com domains).

However, you were talking about JSON in the beginning, which has
methods for fetching cross-domain Javascript. IE, you can call:

$.getJSON() or $.ajax({type: 'json'}) with the correct params, and
pull JSON from a site like... twitter, or flickr.

However, the more unsanitized data you just arbitrarily set in pages,
the larger the risk you run of a problem. Now, your chances of getting
bad or malicious data from flickr or twitter or any other major web
service is small. But it exists.

On Jan 29, 12:47 pm, Trend-King i...@trend-king.de wrote:
 $(document).ready(function(){
 $.ajax({
   url: test.html,
   cache: false,
   success: function(html){
    do_something(html)  }

 });
 });

 function do_something(html){
     $(#results).append(html);

 }

 it's from the jquery docs so that is also unsecure, because i could
 manipulate the html var an fill some script/script in it???

 On 29 Jan., 18:30, Trend-King i...@trend-king.de wrote:

  i think so, who could manipulate that JSON string with script/
  script in it?

  and it is exactly the same if i don't use JSON if somewhere in the
  javascript is something like $(box_test).html(var_goes_here); some
  one can manipulate the var_goes_here? and write here scriptalert
  (document.cookie)/script or something like this???

  i'am a little confused is javascript that kind of unsecure?

  thanks for your replies Jens

  On 29 Jan., 18:17, Trend-King i...@trend-king.de 

[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] Re: forms :: fire javascript on enter (without reloading the whole page)

2009-01-30 Thread dirk w

hey bohdan,
thanks, works fine!

dirk

On 30 Jan., 11:51, Bohdan Ganicky bohdan.gani...@gmail.com wrote:
 Hi,
 just stick with the submit event. It's fired either when user presses
 Enter or clicks the submit button:

 $(#searchForm).submit(function() {
         var url = 'http://gdata.youtube.com/feeds/api/videos?q='+ $
 ('#searchText').val() + 'alt=json-in-scriptcallback=showMyVideosmax-
 results=7format=5';
         $.getScript(url);

         return false;

 });

 --
 Bohdan

 On Jan 30, 11:25 am, dirk w dirkwendl...@googlemail.com wrote:

  hello,
  i've a text inpput field and a button. if you click on the button a
  java script gets called (and all works fine) but if you type some text
  and push the enter button than the whole page gets reloaded on the
  form submit. i know how to prevent the browser to reload the whole
  page (by catching the enter button action) but i don't know how to
  make it do the same like pressing the submit button:

  # HTML
  form id=searchForm action=
       input type=text name=searchText id=searchText value=
  size=50 maxlength=50/
       input type=button name=searchButton id=searchButton
  class=button buttonText value=Search /
  /form

  # JS
          $(form:first).submit(function()
          {
                  return false;
                 /* INSTEAD OF DOING NOTHING THIS SHOULD DO THE SAME
  THAN THE FOLLOWING ACTION */
          });

          // fire the search when people click on the search button
          $(#searchButton).click(function()
          {
                  var url = 'http://gdata.youtube.com/feeds/api/videos?q='+
                  $('#searchText').val() +
                  
  'alt=json-in-scriptcallback=showMyVideosmax-results=7format=5';

                  $.getScript(url);

          });

  your help is much appreciated. i really love jquery, especially
  because of it's community, never got so great responses than in this
  user group.

  thanks in advance!
  dirk


[jQuery] Re: issue with ajax function

2009-01-30 Thread graphicsxp

Well the reponseText property of the XHR object contains :

?xml version=1.0 encoding=utf-8?
string xmlns=http://tempuri.org/;{results: [
{
id: 4,
value: guardian.co.uk
}
]}/string


that's what the webservice returns. Since dataType of my jquery ajax
method is set to 'json', this should be interpreted as json data.


On 30 jan, 11:14, Beres Botond boton...@gmail.com wrote:
 So the AJAX call actually returns some result now?

 If you alert() the result, before trying to do anything with it, what
 do you get?

 On Jan 30, 11:35 am, graphicsxp graphic...@googlemail.com wrote:

  This should only be set if your webservice expects the input parameter
  in JSON format as well, and not only the response is JSON.
  Is this the case?

  Yes, I thought that too. I've removed the contentType parameter. In
  this case the webservice is reached.
  But when the AJAX call returns I get the error 'parseerror' .

  The webservice method looks like :

   [WebMethod]
      public string GetPublication(String pText) {
        String result = ;

        result = @{results: [
              {
                  id: 4,
                  value: guardian.co.uk
              }
          ]};

        return result;
      }

  On 30 jan, 09:30, Beres Botond boton...@gmail.com wrote:

   A parameter has to be key=value, in some form, otherwise how is it
   identified?

   contentType: application/json; charset=utf-8,

   This should only be set if your webservice expects the input parameter
   in JSON format as well, and not only the response is JSON.
   Is this the case?

   How does the code of your webservice look like? (the part which gets
   the input parameter)

   On Jan 29, 6:50 pm, graphicsxp graphic...@googlemail.com wrote:

Thanks.. I tried that but I'm getting an error before the webservice
is reached :  Invalid JSON primitive: pText.

Like I said, my webservice's method expects a string, not a JSON key-
value  pair. I'd be surprised if we can't pass a simple string to a
webservice ?

On 29 jan, 16:24, MorningZ morni...@gmail.com wrote:

 Right from the docshttp://docs.jquery.com/Ajax/jQuery.ajax#options

 Object must be Key/Value pairs

 something that

 data: pText=some text

 is not  (it's a string)

 so with that pointed out, try

 $.ajax({
           url: Publication.asmx/GetPublication,
           data: { pText: some text },
           type: POST,
           contentType: application/json; charset=utf-8,
           dataType: json,

 });

 On Jan 29, 10:58 am, graphicsxp graphic...@googlemail.com wrote:

  Hi,

  I'm trying to send a string to my webservice. The method I call
  expects a string parameter and returns a string of JSON data.

  I've tried this way :

   $.ajax({
            url: Publication.asmx/GetPublication,
            data: pText=some text,
            type: POST,
            contentType: application/json; charset=utf-8,
            dataType: json,

  });

  in which case I get the following error and the webservice is not 
  even
  reached :

  Invalid JSON primitive: pText

  and this way :

   $.ajax({
            url: Publication.asmx/GetPublication,
            data: pText=some text,
            type: POST,
            dataType: json,

  });

  in which case the webservice is reached but then when the ajax call
  returns I get the following error :

  parseerror

  What do i need to do to fix this ?

  Thanks


[jQuery] validate the field, but not required

2009-01-30 Thread scvinodkumar

hi there,

i found jquery is very useful to validate to html page.  Thanks for
all your effort.

Now i want to validate the form but they are not required. only if the
text box or other field needs to validate onblur or onclick.

For example, if there is first name field, then it should contain only
letters. so this should be validate. and at the same time they submit
the form without filling the first name.

i searched google, but dont find the solution for this. please tell me
how to do this.



[jQuery] [treeview]

2009-01-30 Thread kryptos

Greets ...

when i run the tree~menu locally .it works like a breeze.
when i load it up on the webserverit freezes.firebug tells me
the error is at line 176 in  jquery.treeview.js

the code in that line is 
var stored = $.cookie(settings.cookieId);

the error is 
$.cookie is not a function

URL
www.trinityindia.org

the error persists in all the browsers.3 days down alreadyhave
no clue...

do help :)






[jQuery] callback :passing $_POST values after completing form

2009-01-30 Thread dimitri

i'm all new with jquery and i'm using a validator for my form from
marzapower.

i was lucky enough to make the script detemine whether the form is
fulfilled correctly or not
whan not it sasy forgotten this or that, when correct it says i made
it.

but i'm now struggling om how i have to pass the data to my page for
processing en INSERT/UPDATE my database

Has anyone suggestions on how to solve this


[jQuery] Re: Click Links in the Nnavigation Bar

2009-01-30 Thread Nic Luciano
What exactly are you trying to do, what is the issue? Maybe just preference
here (and I'm also just guessing what you're asking) but I don't see a
reason not to put the events on the elements themselves

$(ul li a).click(function() {
$(this).parent().parent().find(.active).removeClass(active);
$(this).addClass(active);
});

On Fri, Jan 30, 2009 at 3:07 AM, Pedram pedram...@gmail.com wrote:


 Dear Karl ,
 I know You are Expert in these Issues do you have any idea for me
 Thanks

 On Jan 29, 5:44 pm, Pedram pedram...@gmail.com wrote:
  Hi Folks ,
I have some links in my Navigation bar such as below , I Used FIND
  in my code , does anyone has any better solution for me ,
I also used Event Delegation in the system .
 
  ul
lia href=# class=activea/a/li
lia href=#b/a/li
lia href=#c/a/li
lia href=#d/a/li
  /ul
 
$(ul).bind(click,function(e){
var clicked=$(e.target);
$(this).find(a.active).removeClass(active);
clicked.addClass(active);
});



[jQuery] Delay triggering modal on mouseover

2009-01-30 Thread jdinkelmann

Hi I have been searching for a way to not fire off the displaying of a
popup/modal box on mouse over.  I have found a couple things that get
me halfway, but I am in a jam and need to get this done ASAP.  I am
hoping someone could help:

Basically I have a list of links that are titles of publications like


a href=#Title 1/a
a href=#Title 2/a
a href=#Title 3/a
a href=#Title 4/a
a href=#Title 5/a
a href=#Title 6/a
a href=#Title 7/a

When a user hovers over the link to that title a small popup will
appear with information regarding this title.  I have all that working
fine.  What I can figure out is, how to delay the popup if the user
only briefly mouseover the link.  Basically I want the popup only to
appear if the user stops on the link for a certain amount of time
(like a half a second).  If you ar familiar with the Gmail UI, I want
the effect that they have implemented when you mouse over a contact in
you left sidebar.


I'll continue looking into this, but if anyone has any thoughts, I'd
appreciate it


[jQuery] Re: cycle plugin

2009-01-30 Thread Mike Alsup

 I am a newbie using the cycle plug-in to (manually) scroll through
 images.  I want to prevent going from the last image forward to the
 first (or first back to last) and disable the controls that do this.
 I presume I need to use autostop and/or autostopCount but can't figure
 out how.  Any help much appreciated.

Here are some examples:

http://www.malsup.com/jquery/cycle/after.html
http://www.malsup.com/jquery/cycle/nowrap.html


[jQuery] Re: issue with ajax function

2009-01-30 Thread Beres Botond

Yes, jquery tries to interpret it as JSON data, but that is XML and
not JSON, thus the 'parserror'.
XML that contains JSON in its string node.

You should set your datatype to xml, but even then I'm not sure if
that will work quite well.
In best case you can extract the value of xml string node as a STRING,
and then you'll have to parse/interpret that to
JSON yourself. (http://json.org/js.html)

I'd say, you better decide if you want to use XML or JSON, and not
both.


On Jan 30, 2:45 pm, graphicsxp graphic...@googlemail.com wrote:
 Well the reponseText property of the XHR object contains :

 ?xml version=1.0 encoding=utf-8?
 string xmlns=http://tempuri.org/;{results: [
             {
                 id: 4,
                 value: guardian.co.uk
             }
         ]}/string

 that's what the webservice returns. Since dataType of my jquery ajax
 method is set to 'json', this should be interpreted as json data.

 On 30 jan, 11:14, Beres Botond boton...@gmail.com wrote:



  So the AJAX call actually returns some result now?

  If you alert() the result, before trying to do anything with it, what
  do you get?

  On Jan 30, 11:35 am, graphicsxp graphic...@googlemail.com wrote:

   This should only be set if your webservice expects the input parameter
   in JSON format as well, and not only the response is JSON.
   Is this the case?

   Yes, I thought that too. I've removed the contentType parameter. In
   this case the webservice is reached.
   But when the AJAX call returns I get the error 'parseerror' .

   The webservice method looks like :

    [WebMethod]
       public string GetPublication(String pText) {
         String result = ;

         result = @{results: [
               {
                   id: 4,
                   value: guardian.co.uk
               }
           ]};

         return result;
       }

   On 30 jan, 09:30, Beres Botond boton...@gmail.com wrote:

A parameter has to be key=value, in some form, otherwise how is it
identified?

contentType: application/json; charset=utf-8,

This should only be set if your webservice expects the input parameter
in JSON format as well, and not only the response is JSON.
Is this the case?

How does the code of your webservice look like? (the part which gets
the input parameter)

On Jan 29, 6:50 pm, graphicsxp graphic...@googlemail.com wrote:

 Thanks.. I tried that but I'm getting an error before the webservice
 is reached :  Invalid JSON primitive: pText.

 Like I said, my webservice's method expects a string, not a JSON key-
 value  pair. I'd be surprised if we can't pass a simple string to a
 webservice ?

 On 29 jan, 16:24, MorningZ morni...@gmail.com wrote:

  Right from the docshttp://docs.jquery.com/Ajax/jQuery.ajax#options

  Object must be Key/Value pairs

  something that

  data: pText=some text

  is not  (it's a string)

  so with that pointed out, try

  $.ajax({
            url: Publication.asmx/GetPublication,
            data: { pText: some text },
            type: POST,
            contentType: application/json; charset=utf-8,
            dataType: json,

  });

  On Jan 29, 10:58 am, graphicsxp graphic...@googlemail.com wrote:

   Hi,

   I'm trying to send a string to my webservice. The method I call
   expects a string parameter and returns a string of JSON data.

   I've tried this way :

    $.ajax({
             url: Publication.asmx/GetPublication,
             data: pText=some text,
             type: POST,
             contentType: application/json; charset=utf-8,
             dataType: json,

   });

   in which case I get the following error and the webservice is not 
   even
   reached :

   Invalid JSON primitive: pText

   and this way :

    $.ajax({
             url: Publication.asmx/GetPublication,
             data: pText=some text,
             type: POST,
             dataType: json,

   });

   in which case the webservice is reached but then when the ajax 
   call
   returns I get the following error :

   parseerror

   What do i need to do to fix this ?

   Thanks


[jQuery] Re: High Point Village Website

2009-01-30 Thread kim3er

Hi ksun,

Thanks for the feedback. There are two intros, one constructed in JS
and one for users with flash installed, browsers with JS disabled will
not see an intro. I have tested the intros in ie6, ie7, ie8rc1, ff2,
ff3, s3, c1 and 09, across XP, Vista, OS X and Ubuntu.

Is your experiance contradictory to what I've stated above? If so, I'd
be very interested any follow up information you could provide. The
other browsers you tested the site on along with any user defined
settings you belive are relevant.

Rich

On Jan 29, 8:24 pm, ksun kavi.sunda...@gmail.com wrote:
 Could see only intro in IE

 On Jan 29, 12:58 pm, kim3er rich...@dogma.co.uk wrote:

  Hi,

  I've just finished working on a new web site using jQuery 1.3.1 and
  would appreciate feedback.

 http://www.highpointvillage.co.uk/

  Rich


[jQuery] Re: High Point Village Website

2009-01-30 Thread kim3er

Thank you for the feedback, it really is very much appreciated. I'm
aware of the considerable amount of requests, especially with respect
to the amount of JS files we have referenced. Rich

On Jan 29, 8:50 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
 That is a great piece of work, a huge amount of http requests - but appeared
 pretty seamless

 2009/1/29 ksun kavi.sunda...@gmail.com



  Could see only intro in IE

  On Jan 29, 12:58 pm, kim3er rich...@dogma.co.uk wrote:
   Hi,

   I've just finished working on a new web site using jQuery 1.3.1 and
   would appreciate feedback.

  http://www.highpointvillage.co.uk/

   Rich


[jQuery] Re: Delay triggering modal on mouseover

2009-01-30 Thread Richard D. Worth
hoverIntent is your guy

http://plugins.jquery.com/project/hoverIntent

- Richard

On Thu, Jan 29, 2009 at 11:21 PM, jdinkelmann jdinkelm...@gmail.com wrote:


 Hi I have been searching for a way to not fire off the displaying of a
 popup/modal box on mouse over.  I have found a couple things that get
 me halfway, but I am in a jam and need to get this done ASAP.  I am
 hoping someone could help:

 Basically I have a list of links that are titles of publications like


 a href=#Title 1/a
 a href=#Title 2/a
 a href=#Title 3/a
 a href=#Title 4/a
 a href=#Title 5/a
 a href=#Title 6/a
 a href=#Title 7/a

 When a user hovers over the link to that title a small popup will
 appear with information regarding this title.  I have all that working
 fine.  What I can figure out is, how to delay the popup if the user
 only briefly mouseover the link.  Basically I want the popup only to
 appear if the user stops on the link for a certain amount of time
 (like a half a second).  If you ar familiar with the Gmail UI, I want
 the effect that they have implemented when you mouse over a contact in
 you left sidebar.


 I'll continue looking into this, but if anyone has any thoughts, I'd
 appreciate it



[jQuery] Re: High Point Village Website

2009-01-30 Thread kim3er

Thanks for the feedback. Things get a bit shaky in FF2  FF3, I
understand this is because FF redraws every frame of an animation. The
sole occasion I've encountered when ie6 provides a better end result,
though I'm sure Mozilla have there reasons. In order to improve things
on the home page, a couple of the flash elements have been disabled
including the flash tooltips, which have been replaced with JS
versions in FF and non flash browsers. Rich

On Jan 29, 8:54 pm, David Meiser dmei...@gmail.com wrote:
 It has a nice user experience.  However, you might want to think about the
 hoverintent plugin - things seemed shaky when I tried to click on them (eg
 - the animation kept moving when I wanted to hover over an item) in FF3.

 On Thu, Jan 29, 2009 at 12:58 PM, kim3er rich...@dogma.co.uk wrote:

  Hi,

  I've just finished working on a new web site using jQuery 1.3.1 and
  would appreciate feedback.

 http://www.highpointvillage.co.uk/

  Rich


[jQuery] Re: Long Image Scroller (jCarousel)

2009-01-30 Thread Liam Byrne

Glad to help!

Use the background-image approach is only to make calculating the 
position easier - it allows you to use percentages and avoid messy 
calculations.


But as long as it was some help to you.

Liam

Sbudah wrote:

I declare you a God.

It works although I still need to change it from being a background
image to a div that changes position but this has helped me and has
most definitely given me ideas. You may see it in action at
http://www.myfuche.com/

Thanks Liam.

On Jan 29, 11:41 pm, Liam Byrne l...@onsight.ie wrote:
  

MUCH simpler than that.

1) Put the image into the background of the 500px div
2) Capture / track the mouse position
3) Divide the x-position by 5
4) Use that to set the x-axis percentage of the background position

Just make sure you set the IE6 background image cache so that it doesn't
flicker in that browser.

Liam

Sbudah wrote:


Hi Guys,
  
I have a long image that is about 2200 px wide that I need to display

within a 500px div. I need a solution similar to jCarousel (Lite) that
would allow users to scroll horizontal either using a Mouse Wheel or
simply hover a button (preferably right or left half of the image to
move to the sides).
  
So far I have managed to do it if I cut the image into pieces and use

jCarousel Lite (with Fraction Config) to scroll but I need something
that would scroll through the whole image without cutting it.
  
I'd hate to use Flash; please help!
  
Thanks,
  
Sbudah


  
No virus found in this incoming message.

Checked by AVG -http://www.avg.com
Version: 8.0.176 / Virus Database: 270.10.15/1923 - Release Date: 29/01/2009 
07:13



No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.10.16/1925 - Release Date: 30/01/2009 07:37


  




[jQuery] jqUploader using action does not work with HTTP.

2009-01-30 Thread Zerutreck

This form action not working:
form enctype=multipart/form-data action=http://localhost/argofile/
index.php/upload/do_upload method=POST class=a_form

I'm using code igniter framework, this type of url is the path for the
file :
http://localhost/argofile/index.php/upload/do_upload

When i click the upload button, this error happens:
HTTP error: with NAMEofFILE: error #404

See this print-screen:
http://hermes.araripina.com.br/imagens/jqUploader.png

When not using the framework, php normal use. Directing the form to
the file, it works normally.

When not using the framework, php normal use. Directing the form to
the file, it works normally.

Someone can help me solve this? Well I have to use framework without
using HTTP address on the form.

I await any response,

Hermes Alves


[jQuery] Jquery remove dd problem

2009-01-30 Thread NicholasPufal


Hi,

I'm currently using the plugin jQueryForm.

With it I want to retrieve some info from the Ajax request. In order to do
that, each time the user submit the form, I need to clean the information
retrieved previously.

In my XHTML code I have some div in charge of those messages, which is this:

div id=ok style=display:none;
h1Sucesso!/h1   
dl id=list_sucesso
dtAs seguintes operações foram realizadas:/dt
/dl
/div

In the JS part, I did set this:

$(document).ready(function() {

$(#form).ajaxForm(function(data){

$(#list_sucesso dt dd).remove();
$(#ok).fadeIn();  
$(#list_sucesso dt).after(dd+ data + /dd);


});

}); 

The problem is that the line $(#list_sucesso dt dd).remove(); isn't
removing the dd tags. I tried to use empty() as well, and still didn't work.
Tried with html(), and didn't happen as expected. It's always just adding
a DD tag after the one that was created on the previously submission.

Any ideas?

I appreciate any advice.

Nicholas
-- 
View this message in context: 
http://www.nabble.com/Jquery-remove-dd-problem-tp21747270s27240p21747270.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: [treeview]

2009-01-30 Thread Jörn Zaefferer

See http://www.trinityindia.org/jquery.cookie.js

Jörn

On Fri, Jan 30, 2009 at 11:05 AM, kryptos himanshu1kha...@gmail.com wrote:

 Greets ...

 when i run the tree~menu locally .it works like a breeze.
 when i load it up on the webserverit freezes.firebug tells me
 the error is at line 176 in  jquery.treeview.js

 the code in that line is 
 var stored = $.cookie(settings.cookieId);

 the error is 
 $.cookie is not a function

 URL
 www.trinityindia.org

 the error persists in all the browsers.3 days down alreadyhave
 no clue...

 do help :)







[jQuery] Re: validate the field, but not required

2009-01-30 Thread Jörn Zaefferer

Using the validation plugin
(http://bassistance.de/jquery-plugins/jquery-plugin-validation/), just
specify rules for fields, but leave out required:

jQuery.validator.addMethod(lettersonly, function(value, element) {
return this.optional(element) || /^[a-z]+$/i.test(value);
}, Letters only please);

$(#myform).validate({
  rules: {
firstname: {
  lettersonly: true
}
  }
});

Jörn

On Fri, Jan 30, 2009 at 9:08 AM, scvinodkumar
scvinodkumar@gmail.com wrote:

 hi there,

 i found jquery is very useful to validate to html page.  Thanks for
 all your effort.

 Now i want to validate the form but they are not required. only if the
 text box or other field needs to validate onblur or onclick.

 For example, if there is first name field, then it should contain only
 letters. so this should be validate. and at the same time they submit
 the form without filling the first name.

 i searched google, but dont find the solution for this. please tell me
 how to do this.




[jQuery] Re: Using $_POST to transmit large key/pair

2009-01-30 Thread Mark Livingstone

Thanks, Beres.

I am reading this order_message from a DIV. How do I 'POST' it? By
using form?

Also, to url encode... do I use escape()?


On Jan 30, 3:08 am, Beres Botond boton...@gmail.com wrote:
 You want to use POST, but you are sending your data as GET (without
 url encoding).
 So I'm pretty sure it cuts before #, because # is a non-alphanumeric
 character and you haven't urlencoded your data.

 Data in URL  = GET, not POST, even if you are using $.post .

 http://docs.jquery.com/Post

 So either urlencode your data before putting it in the request or send
 it as POST.

 Also I'm not sure how it worked for you on server-side, if you were
 expecting $_POST... I assume you were expecting
 $_REQUEST instead, which is not a good idea in my opinion.

 On Jan 30, 8:08 am, Mark Livingstone namematters...@msn.com wrote:



  I have the following code:

  $.post(order_send_email.php?order_message='+order_message)

  my 'order_message' is:

  'Dear '+data['salutation']+ +data['first_name']+ +data['last_name']
  +', \n\nThis is to inform you that your order #'+key+ and payment in
  the amount of...';

  When using $.POST... the message gets cut before #. Is there a limit
  on how much cam be transmitted or am I doing something wrong?

  Thanks.- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Problem with superfish example

2009-01-30 Thread Kieren

Cheers

I think my IE6 problem was due to not having the right path to jquery
specified in the link tag too.  So using IE7 fixed that as a side-
effect.

I might have a Z index problem to ask shortly, but I'll save that for
a time other than 1am :)

On Jan 30, 9:58 pm, Joel Birch joeldbi...@gmail.com wrote:
 Hi Kieren,

 Note that if you browse to the example.html online, what you are
 seeing in the browsers that the menu does appear to work in is a CSS-
 only menu, as the paths to the JS files are set to be correct only
 when example.html is viewed from within the zip file's main folder.
 What you are seeing in IE6 is due to that browser not being capable of
 displaying CSS-only dropdowns.

 I have now changed the paths so that example.html works correctly when
 browsed to online. I hope this avoids further confusion. Thanks for
 the feedback.

 Joel Birch.


[jQuery] Re: High Point Village Website

2009-01-30 Thread mcologne

nice work, i like it!

without going into details of programming, the site differs from that
classic style often seen
nowadays on many websites...

you know what i mean... buttons, tabs...

i like the big graphics in the backgrounds...

best regards m
cologne

On Jan 30, 2:38 pm, kim3er rich...@dogma.co.uk wrote:
 Thanks for your feedback.

 With this project we wanted to create something that was interesting
 to but still functional without reliance on either JS or Flash. The
 end result, I hope, is a website that is functional and fully styled
 without JS turned on. With JS turned on, the site becomes more
 interactive and hopefully more engaging. For users with Flash 9 or
 above, more functionality is exposed, for example music, animated
 tooltips and the red people. What we didn't want was for any of the
 functionality to be dependant on Flash, that's where we draw the line.

 In hindsight the home page scroll would have been a lot smoother and
 consistent across browsers, if done in Flash. That said, I'm still
 very happy with the result.

 I'm not sure what you mean by the background fades bug, but I have
 discovered the random woman between animations. Thanks again.

 Rich

 On Jan 29, 9:33 pm, Ricardo Tomasi ricardob...@gmail.com wrote:

  I also had that problem. Sometimes I hover a + and it doesn't slide
  down. Also experiencied two other bugs:
  - when you click the + button, the background fades from black again
  - inside a section like 'bar' or 'boutique hotel', when I click
  another section (gym/pool/etc), an unrelated image flashes in the
  background (a woman laying back in a chair)

  Very nice design. Do you develop in Flash too? Was it worth the extra
  work to do it all in JS?

  cheers,
  - ricardo

  On Jan 29, 6:54 pm, David Meiser dmei...@gmail.com wrote:

   It has a nice user experience.  However, you might want to think about the
   hoverintent plugin - things seemed shaky when I tried to click on them 
   (eg
   - the animation kept moving when I wanted to hover over an item) in FF3.

   On Thu, Jan 29, 2009 at 12:58 PM, kim3er rich...@dogma.co.uk wrote:

Hi,

I've just finished working on a new web site using jQuery 1.3.1 and
would appreciate feedback.

   http://www.highpointvillage.co.uk/

Rich


[jQuery] Re: High Point Village Website

2009-01-30 Thread kim3er

Thanks for your feedback.

With this project we wanted to create something that was interesting
to but still functional without reliance on either JS or Flash. The
end result, I hope, is a website that is functional and fully styled
without JS turned on. With JS turned on, the site becomes more
interactive and hopefully more engaging. For users with Flash 9 or
above, more functionality is exposed, for example music, animated
tooltips and the red people. What we didn't want was for any of the
functionality to be dependant on Flash, that's where we draw the line.

In hindsight the home page scroll would have been a lot smoother and
consistent across browsers, if done in Flash. That said, I'm still
very happy with the result.

I'm not sure what you mean by the background fades bug, but I have
discovered the random woman between animations. Thanks again.

Rich

On Jan 29, 9:33 pm, Ricardo Tomasi ricardob...@gmail.com wrote:
 I also had that problem. Sometimes I hover a + and it doesn't slide
 down. Also experiencied two other bugs:
 - when you click the + button, the background fades from black again
 - inside a section like 'bar' or 'boutique hotel', when I click
 another section (gym/pool/etc), an unrelated image flashes in the
 background (a woman laying back in a chair)

 Very nice design. Do you develop in Flash too? Was it worth the extra
 work to do it all in JS?

 cheers,
 - ricardo

 On Jan 29, 6:54 pm, David Meiser dmei...@gmail.com wrote:

  It has a nice user experience.  However, you might want to think about the
  hoverintent plugin - things seemed shaky when I tried to click on them (eg
  - the animation kept moving when I wanted to hover over an item) in FF3.

  On Thu, Jan 29, 2009 at 12:58 PM, kim3er rich...@dogma.co.uk wrote:

   Hi,

   I've just finished working on a new web site using jQuery 1.3.1 and
   would appreciate feedback.

  http://www.highpointvillage.co.uk/

   Rich


[jQuery] Re: High Point Village Website

2009-01-30 Thread kim3er

Thanks mcologne, appreciated.

On Jan 30, 2:09 pm, mcologne blueameri...@web.de wrote:
 nice work, i like it!

 without going into details of programming, the site differs from that
 classic style often seen
 nowadays on many websites...

 you know what i mean... buttons, tabs...

 i like the big graphics in the backgrounds...

 best regards m
 cologne

 On Jan 30, 2:38 pm, kim3er rich...@dogma.co.uk wrote:

  Thanks for your feedback.

  With this project we wanted to create something that was interesting
  to but still functional without reliance on either JS or Flash. The
  end result, I hope, is a website that is functional and fully styled
  without JS turned on. With JS turned on, the site becomes more
  interactive and hopefully more engaging. For users with Flash 9 or
  above, more functionality is exposed, for example music, animated
  tooltips and the red people. What we didn't want was for any of the
  functionality to be dependant on Flash, that's where we draw the line.

  In hindsight the home page scroll would have been a lot smoother and
  consistent across browsers, if done in Flash. That said, I'm still
  very happy with the result.

  I'm not sure what you mean by the background fades bug, but I have
  discovered the random woman between animations. Thanks again.

  Rich

  On Jan 29, 9:33 pm, Ricardo Tomasi ricardob...@gmail.com wrote:

   I also had that problem. Sometimes I hover a + and it doesn't slide
   down. Also experiencied two other bugs:
   - when you click the + button, the background fades from black again
   - inside a section like 'bar' or 'boutique hotel', when I click
   another section (gym/pool/etc), an unrelated image flashes in the
   background (a woman laying back in a chair)

   Very nice design. Do you develop in Flash too? Was it worth the extra
   work to do it all in JS?

   cheers,
   - ricardo

   On Jan 29, 6:54 pm, David Meiser dmei...@gmail.com wrote:

It has a nice user experience.  However, you might want to think about 
the
hoverintent plugin - things seemed shaky when I tried to click on 
them (eg
- the animation kept moving when I wanted to hover over an item) in FF3.

On Thu, Jan 29, 2009 at 12:58 PM, kim3er rich...@dogma.co.uk wrote:

 Hi,

 I've just finished working on a new web site using jQuery 1.3.1 and
 would appreciate feedback.

http://www.highpointvillage.co.uk/

 Rich


[jQuery] Editable new feature $(selector).editable('disable')

2009-01-30 Thread a.karimzadeh

This new version of editable supports

$(selector).editable(options)
$(selector).editable('disable')
$(selector).editable('enable')
$(selector).editable('destroy')

for more information check:
http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html
or read how to extend for supporting more types here:
http://arashkarimzadeh.com/index.php/jquery/9-how-to-extend-jquery-editable.html


[jQuery] Re: [treeview]

2009-01-30 Thread himanshu khatri
jorn didnt quiet get what you meant...
 the only hint i have found is 
http://drupal.org/node/271463

i hope this helps others aswell who have
this error
$.cookie is not a function



On Fri, Jan 30, 2009 at 7:30 PM, Jörn Zaefferer 
joern.zaeffe...@googlemail.com wrote:


 See http://www.trinityindia.org/jquery.cookie.js

 Jörn

 On Fri, Jan 30, 2009 at 11:05 AM, kryptos himanshu1kha...@gmail.com
 wrote:
 
  Greets ...
 
  when i run the tree~menu locally .it works like a breeze.
  when i load it up on the webserverit freezes.firebug tells me
  the error is at line 176 in  jquery.treeview.js
 
  the code in that line is 
  var stored = $.cookie(settings.cookieId);
 
  the error is 
  $.cookie is not a function
 
  URL
  www.trinityindia.org
 
  the error persists in all the browsers.3 days down alreadyhave
  no clue...
 
  do help :)
 
 
 
 
 




-- 
Cheers and Greets

M e d i a s h a l a

Himanshu Khatri
National Design Business Incubatee - (NDBI)
NID, Paldi,
Ahmedabad 380 007, India.
Phone:(079) 2662 3692 (extn - 5008)
Mo:+91 9725111531
@:  himanshu1kha...@gmail.com
 himan...@mediashala.com
Skype:himanshu1khatri


[jQuery] Re: Jquery remove dd problem

2009-01-30 Thread amuhlou

It looks like $(#list_sucesso dt dd).remove();  is the problem.  The
way you've written the selector, it would look inside the dt for the
dd to remove.

$(#list_successo dl dd).remove(); should get the one you're after.





[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] Having a problem with checkboxes

2009-01-30 Thread heohni

Hi,

I am using this:

input type=checkbox name=paradigm value={$value.ver_id} /


$(document).ready(function(){
$(#paradigm_all).click(function(){
var checked_status=this.checked;$(inp...@name=paradigm]).each
(function(){
this.checked=checked_status;
});
});
});

to check and uncheck a list of articles.
Now I want to sumbit the checked articles, but I don't know how to do
that.

I can't use input type=checkbox name=paradigm[]
value={$value.ver_id} /
as then the jquery doesn#t work anymore.

But how can I transfer all checked Id's to the next page?
Any help?

Thanks a bunch!


[jQuery] Re: [treeview]

2009-01-30 Thread Jörn Zaefferer

The jquery.cookie.js file is missing. You didn't upload it, or it
links to the wrong location.

Jörn

On Fri, Jan 30, 2009 at 3:48 PM, himanshu khatri
himanshu1kha...@gmail.com wrote:
 jorn didnt quiet get what you meant...
  the only hint i have found is 
 http://drupal.org/node/271463

 i hope this helps others aswell who have
 this error
 $.cookie is not a function



 On Fri, Jan 30, 2009 at 7:30 PM, Jörn Zaefferer
 joern.zaeffe...@googlemail.com wrote:

 See http://www.trinityindia.org/jquery.cookie.js

 Jörn

 On Fri, Jan 30, 2009 at 11:05 AM, kryptos himanshu1kha...@gmail.com
 wrote:
 
  Greets ...
 
  when i run the tree~menu locally .it works like a breeze.
  when i load it up on the webserverit freezes.firebug tells me
  the error is at line 176 in  jquery.treeview.js
 
  the code in that line is 
  var stored = $.cookie(settings.cookieId);
 
  the error is 
  $.cookie is not a function
 
  URL
  www.trinityindia.org
 
  the error persists in all the browsers.3 days down alreadyhave
  no clue...
 
  do help :)
 
 
 
 
 



 --
 Cheers and Greets

 M e d i a s h a l a

 Himanshu Khatri
 National Design Business Incubatee - (NDBI)
 NID, Paldi,
 Ahmedabad 380 007, India.
 Phone:(079) 2662 3692 (extn - 5008)
 Mo:+91 9725111531
 @:  himanshu1kha...@gmail.com
  himan...@mediashala.com
 Skype:himanshu1khatri



[jQuery] Re: changing value of hidden input

2009-01-30 Thread Michael

Anyone?
I've been playing around with it, and the following will work if I
want to set the hidden value to test...

$(#account).result(function(event, data, formatted) {
$(#account_value).val(test);
});

...but I'm still not sure how to get the value from the id key value
of the selected row in the array. Does that make sense? (If I select
Account One from the auto-complete, I want the value of my hidden
input to be 0001.)


[jQuery] Re: Having a problem with checkboxes

2009-01-30 Thread heohni

Does it work, to write all checked id's into a hidden field? Which
then gets submitted?

On 30 Jan., 16:27, heohni heidi.anselstet...@consultingteam.de
wrote:
 Hi,

 I am using this:

 input type=checkbox name=paradigm value={$value.ver_id} /

 $(document).ready(function(){
         $(#paradigm_all).click(function(){
                 var 
 checked_status=this.checked;$(inp...@name=paradigm]).each
 (function(){
                         this.checked=checked_status;
                 });
         });

 });

 to check and uncheck a list of articles.
 Now I want to sumbit the checked articles, but I don't know how to do
 that.

 I can't use input type=checkbox name=paradigm[]
 value={$value.ver_id} /
 as then the jquery doesn#t work anymore.

 But how can I transfer all checked Id's to the next page?
 Any help?

 Thanks a bunch!


[jQuery] Re: All is well except in IE - links initially not clickable

2009-01-30 Thread precar

Hi,

Yes, I'm using the bind() method with 'click'.  Is that the correct
approach?


Precar.


On Jan 28, 9:47 am, amuhlou amysch...@gmail.com wrote:
 It looks like it's not appending the selected class to the li
 onClick in IE7.  Are you using the bind() method to apply the click
 functionality?

 On Jan 28, 10:34 am, precar pranshua...@gmail.com wrote:



  Hi,

  My site (http://pthesis.com) works fine in Firefox/Opera/Safari, but
  inIE7 there is a small hitch.  Sometimes when I click the portfolio
  link and open it, the links to the sites in the left column aren't
  clickable.  If I close it and re-open it, they work, and if I do
  Refine by category and then click, they work.

  As I mentioned, this only happens inIE7.  I've tested inIE8 beta 2
  and it works fine.

  Does anyone have any suggestions for a workaround?  If it would be
  helpful I'll post the page code here, or you may view it directly from
  the site.

  Thanks for your help,
  Precar.- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Jquery remove dd problem

2009-01-30 Thread NicholasPufal


Yes. That was the problem.

After I did post it here, I did realize the dumb mistake I've done :ninja:

Thanks a lot for the reply!



amuhlou wrote:
 
 
 It looks like $(#list_sucesso dt dd).remove();  is the problem.  The
 way you've written the selector, it would look inside the dt for the
 dd to remove.
 
 $(#list_successo dl dd).remove(); should get the one you're after.
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Jquery-remove-dd-problem-tp21747270s27240p21749870.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: [jquery.form.js v2.18] file upload field and standard fields

2009-01-30 Thread phicarre

I replace my code by this one:
?
echo VAR DUMP:p /;
  var_dump($_POST);
?

and the result is:

VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10
}
File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10
}
File: 2.gif (6160 bytes)VAR DUMP:p /array(3) {
  [nom]=
  string(0) 
  [prenom]=
  string(0) 
  [MAX_FILE_SIZE]=
  string(6) 10
}
File: 2.gif (6160 bytes)

On 30 jan, 01:34, l...@onsight.ie wrote:
 Might just be a typo, but just in case - it should be $_POST



  What does the error field say? And I'm pretty sure that MAX_FILE_SIZE
  must come immediately before your file input element.

  Also, are you sure the file is within your upload limit?

  On Thu, Jan 29, 2009 at 1:01 PM,phicarregam...@bluewin.ch wrote:

  jquery.form.js v2.18

  I have a form with a lot of fields and one upload file field:

  form action='' id='form1' enctype='multipart/form-data' style='font-
  size:85%'
     input type=hidden name=MAX_FILE_SIZE value=10 /

     table 
         trtdNom: /tdtdinput type='text' size='30' id='nom'
  name='nom' //td/tr
         trtdPrénom: /tdtdinput type=text size=30
  id=prenom name=prenom //td/tr
         trtdPhoto: /tdtdinput type=file size=40
  id=photo name=photo //td/tr
     /table
  /form
  /div

  $('#form1').ajaxSubmit(
     {
         type: 'POST',
         url: 'create.php',
         beforeSubmit: showRequest ,
         success: function(msg) {},
         error: function(requete,iderror) {alert(iderror);}
     }
     );

  In create.php, the $_FILES is correct  (name,size,type,tmp name,error)
  BUT the $POST is empty !
  Why ?


[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila


I think you can put three validators on the fields, with
jQuery.validator.addMethod. I don't know if you can add multiple
validators for the same CSS class, so I'm putting extra CSS classes on
the inputs:
input id=firstName class=first-name-input name-input/
input id=lastName class=last-name input name-input/

jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
'First name is missing.');
jQuery.validator.addMethod('last-name-input', validateLastNameInput,
'Last name is missing.');
jQuery.validator.addMethod('name-input', validateNameInputs, 'First
and Last name are missing.');

var firstNameInput = document.getElementById('firstNameInput');
var lastNameInput = document.getElementById('lastNameInput');
function validateFirstNameInput(value, element) { return !
lastNameInput.value || value; }   // 1
function validateLastNameInput(value, element) { return
firstNameInput.value || value; }// 2
function validateNameInputs(value, element) { return
firstNameInput.value  lastNameInput.value; } // 3

Validator #1 will always run for the first name input, but will choose
to never display a message as long as the last name input is empty. If
the last name input is not empty, then this validator will actually
check the given value (the value of the first name input) and validate
accordingly.

Validator #2 is in a similar situation.

Validator #3 will display an error only if both are empty.

Think of them as working together to only activate the errors when
only a subset of the possible conditions get applied.

I'm looking for a way to do this with a single validator myself. I
have dynamic forms and more complex situations, so I can't employ this
solution. If anyone knows how to do it, please don't hesitate to put
it in.


Mihai


On Jan 5, 4:26 pm, claudes claudina.sar...@gmail.com wrote:
 i have a group that contains both first and last name. i'm wondering if it is
 possible to have custom messages for groups. i'm trying to achieve something
 to the following:

 a. if both first and last name are not filled in: First and Last name are
 Required
 b. if only first is filled in: last name is required
 c. if only last is filled in: first name is required

 is this possible?
 --
 View this message in 
 context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila


There was a small typo in validateLastNameInput. Here's the corrected
code.

input id=firstName class=first-name-input name-input/
input id=lastName class=last-name input name-input/
jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
'First name is missing.');
jQuery.validator.addMethod('last-name-input', validateLastNameInput,
'Last name is missing.');
jQuery.validator.addMethod('name-input', validateNameInputs, 'First
and Last name are missing.');
var firstNameInput = document.getElementById('firstNameInput');
var lastNameInput = document.getElementById('lastNameInput');
function validateFirstNameInput(value, element) { return !
lastNameInput.value || value; }   // 1
function validateLastNameInput(value, element) { return !
firstNameInput.value || value; }// 2
function validateNameInputs(value, element) { return
firstNameInput.value  lastNameInput.value; } // 3



On Jan 30, 11:18 am, Mihai Danila virid...@gmail.com wrote:
 I think you can put three validators on the fields, with
 jQuery.validator.addMethod. I don't know if you can add multiple
 validators for the same CSS class, so I'm putting extra CSS classes on
 the inputs:
 input id=firstName class=first-name-input name-input/
 input id=lastName class=last-name input name-input/

 jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
 'First name is missing.');
 jQuery.validator.addMethod('last-name-input', validateLastNameInput,
 'Last name is missing.');
 jQuery.validator.addMethod('name-input', validateNameInputs, 'First
 and Last name are missing.');

 var firstNameInput = document.getElementById('firstNameInput');
 var lastNameInput = document.getElementById('lastNameInput');
 function validateFirstNameInput(value, element) { return !
 lastNameInput.value || value; }           // 1
 function validateLastNameInput(value, element) { return
 firstNameInput.value || value; }            // 2
 function validateNameInputs(value, element) { return
 firstNameInput.value  lastNameInput.value; } // 3

 Validator #1 will always run for the first name input, but will choose
 to never display a message as long as the last name input is empty. If
 the last name input is not empty, then this validator will actually
 check the given value (the value of the first name input) and validate
 accordingly.

 Validator #2 is in a similar situation.

 Validator #3 will display an error only if both are empty.

 Think of them as working together to only activate the errors when
 only a subset of the possible conditions get applied.

 I'm looking for a way to do this with a single validator myself. I
 have dynamic forms and more complex situations, so I can't employ this
 solution. If anyone knows how to do it, please don't hesitate to put
 it in.

 Mihai

 On Jan 5, 4:26 pm, claudes claudina.sar...@gmail.com wrote:

  i have a group that contains both first and last name. i'm wondering if it 
  is
  possible to have custom messages for groups. i'm trying to achieve something
  to the following:

  a. if both first and last name are not filled in: First and Last name are
  Required
  b. if only first is filled in: last name is required
  c. if only last is filled in: first name is required

  is this possible?
  --
  View this message in 
  context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages...
  Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: [treeview]

2009-01-30 Thread himanshu khatri
exactly the point..
the file is there...its just being blocked or something but the webhost...

On Fri, Jan 30, 2009 at 9:11 PM, Jörn Zaefferer 
joern.zaeffe...@googlemail.com wrote:


 The jquery.cookie.js file is missing. You didn't upload it, or it
 links to the wrong location.

 Jörn

 On Fri, Jan 30, 2009 at 3:48 PM, himanshu khatri
 himanshu1kha...@gmail.com wrote:
  jorn didnt quiet get what you meant...
   the only hint i have found is 
  http://drupal.org/node/271463
 
  i hope this helps others aswell who have
  this error
  $.cookie is not a function
 
 
 
  On Fri, Jan 30, 2009 at 7:30 PM, Jörn Zaefferer
  joern.zaeffe...@googlemail.com wrote:
 
  See http://www.trinityindia.org/jquery.cookie.js
 
  Jörn
 
  On Fri, Jan 30, 2009 at 11:05 AM, kryptos himanshu1kha...@gmail.com
  wrote:
  
   Greets ...
  
   when i run the tree~menu locally .it works like a breeze.
   when i load it up on the webserverit freezes.firebug tells me
   the error is at line 176 in  jquery.treeview.js
  
   the code in that line is 
   var stored = $.cookie(settings.cookieId);
  
   the error is 
   $.cookie is not a function
  
   URL
   www.trinityindia.org
  
   the error persists in all the browsers.3 days down alreadyhave
   no clue...
  
   do help :)
  
  
  
  
  
 
 
 
  --
  Cheers and Greets
 
  M e d i a s h a l a
 
  Himanshu Khatri
  National Design Business Incubatee - (NDBI)
  NID, Paldi,
  Ahmedabad 380 007, India.
  Phone:(079) 2662 3692 (extn - 5008)
  Mo:+91 9725111531
  @:  himanshu1kha...@gmail.com
   himan...@mediashala.com
  Skype:himanshu1khatri
 




-- 
Cheers and Greets

M e d i a s h a l a

Himanshu Khatri
National Design Business Incubatee - (NDBI)
NID, Paldi,
Ahmedabad 380 007, India.
Phone:(079) 2662 3692 (extn - 5008)
Mo:+91 9725111531
@:  himanshu1kha...@gmail.com
 himan...@mediashala.com
Skype:himanshu1khatri


[jQuery] noob question

2009-01-30 Thread bart

Somehow I don't get the concept of get() right. The following
expression gives an error;

$('p.fl').get(0).css('background', 'red');

Now what I'm trying to do here is select the first paragraph from all
the paragraphs with a class of fl. After that I'm just trying to get
a visual id by making it red but it's more about grabbing the element
really. There's probably a very good reason why this doesn't work but
what I understand from documentation this should work?

This ultimate goal is to hide a paragraph based on it's index. This
index is gotten from a clicked link. So far I've got this, but it's
stuck on the get() part.

$('a.leesmeer').click(function()
{
var nmbr = $('a.leesmeer').index(this);
$('p.fl').get(nmbr).hide();
$('div.case').get(nmbr).show();
return false;
});


[jQuery] validation with jquery 1.3

2009-01-30 Thread andré

Hello,
Thanks for your fabulous validation form.
But I 've a problem.When I use jquery 1.2.6, my form works well on IE,
firefox and safari. But When I use jquery 1.3 in IE the error message
doesn't work Can you help me ?
my script :
$().ready(function() {

// validate signup form on keyup and submit
$(#InfoClient).validate({
rules: {
Nom : required,
Prenom : required,
DateNaissance : {
date: true
},
Adresse : required,
CodePostal : required,
Ville :required,
Pays : {
digits: true
},
TelFixe: {
digits:true,
required: function(element) {
return $(#TelPort).val() 01;
}


},
TelPort: {

digits:true,
required: function(element) {
return $(#TelFixe).val() 01;
}
}
},
messages: {
Nom :Veuillez entrer un nom !,
Prenom :Veuillez entrer un prénom !,
DateNaissance :Veuillez entrer une date de naissance 
sous la forme
JJ/MM/ !,
Adresse :Veuillez une adresse !,
CodePostal :Veuillez un code postal !,
Ville :Veuillez entrer une ville !,
Pays :Veuillez entrer un pays !,
TelPort :Veuillez entrer un numéro de fixe ou de  
portable à 10
chiffres!,
TelFixe :Veuillez entrer un numéro de fixe ou de  
portable à 10
chiffres !
}
});
});


[jQuery] Re: jQuery Curvy Corners

2009-01-30 Thread Rusco


Hi,
I also tried a lot of rounded corners plug-ins and found out that each
one reveals its weakness once you begin nesting html-tags and messing
around with css.

The only somewhat reliable rounded corners plugin is imho:

http://labs.parkerfox.co.uk/cornerz/

Rusco.



On 30 jan, 07:57, Nikola nik.cod...@gmail.com wrote:
 I just discovered how nice jQuery Curvy Corners is.  It works well in
 Firefox but only seems to work in IE7 when using jQuery 1.2.6.  I did
 a quick search through the code to look for any obvious problems but I
 couldn't see any.  This is a great plug-in and I'd really like to get
 it working.  Any input or advice is greatly appreciated.

 http://blue-anvil.com/jquerycurvycorners/test.html

 Thanks,
 Nikola


[jQuery] How PHP script can return two variables ?

2009-01-30 Thread FlashWebHost.com

I use jQuery $.ajax to submit user comment to a PHP Script.

The PHP script validate the user data, if it is OK, user comment is
written to mysql database. If not it will show error message.

Now the script print error message and success message same way.

I need PHP script pass one more value, to identify it is an error or
success message.

If it is success, i need to remove the comment box.



[jQuery] Large images IE ready event

2009-01-30 Thread Alex

In IE 6 through 8, whenever I use $(document).ready(function(){ });,
it doesn't get triggered if there are still images trying to load. I
use a graphic engine to draw huge graphs and it can take up to 5
seconds parsing the images and the code between the ready event doesnt
get triggered until the images are fully loaded.

It works flawlessly in Firefox. Only IE6-8 has this problem. Is there
something I am missing in my code? Is this a known issue with IE?

Thanks.


[jQuery] [autocomplete] making it work with JSON web service data source

2009-01-30 Thread Nekura Neko

I'm trying to replace a MS AJAX.NET autocomplete control with
something a bit lighter and more cache-and-compress friendly and I
really love how smoothly the Autocomplete plug-in generally works
(http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/).  I
had to change a couple of things to make it work with our JSON-service-
based design:

1) Our application is using web services serialized to JSON and it's
working great up until the autocomplete.  You can read about the
general methodology thanks to Dave over at
http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/.
To get around that for proof-of-concept purposes, I went into
Autocompleter.request and replaced the existing AJAX call with

$.ajax({
type: POST,
url: ajaxProxy.asmx/TagAutocomplete,
data: '{ prefixText : ' + lastWord(term) + ',
count : ' + options.max + '}',
contentType: application/json; charset=utf-8,
dataType: json,
success: function(msg) {
var mashed = options.parse  options.parse
(msg.d) || parse(msg.d);
cache.add(term, mashed);
success(term, mashed);
}
});

and altered parse() to just take an array instead of a delimited
string (var rows = data; // = data.split(\n);).  Now we're currently
just returning an array of strings, so this is no problem for us (so
long as a user doesn't stick a | or  in terms, though that can likely
be modded out as well).

Question at this point: Is there a simpler way to get the same JSON
callback out of Autocomplete?  If not, given the above, can it be
added to the official source?

2)  Given the above, there was an odd behavior in starting a new term
in a multiple-term box -- toss in a ,  and the correct form of the
previous term shows up ready to be auto-completed.  I fixed that by
eliminating the 0-character word check (//if ($.trim(value))) in
trimWords such that an empty string can go into the array.  It was a
quick fix, but I'm not sure how solid -- the core symptom appears to
be that lastWord is treating a 0-length word as not a word and instead
skipping to the previous word when onChange is figuring out what to
suggest autocompletes.

Question at this point:  Did I find a bug?  If so, is eliminating that
length-check when making an array of terms the most effective way of
dealing with it?  If so, is this something that will be patched in the
near future?

Thanks!


[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila


Sorry, the third validator must only get activated if both are empty
(in other words, it must return true if either is not empty):

function validateNameInputs(value, element) { return
firstNameInput.value || lastNameInput.value; }

On Jan 30, 11:19 am, Mihai Danila virid...@gmail.com wrote:
 There was a small typo in validateLastNameInput. Here's the corrected
 code.

 input id=firstName class=first-name-input name-input/
 input id=lastName class=last-name input name-input/
 jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
 'First name is missing.');
 jQuery.validator.addMethod('last-name-input', validateLastNameInput,
 'Last name is missing.');
 jQuery.validator.addMethod('name-input', validateNameInputs, 'First
 and Last name are missing.');
 var firstNameInput = document.getElementById('firstNameInput');
 var lastNameInput = document.getElementById('lastNameInput');
 function validateFirstNameInput(value, element) { return !
 lastNameInput.value || value; }           // 1
 function validateLastNameInput(value, element) { return !
 firstNameInput.value || value; }            // 2
 function validateNameInputs(value, element) { return
 firstNameInput.value  lastNameInput.value; } // 3

 On Jan 30, 11:18 am, Mihai Danila virid...@gmail.com wrote:

  I think you can put three validators on the fields, with
  jQuery.validator.addMethod. I don't know if you can add multiple
  validators for the same CSS class, so I'm putting extra CSS classes on
  the inputs:
  input id=firstName class=first-name-input name-input/
  input id=lastName class=last-name input name-input/

  jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
  'First name is missing.');
  jQuery.validator.addMethod('last-name-input', validateLastNameInput,
  'Last name is missing.');
  jQuery.validator.addMethod('name-input', validateNameInputs, 'First
  and Last name are missing.');

  var firstNameInput = document.getElementById('firstNameInput');
  var lastNameInput = document.getElementById('lastNameInput');
  function validateFirstNameInput(value, element) { return !
  lastNameInput.value || value; }           // 1
  function validateLastNameInput(value, element) { return
  firstNameInput.value || value; }            // 2
  function validateNameInputs(value, element) { return
  firstNameInput.value  lastNameInput.value; } // 3

  Validator #1 will always run for the first name input, but will choose
  to never display a message as long as the last name input is empty. If
  the last name input is not empty, then this validator will actually
  check the given value (the value of the first name input) and validate
  accordingly.

  Validator #2 is in a similar situation.

  Validator #3 will display an error only if both are empty.

  Think of them as working together to only activate the errors when
  only a subset of the possible conditions get applied.

  I'm looking for a way to do this with a single validator myself. I
  have dynamic forms and more complex situations, so I can't employ this
  solution. If anyone knows how to do it, please don't hesitate to put
  it in.

  Mihai

  On Jan 5, 4:26 pm, claudes claudina.sar...@gmail.com wrote:

   i have a group that contains both first and last name. i'm wondering if 
   it is
   possible to have custom messages for groups. i'm trying to achieve 
   something
   to the following:

   a. if both first and last name are not filled in: First and Last name are
   Required
   b. if only first is filled in: last name is required
   c. if only last is filled in: first name is required

   is this possible?
   --
   View this message in 
   context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages...
   Sent from the jQuery General Discussion mailing list archive at 
   Nabble.com.


[jQuery] Re: cancel jQuery binded event handlers

2009-01-30 Thread Dave Methvin

 Exactly. Does any body know how can I reach jQuery created event
 object in first handler. I think this could be a solution...

Event delivery order is an implementation detail so you can't be
guaranteed which will fire first. However, if the a4j handler is set
by the time .ready() fires you could do something like this:

$(document).ready(function(){
   // select the element...
   var a4jclick = element.onclick;
   element.onclick = null;
   $('element').click(function(e){
  // do what you need to here...
  if ( a4j_event_handler_should_run  a4jclick )
 return a4jclick.call(this, e);
  return whatever...
   });
});


[jQuery] Re: Form Plugin with file upload

2009-01-30 Thread Mike Alsup

 No, you are not supposed to do anything at all with the iframe.  The
 plugin handles all of that for you.  I'll try to take a look at your
 page tomorrow.


Well, I have to admit that I'm not sure why your page isn't working.
However, I did create a very simple test case here:

http://jquery.malsup.com/form/file-test3.html

This page has a file input and a text input and the form is submitted
to

http://jquery.malsup.com/form/test-xml.php

which you can see returns the exact same response as your server (I
think).

Could you create a simple test case like this and run it on your
server?

Mike


[jQuery] Re: Change URL in beforeSend

2009-01-30 Thread vtjiles


Figured out a way to do this so wanted to update with what I found. This
basically cancels the initial request and creates a new one with all the
same values except what you override in the extend function. By doing this,
any callback functions, etc, are kept. In addition, I put in an 'if'
statement because I only wanted to change certain requests based on the url.

$.ajaxSetup({
beforeSend : function() {
if([want to change request]) {
$.ajax($.extend(this,{
type:POST,
data: {
field1:[some value]
},
url:[new url]
}
));
return false;
};
}
});



vtjiles wrote:
 
 
 I have an app and want to change the url for all ajax requests to give
 them a relative path. I tried to set up a global change using
 ajaxSetup and beforeSend, but the url was only updated in the config,
 not the request object. Any thoughts on how to do this?
 
 code
 $.ajaxSetup({
beforeSend : function(J) {
   this.url = /newpath/ + this.url;
}
 });
 /code
 
 

-- 
View this message in context: 
http://www.nabble.com/Change-URL-in-beforeSend-tp20979635s27240p21752039.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Attribute selectors different for XML than for HTML?

2009-01-30 Thread GreatBigBore

I ran into a problem today trying to select elements in an XML tree. I
finally got it to work, but I had to make my XML handling different
from my HTML handling. Can someone help me to understand whether this
is a jquery bug or just a gap in my understanding?

To select my desired node in my HTML document, I used this syntax:

$('opti...@value=27]')

And it worked fine. Trying the same syntax on XML:

$('effo...@weeknumber=5], xml)

Causes the Javascript to fail entirely. But when I remove the @
symbol:

$('Effort[weekNumber=5], xml)

It works fine. Why is the syntax different for XML?


[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread GreatBigBore

Have your PHP script return an XML document:

PHP:

/*
FunctionResult
FunctionStatus success=1 message=Request processed /
/FunctionResult
*/
$document = DOMImplementation::createDocument();
$document-formatOutput = true;
$document-preserveWhitespace = true;

$functionResult = $document-createElement('FunctionResult');
$document-appendChild($functionResult);

$functionStatus = $document-createElement('FunctionStatus');
$functionResult-appendChild($functionStatus);

$success = true;
$message = 'Request successful';

...process the request and change $success and $message as
necessary...

$functionStatus-setAttribute('success', $success);
$functionStatus-setAttribute('message', addslashes($message));

// Now respond to the requestor
Header(Content-type: text/xml, 1);
echo $document-saveXML();
error_log($document-saveXML());

Javascript:

$.post('http://' + serverName + '/ajax.php',
{   'function' : 'getEfforts',
'parameter1' : something
},

function(xml) {
/*
FunctionResult
FunctionStatus success=1 message=Request 
processed /
/FunctionResult
*/
var statusNode = $('FunctionStatus', xml).get(0);
var success = 
intToBool(statusNode.getAttribute('success'));
if(success === true) {
} else {
}
}
);


[jQuery] Re: noob question

2009-01-30 Thread Bohdan Ganicky

Hi bart, let me cite from the spec:

get(): Access all matched DOM elements. This serves as a backwards-
compatible way of accessing all matched elements (other than the
jQuery object itself, which is, in fact, an array of elements). It is
useful if you need to operate on the DOM elements themselves instead
of using built-in jQuery functions.

.get() returns DOM elements not a jQuery object where all the magic
stuff happens. To match the first element in a jQuery you need to do:

// either this
$('p.fl').eq(0).css('background','red');
// or this
$('p.fl').slice(0,1).css('background','red');
// or this
$('p.fl:first').css('background','red');

There's a couple of other ways to do that but I guess this is enough.
--
Bohdan

On Jan 30, 5:31 pm, bart b...@ivwd.nl wrote:
 Somehow I don't get the concept of get() right. The following
 expression gives an error;

 $('p.fl').get(0).css('background', 'red');

 Now what I'm trying to do here is select the first paragraph from all
 the paragraphs with a class of fl. After that I'm just trying to get
 a visual id by making it red but it's more about grabbing the element
 really. There's probably a very good reason why this doesn't work but
 what I understand from documentation this should work?

 This ultimate goal is to hide a paragraph based on it's index. This
 index is gotten from a clicked link. So far I've got this, but it's
 stuck on the get() part.

 $('a.leesmeer').click(function()
 {
         var nmbr = $('a.leesmeer').index(this);
         $('p.fl').get(nmbr).hide();
         $('div.case').get(nmbr).show();
         return false;

 });


[jQuery] Re: Form Plugin with file upload

2009-01-30 Thread phicarre

Hi Mike,

This thread seems to be similar to my problem submitted by email
(subjet: about url) 

On 30 jan, 18:37, Mike Alsup mal...@gmail.com wrote:
  No, you are not supposed to do anything at all with the iframe.  The
  plugin handles all of that for you.  I'll try to take a look at your
  page tomorrow.

 Well, I have to admit that I'm not sure why your page isn't working.
 However, I did create a very simple test case here:

 http://jquery.malsup.com/form/file-test3.html

 This page has a file input and a text input and the form is submitted
 to

 http://jquery.malsup.com/form/test-xml.php

 which you can see returns the exact same response as your server (I
 think).

 Could you create a simple test case like this and run it on your
 server?

 Mike


[jQuery] trouble with adding functions

2009-01-30 Thread surreal5335

I am having troubles trying to get this function to work. I got the
first part to work but trying to get the p take a whole nother
action upon hover out.

Here is the jquery I am using

$(p#makered).hover(function(){
   $(this).addClass(red);
},
function() {
$(p#makered).fadeOut(slow);

});


The css works fine, but with the added jquery function changing the
text from green to red is no longer happening and firebug says I am
missing a ' ) ' after function() { Tried adding it just to see but
that doesnt work. Must be something else entirely.

Any help?


[jQuery] Re: next() working in ff but not in iex

2009-01-30 Thread Ricardo Tomasi

That's invalid mark-up, you can only have LIs as child elements of a
list. The browser is creating a LI and putting those DIVs inside,
that's why you're not finding them.

Your code should be like this:

ul
li
   spanAnalysis/span
   div class=accordionContent
pLorem Ipsum/p
   /div
/li
li
..
/li
/ul



On Jan 30, 9:35 am, elduderino jamesfiltn...@gmail.com wrote:
 Hi,

 I'm having a problem wit using next(). I have this code which i've built in
 to a simple test page which you could run to see my problem (obviously you
 need jquery included in the same directory).

 IN firefox next finds the div and I get the alert back...as expected. the
 div is a sibling of the list item and so should allow me to get to the
 alert. However in IEx this does not happen.

 Any ideas why? I thought jquery was supposed to deal with browser
 inconsitency?!

 anyways heres my code. Thanks in advance for any replies Smile

 Code:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=utf-8 /
 titleUntitled Document/title
 script type=text/javascript src=jquery.js/script
 script type=text/javascript
 function accordion() {
    var y = $('ul#accordion li');
    y.css({'color' : 'red'})
    y.click(
       function() {
          var current = $(this).next();
          if ((current.is('div'))  (current.is(':visible'))) {
             alert('hi');
          }
       }
    );}

 /script
 /head
 body
 ul id=accordion
     liAnalysis/li
         div class=accordionContent
             pLorem Ipsum is simply dummy text of the printing and
 typesetting industry. Lorem Ipsum has been the industry's standard dummy
 text ever since the 1500s, when an unknown printer took a galley of type and
 scrambled it to make a type specimen book. It has survived not only five
 centuries, but also the leap into electronic typesetting, remaining
 essentially unchanged. It was popularised in the 1960s with the release of
 Letraset sheets containing Lorem Ipsum passages, and more recently with
 desktop publishing software like Aldus PageMaker including versions of Lorem
 Ipsum./p
         /div
     liAnalysis/li
         div class=accordionContent
             pLorem Ipsum is simply dummy text of the printing and
 typesetting industry. Lorem Ipsum has been the industry's standard dummy
 text ever since the 1500s, when an unknown printer took a galley of type and
 scrambled it to make a type specimen book. It has survived not only five
 centuries, but also the leap into electronic typesetting, remaining
 essentially unchanged. It was popularised in the 1960s with the release of
 Letraset sheets containing Lorem Ipsum passages, and more recently with
 desktop publishing software like Aldus PageMaker including versions of Lorem
 Ipsum./p
         /div
     liAnalysis/li
         div class=accordionContent
             pLorem Ipsum is simply dummy text of the printing and
 typesetting industry. Lorem Ipsum has been the industry's standard dummy
 text ever since the 1500s, when an unknown printer took a galley of type and
 scrambled it to make a type specimen book. It has survived not only five
 centuries, but also the leap into electronic typesetting, remaining
 essentially unchanged. It was popularised in the 1960s with the release of
 Letraset sheets containing Lorem Ipsum passages, and more recently with
 desktop publishing software like Aldus PageMaker including versions of Lorem
 Ipsum./p
         /div
     liAnalysis/li
         div class=accordionContent
             pLorem Ipsum is simply dummy text of the printing and
 typesetting industry. Lorem Ipsum has been the industry's standard dummy
 text ever since the 1500s, when an unknown printer took a galley of type and
 scrambled it to make a type specimen book. It has survived not only five
 centuries, but also the leap into electronic typesetting, remaining
 essentially unchanged. It was popularised in the 1960s with the release of
 Letraset sheets containing Lorem Ipsum passages, and more recently with
 desktop publishing software like Aldus PageMaker including versions of Lorem
 Ipsum./p
         /div
 /ul
 script type=text/javascript
 accordion();
 /script
 /body
 /html
 --
 View this message in 
 context:http://www.nabble.com/next%28%29-working-in-ff-but-not-in-iex-tp21745...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread Nguyễn Quốc Vinh

Very simple!
Please use JSON to return JSON string!
With JSON, we can return value easier than XML!
With XML, you must echo correct tag=))


2009/1/31 GreatBigBore robfbis...@mac.com:

 Have your PHP script return an XML document:

 PHP:

/*
FunctionResult
FunctionStatus success=1 message=Request processed /
/FunctionResult
*/
$document = DOMImplementation::createDocument();
$document-formatOutput = true;
$document-preserveWhitespace = true;

$functionResult = $document-createElement('FunctionResult');
$document-appendChild($functionResult);

$functionStatus = $document-createElement('FunctionStatus');
$functionResult-appendChild($functionStatus);

$success = true;
$message = 'Request successful';

 ...process the request and change $success and $message as
 necessary...

$functionStatus-setAttribute('success', $success);
$functionStatus-setAttribute('message', addslashes($message));

// Now respond to the requestor
Header(Content-type: text/xml, 1);
echo $document-saveXML();
error_log($document-saveXML());

 Javascript:

$.post('http://' + serverName + '/ajax.php',
{   'function' : 'getEfforts',
'parameter1' : something
},

function(xml) {
/*
FunctionResult
FunctionStatus success=1 message=Request 
 processed /
/FunctionResult
*/
var statusNode = $('FunctionStatus', xml).get(0);
var success = 
 intToBool(statusNode.getAttribute('success'));
if(success === true) {
} else {
}
}
);




-- 
ku...@urbanjar.info
/
* Người ta thưởng chỉ chú ý đến những kẻ lên như diều gặp gió! Nhưng
hỡi ôi, chỉ có cát, bụi và lông hồng mới là những thứ lên nhanh nhất
*/


[jQuery] Re: Condense this function

2009-01-30 Thread Ricardo Tomasi

Well, it's simply a matter of choice.

Using setTimeout is shorter, simpler, more readable and offers the
same performance. I consider these advantages. Maybe in some other
context setInterval would be a better fit, but in this case I'd go for
simplicity.

cheers,
- ricardo

On Jan 30, 3:56 am, RobG rg...@iinet.net.au wrote:
 On Jan 30, 6:57 am, Ricardo Tomasi ricardob...@gmail.com wrote:

  I'm not sure there is any difference in performance,

 Nor am I, who mentioned performance?  It's about using the tool that's
 intended for the job.

  most animations
  use setTimeout instead of setInterval for better timing too (though
  it's irrelevant in this case).

 Cool, self-deprecating arguments are easy to respond to.

  And it would require a bit more code.

 It would require different code - less is not always more.  Here's a
 setInterval version:

   (function(set) {
     var i = 0, ref = setInterval(function() {
       (set[i])? $(set[i++]).fadeIn(500) : clearTimeout(ref);
     },100);
   })( $('.sticky:hidden') );

 which requires about 40 more characters - are programmers *that*
 lazy?  It can likely be more consise if I knew more about how to
 access items in a jQuery object or the OP wanted to call it other than
 as an anonymous function.

 The reason for suggesting setInterval is that its purpose is to run a
 command at a set interval, which seems to be what the OP is after.
 There seems to be a mindset with jQuery that every statement must be
 written in the form $(someSelector).doStuff()... rather than looking
 at individual problems and coding accordingly.  Hence it seems the
 more appropriate setInterval function was overlooked in order to fit
 in with jQuery's coding style.

 --
 Rob


[jQuery] Damn ie7!

2009-01-30 Thread david.0pl...@gmail.com

Hi to everybody, it's my first post here so it's nice to introduce
myself: my name is David, i currently live in Italy, nice to meet you
all and many thank for this wonderful jquery!. I'm starting to get a
grasp of jquery (i used prototype before and i find jquery a lot more
easy to work with) but I'm puzzled on how this doesn't work in ie7!:


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

$('option#nascondidata').click(function() {
$('#datasingola').show('slow');
return false;
});

});

function showHide() {
$('#datasingola').hide('slow');
}
/script



And this is the html to hide:



div id=datasingolap
label for=data_fData Fine (lascia vuoto per campagne senza
scadenza)/label
em/eminput id=data_f name=data_f size=25 class=date /
/p/div

This is the one that calls it:

select name=gruppioption id=nascondidata value=0Nessuno../
optionoption onClick=showHide() value='1'Ciao/option.../
select

This does work beautifully in firefox, why doesn't in ie 7? THanks!


[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread GreatBigBore

Have your PHP script return an XML document, and then parse that XML
with JQuery:

PHP:

/*
FunctionResult
FunctionStatus success=1 message=Request processed /
/FunctionResult
*/
$document = DOMImplementation::createDocument();
$document-formatOutput = true;
$document-preserveWhitespace = true;

$functionResult = $document-createElement('FunctionResult');
$document-appendChild($functionResult);

$functionStatus = $document-createElement('FunctionStatus');
$functionResult-appendChild($functionStatus);

$success = true;
$message = 'Request successful';

...Do stuff that changes $success and $message if necesssary...

$functionStatus-setAttribute('success', $success);
$functionStatus-setAttribute('message', addslashes($message));

// Now respond to the requestor
Header(Content-type: text/xml, 1);
echo $document-saveXML();

Javascript:

$.post('http://myserver.com/ajax.php',
{   'function' : 'getEfforts',
'parameter1' : something
},

function(xml) {
/*
FunctionResult
FunctionStatus success=1 message=Request processed 
/
/FunctionResult
*/
var statusNode = $('FunctionStatus', xml).get(0);
var success = intToBool(statusNode.getAttribute('success'));
if(success === true) {
} else {
}
}
);


[jQuery] Unload issue with Firefox

2009-01-30 Thread dberthia

I've got a jQuery 1.2.6 script that attaches a click handler to every
hyperlink on a page. We have a small number of pages where the number
of link are massive (5000+, and yes I know this is ridiculous). On
these pages, when I try to navigate AWAY from them, Firefox will be
unresponsive for a couple of minutes. I've determined the length of
the delay is directly proportional to the number of my click handlers.
I've tried 1.3.1, but have gotten only marginally better results. I
don't see the issue in IE or Safari. Any ideas?

I've tried doing a manual unbind on the links in window.onunload, to
no avail.

- Dave


[jQuery] Re: trouble with adding functions

2009-01-30 Thread surreal5335

Ok, well I was able to get to work, but I cant figure out now how to
reduce the hover area. For some reason hovering on any part of the
screen that is horizontal with the text will cause the hover event to
trigger. How can I stop this?

This the current jquery haddling the event

$(p#makered).hover(function(){
   $(this).addClass(red);

},
function() {
$(p#makered).removeClass(red);
 $(this).fadeOut(1000);

});


});

The css handling the colors and border (which isnt showing up either):

style type=text/css


p.green { color: rgb(0,255,0); }

p.red {
color: rgb(255,0,0);
border: 1px;
}


 /style


Here is the html for the text:

p class=green id=makeredSome text/p

Thanks a lot for your help on this matter


On Jan 30, 11:11 am, surreal5335 surrea...@hotmail.com wrote:
 I am having troubles trying to get this function to work. I got the
 first part to work but trying to get the p take a whole nother
 action upon hover out.

 Here is the jquery I am using

         $(p#makered).hover(function(){
                $(this).addClass(red);
         },
         function() {
         $(p#makered).fadeOut(slow);

         });

 The css works fine, but with the added jquery function changing the
 text from green to red is no longer happening and firebug says I am
 missing a ' ) ' after function() { Tried adding it just to see but
 that doesnt work. Must be something else entirely.

 Any help?


[jQuery] Re: validation with jquery 1.3

2009-01-30 Thread Jörn Zaefferer

Have you updated to 1.5.1?
http://bassistance.de/2009/01/14/releases-jquery-13-and-validation-plugin-151/

Jörn

On Fri, Jan 30, 2009 at 5:17 PM, andré l...@chrom.fr wrote:

 Hello,
 Thanks for your fabulous validation form.
 But I 've a problem.When I use jquery 1.2.6, my form works well on IE,
 firefox and safari. But When I use jquery 1.3 in IE the error message
 doesn't work Can you help me ?
 my script :
 $().ready(function() {

// validate signup form on keyup and submit
$(#InfoClient).validate({
rules: {
Nom : required,
Prenom : required,
DateNaissance : {
date: true
},
Adresse : required,
CodePostal : required,
Ville :required,
Pays : {
digits: true
},
TelFixe: {
digits:true,
required: function(element) {
return $(#TelPort).val() 01;
}


},
TelPort: {

digits:true,
required: function(element) {
return $(#TelFixe).val() 01;
}
}
},
messages: {
Nom :Veuillez entrer un nom !,
Prenom :Veuillez entrer un prénom !,
DateNaissance :Veuillez entrer une date de naissance 
 sous la forme
 JJ/MM/ !,
Adresse :Veuillez une adresse !,
CodePostal :Veuillez un code postal !,
Ville :Veuillez entrer une ville !,
Pays :Veuillez entrer un pays !,
TelPort :Veuillez entrer un numéro de fixe ou de  
 portable à 10
 chiffres!,
TelFixe :Veuillez entrer un numéro de fixe ou de  
 portable à 10
 chiffres !
}
});
 });



[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....

2009-01-30 Thread Ricardo Tomasi

We can't access the success function of the $.ajax call without
messing with jQuery source code, because the vars that name it are
inside the jQuery function scope.

In JSONP, the JSON object is passed as an argument to the callback
function. In the example I posted:

jsonFlickrFeed = function(data){ //do something with data };

On Jan 30, 7:28 am, Stefano Corallo stefan...@gmail.com wrote:
 On 28 Gen, 17:03, Ricardo Tomasi ricardob...@gmail.com wrote:

  It isn't possible to have error/success callbacks for JSONP. You can't
  cancel the request either. Once you add a script tag to the head,
  the browser fires a GET request and it can't be interrupted - even if
  you remove the script before the response comes, the script will still
  run.

 ok. got it!

  (the only event that fires on the script tag is 'onload', but it only
  tells you if the content has successfully loaded, not the opposite.
  There is no way to know if an error happened)

  Also, you're misunderstanding the way JSONP works - there is no need
  for a 'success' function, that is the callback function which will be
  called when the response is loaded. Thats 'jsonFlickerFeed' in my
  example.

 Ok i've understood how jsonp work, but there's something that i can't
 understand.
 I try to explain better i can (sorry for my bad english)

 1)Using the $.ajax method, an example:
 $.ajax({
                            type: methodType,
                            url: theURL,
                            data: params,
                            dataType:jsonp,
                            success: function(data){
                                         console.log(onClick success);
                                    }
                             });

 in the jquery core is built a temporary jsonp function to handle the
 data returned by the server, if the succes function is defined the
 temporary function call the succe function and pass the returned
 data ... specifically at line 3314 of the jquery.1.3.1.js :

 // Handle JSONP-style loading
                         window[ jsonp ] = function(tmp){
                                 data = tmp;
                                 success();
                                 complete();
                                 // Garbage collect
                                 window[ jsonp ] = undefined;
                                 try{ delete window[ jsonp ]; } catch(e){}
                                 if ( head )
                                         head.removeChild( script );
                         };

 the tmp is the data returned by the server.

 Now in your example you use the jsonFlickrFeed function but without
 handling the returned data from the server:

 jsonFlickrFeed = function(){ alert('flickr loaded'); };
 $.jsonp({
   url: 'http://api.flickr.com/services/feeds/photos_public.gne?
 tags=hackdayindialang=en-usformat=jsoncallback=jsonFlickrFeed',
   timeout: 10,
   onTimeout: function(url){ console.error('jsonp script timed out:
 '+url) }

 });

 how to access the data returned from the server? How to modify the
 $.jsonp function to call the success function defined and pass in the
 data returned from the server ... this is sure possible case jquery in
 $.ajax call do it, but i don't know how :-/

 Many thanks, really!

 I hope i've been clear, sorry for my english!


[jQuery] Re: Unload issue with Firefox

2009-01-30 Thread Ricardo Tomasi

jQuery will remove all event handlers on unload to avoid memory leaks.

You should consider event delegation, see the docs for live():
http://docs.jquery.com/Events/live
It will speed up your loading/unloading times considerably.

cheers,
- ricardo


On Jan 30, 2:58 pm, dberthia dave.berthia...@gmail.com wrote:
 I've got a jQuery 1.2.6 script that attaches a click handler to every
 hyperlink on a page. We have a small number of pages where the number
 of link are massive (5000+, and yes I know this is ridiculous). On
 these pages, when I try to navigate AWAY from them, Firefox will be
 unresponsive for a couple of minutes. I've determined the length of
 the delay is directly proportional to the number of my click handlers.
 I've tried 1.3.1, but have gotten only marginally better results. I
 don't see the issue in IE or Safari. Any ideas?

 I've tried doing a manual unbind on the links in window.onunload, to
 no avail.

 - Dave


[jQuery] Re: $.ajax bug ?!? Maybe i've not understand somethings ....

2009-01-30 Thread Stefano Corallo


On 30 Gen, 19:25, Ricardo Tomasi ricardob...@gmail.com wrote:
 We can't access the success function of the $.ajax call without
 messing with jQuery source code, because the vars that name it are
 inside the jQuery function scope.


ok

 In JSONP, the JSON object is passed as an argument to the callback
 function. In the example I posted:

 jsonFlickrFeed = function(data){ //do something with data };


i've tried but data is always undefined,take a look:

http://jsbin.com/ajimu/edit

 On Jan 30, 7:28 am, Stefano Corallo stefan...@gmail.com wrote:

  On 28 Gen, 17:03, Ricardo Tomasi ricardob...@gmail.com wrote:

   It isn't possible to have error/success callbacks for JSONP. You can't
   cancel the request either. Once you add a script tag to the head,
   the browser fires a GET request and it can't be interrupted - even if
   you remove the script before the response comes, the script will still
   run.

  ok. got it!

   (the only event that fires on the script tag is 'onload', but it only
   tells you if the content has successfully loaded, not the opposite.
   There is no way to know if an error happened)

   Also, you're misunderstanding the way JSONP works - there is no need
   for a 'success' function, that is the callback function which will be
   called when the response is loaded. Thats 'jsonFlickerFeed' in my
   example.

  Ok i've understood how jsonp work, but there's something that i can't
  understand.
  I try to explain better i can (sorry for my bad english)

  1)Using the $.ajax method, an example:
  $.ajax({
                             type: methodType,
                             url: theURL,
                             data: params,
                             dataType:jsonp,
                             success: function(data){
                                          console.log(onClick success);
                                     }
                              });

  in the jquery core is built a temporary jsonp function to handle the
  data returned by the server, if the succes function is defined the
  temporary function call the succe function and pass the returned
  data ... specifically at line 3314 of the jquery.1.3.1.js :

  // Handle JSONP-style loading
                          window[ jsonp ] = function(tmp){
                                  data = tmp;
                                  success();
                                  complete();
                                  // Garbage collect
                                  window[ jsonp ] = undefined;
                                  try{ delete window[ jsonp ]; } catch(e){}
                                  if ( head )
                                          head.removeChild( script );
                          };

  the tmp is the data returned by the server.

  Now in your example you use the jsonFlickrFeed function but without
  handling the returned data from the server:

  jsonFlickrFeed = function(){ alert('flickr loaded'); };
  $.jsonp({
    url: 'http://api.flickr.com/services/feeds/photos_public.gne?
  tags=hackdayindialang=en-usformat=jsoncallback=jsonFlickrFeed',
    timeout: 10,
    onTimeout: function(url){ console.error('jsonp script timed out:
  '+url) }

  });

  how to access the data returned from the server? How to modify the
  $.jsonp function to call the success function defined and pass in the
  data returned from the server ... this is sure possible case jquery in
  $.ajax call do it, but i don't know how :-/

  Many thanks, really!

  I hope i've been clear, sorry for my english!


[jQuery] Re: Damn ie7!

2009-01-30 Thread GreatBigBore

I have found that IE7 is very uncooperative about option nodes. I
recommend that you remove onClick, and attach the click handler inside
$(document).ready(). Good luck.


[jQuery] Re: Damn ie7!

2009-01-30 Thread GreatBigBore

If adding a click handler in $(document).ready() doesn't work, you
could always add a change handler to the select and just check the
value. I did this in a recent project and it works fine.


[jQuery] Re: Unload issue with Firefox

2009-01-30 Thread dberthia

Thanks, Ricardo. I'll give that a look.

On Jan 30, 12:31 pm, Ricardo Tomasi ricardob...@gmail.com wrote:
 jQuery will remove all event handlers on unload to avoid memory leaks.

 You should consider event delegation, see the docs for 
 live():http://docs.jquery.com/Events/live
 It will speed up your loading/unloading times considerably.

 cheers,
 - ricardo

 On Jan 30, 2:58 pm, dberthia dave.berthia...@gmail.com wrote:

  I've got a jQuery 1.2.6 script that attaches a click handler to every
  hyperlink on a page. We have a small number of pages where the number
  of link are massive (5000+, and yes I know this is ridiculous). On
  these pages, when I try to navigate AWAY from them, Firefox will be
  unresponsive for a couple of minutes. I've determined the length of
  the delay is directly proportional to the number of my click handlers.
  I've tried 1.3.1, but have gotten only marginally better results. I
  don't see the issue in IE or Safari. Any ideas?

  I've tried doing a manual unbind on the links in window.onunload, to
  no avail.

  - Dave


[jQuery] Getting the height of a hidden div in Firefox

2009-01-30 Thread rob303

Hi,

I've been working on this for days.  The chaps on IRC couldn't find an
answer so I thought I'd post it here just in case anyone knows what's
going on.

I have a basic accordion type feature.  The designer wants to be able
to open more than one of hidden the sections at once ...

So, here is my code:

$(.accordion .accordion_header).click(function() {
if($(this).hasClass('accordion_selected')) {
  $(this).removeClass('accordion_selected').next().slideUp
({duration: 'slow', easing: 'easeInOutQuad'});
} else {
  $(this).addClass('accordion_selected').next().slideDown
({duration: 'slow', easing: 'easeInOutQuad'});
}
  }).next().hide();

.accordion {
  width: 97%;
  list-style-type: none;
}

.accordion_header {
  display: block;
  height: 20px;
  background: url(../images/bgd_accordion_off.gif) repeat-x;
  padding: 5px 10px 0 10px;
}

.accordion_header:hover {
  background: url(../images/bgd_accordion_on.gif) repeat-x;
  color: #d7d7d9;
}

.accordion_selected {
  background: url(../images/bgd_accordion_on.gif) repeat-x;
  color: #d7d7d9;
}

.accordion_section {
  display: block;
  line-height: 20px;
  padding: 0 10px 0 10px;
}

ul class=accordion
  li
a href=javascript:; class=accordion_headerheading/a
div class=accordion_section
  A bunch of text
/div
  /li
/ul

The problem I face is that the content within the hidden div
(accordion_section) is db driven so I have no idea what content to put
in there.  This means I cannot fix the height of those divs.  This in
turn breaks the animate on the slideDown function.  If I set the
height of the div the animate is perfect.  Without it everythings all
jumpy and broken looking.  So I figured that all I needed to do was to
get the height of the hidden div and then apply it using  a css()
call.  This works fine in IE but Firefox doesn't seem able to give me
the correct height for the div.  For example if I use this code:

var h = $(this).next().height();
alert(h);

IE gives me 240 - which correct for that particular div.  But firefox
gives 160 for the same div! Anyone know why?

Many thanks in advance for any help.

Rob.


[jQuery] Re: Can JQuery solve the iframe height=100% problem?

2009-01-30 Thread jquertil

I think you're going down the wrong path - you shouldnt need to script
anything to get a CSS attribute to work.

usually when I run into this problem it is because somewhere in my
document tree there is a parent lement that has no height attribute
set.

So if you have html  someDiv  anotherDiv  table  tr td  iframe

every one of the elements should have a parent with  height set

At least this is how I usually end up solving the dreaded height 100%
problem whenever I come to it.

Alternatively, you can try

$('#myIframe').css({height:$(this).parent('td').height()});


[jQuery] Re: what would be the opposite of top.frames as a jquery selector context?

2009-01-30 Thread jquertil

it ended up being quite easy actually:

$('#'+self.name, top.document).hide();

usually whenever I try to so something and it requires more than 1
line of code it's my fault, not jquery's...


[jQuery] Re: Using $_POST to transmit large key/pair

2009-01-30 Thread Beres Botond

As shown in the docs (link I gave you), it should work

$.post(order_send_email.php,
   {order_message : order_message}, // {key : variable}
   function(data)
 {
 alert(data);
 // do something
 });


On Jan 30, 4:03 pm, Mark Livingstone namematters...@msn.com wrote:
 Thanks, Beres.

 I am reading this order_message from a DIV. How do I 'POST' it? By
 using form?

 Also, to url encode... do I use escape()?

 On Jan 30, 3:08 am, Beres Botond boton...@gmail.com wrote:

  You want to use POST, but you are sending your data as GET (without
  url encoding).
  So I'm pretty sure it cuts before #, because # is a non-alphanumeric
  character and you haven't urlencoded your data.

  Data in URL  = GET, not POST, even if you are using $.post .

 http://docs.jquery.com/Post

  So either urlencode your data before putting it in the request or send
  it as POST.

  Also I'm not sure how it worked for you on server-side, if you were
  expecting $_POST... I assume you were expecting
  $_REQUEST instead, which is not a good idea in my opinion.

  On Jan 30, 8:08 am, Mark Livingstone namematters...@msn.com wrote:

   I have the following code:

   $.post(order_send_email.php?order_message='+order_message)

   my 'order_message' is:

   'Dear '+data['salutation']+ +data['first_name']+ +data['last_name']
   +', \n\nThis is to inform you that your order #'+key+ and payment in
   the amount of...';

   When using $.POST... the message gets cut before #. Is there a limit
   on how much cam be transmitted or am I doing something wrong?

   Thanks.- Hide quoted text -

  - Show quoted text -


[jQuery] Re: Damn ie7!

2009-01-30 Thread MorningZ

So what he talks about

function showHide() {
  if ($(this).val() == 1) { $('#datasingola').hide('slow'); }
}

and then

select name=gruppi onchange=showHide()option id=nascondidata
value=0Nessuno../
optionoption value='1'Ciao/option.../select

takes the option out of the equation, which as you are finding out,
isn't very manipulatable in IE




On Jan 30, 1:43 pm, GreatBigBore robfbis...@mac.com wrote:
 If adding a click handler in $(document).ready() doesn't work, you
 could always add a change handler to the select and just check the
 value. I did this in a recent project and it works fine.


[jQuery] Re: Getting the height of a hidden div in Firefox

2009-01-30 Thread Eric Garside

Different box models. I'd read up more on the difference between the
IE/FF box models to point you in the right direction. I'd give you a
quick tutorial, but I get out at 3 on Fridays! :D

On Jan 30, 1:52 pm, rob303 rob.cub...@googlemail.com wrote:
 Hi,

 I've been working on this for days.  The chaps on IRC couldn't find an
 answer so I thought I'd post it here just in case anyone knows what's
 going on.

 I have a basic accordion type feature.  The designer wants to be able
 to open more than one of hidden the sections at once ...

 So, here is my code:

 $(.accordion .accordion_header).click(function() {
     if($(this).hasClass('accordion_selected')) {
           $(this).removeClass('accordion_selected').next().slideUp
 ({duration: 'slow', easing: 'easeInOutQuad'});
         } else {
           $(this).addClass('accordion_selected').next().slideDown
 ({duration: 'slow', easing: 'easeInOutQuad'});
         }
   }).next().hide();

 .accordion {
   width: 97%;
   list-style-type: none;

 }

 .accordion_header {
   display: block;
   height: 20px;
   background: url(../images/bgd_accordion_off.gif) repeat-x;
   padding: 5px 10px 0 10px;

 }

 .accordion_header:hover {
   background: url(../images/bgd_accordion_on.gif) repeat-x;
   color: #d7d7d9;

 }

 .accordion_selected {
   background: url(../images/bgd_accordion_on.gif) repeat-x;
   color: #d7d7d9;

 }

 .accordion_section {
   display: block;
   line-height: 20px;
   padding: 0 10px 0 10px;

 }

 ul class=accordion
   li
     a href=javascript:; class=accordion_headerheading/a
     div class=accordion_section
       A bunch of text
     /div
   /li
 /ul

 The problem I face is that the content within the hidden div
 (accordion_section) is db driven so I have no idea what content to put
 in there.  This means I cannot fix the height of those divs.  This in
 turn breaks the animate on the slideDown function.  If I set the
 height of the div the animate is perfect.  Without it everythings all
 jumpy and broken looking.  So I figured that all I needed to do was to
 get the height of the hidden div and then apply it using  a css()
 call.  This works fine in IE but Firefox doesn't seem able to give me
 the correct height for the div.  For example if I use this code:

 var h = $(this).next().height();
 alert(h);

 IE gives me 240 - which correct for that particular div.  But firefox
 gives 160 for the same div! Anyone know why?

 Many thanks in advance for any help.

 Rob.


[jQuery] Re: jquery slider- make handle clickable

2009-01-30 Thread m...@fonolo.com

Ah- nice- that makes sense- changing it to values worked-

Now, is there a way to actually get the index of the handle that was
clicked on? short of just figuring it out based on the start value?

Thanks for all your help Richard,

Mike


On Jan 29, 8:22 pm, Richard D. Worth rdwo...@gmail.com wrote:
 On Thu, Jan 29, 2009 at 8:16 PM, m...@fonolo.com m...@fonolo.com wrote:

  So I grabbed a copy of ui.slider and ui.core from trunk, and it does
  indeed fix the issue with clicking on the handle; it is now clickable,
  and it doesn't shift around.

 Glad to hear it.



  BUT

  it seems when I have multiple handles on a slider (using values:
  [ array of integers ], but NOT using a range), while the handles are
  clickable, and both the start/stop events fire for each handle, the
  ui.value is 0?

  maybe it's the way I've implemented it? maybe because i've got
  multiple handles on a slider, without a range setting?

  I've also tried accessing value, not only from ui.value, but from

  $('#slider2').slider('value', 0), and I still get 0 back as the value

 If you have multiple handles (with or without a range) you need to use the
 'values' method instead of 'value'. It's similar to 'value' except that you
 need to pass an index as the first argument. For example

 //get the value of the 3rd handle
 var val = $(#slider).slider('values', 2);

 //set the value of the 1st handle to 5
 $(#slider).slider('values', 0, 5);

 - Richard


[jQuery] Re: Getting the height of a hidden div in Firefox

2009-01-30 Thread rob303

Thanks for the reply Eric.  But what have different box models got to
do with it? I'm not setting any border or padding properties on my
hidden div that would effect the height.  And the difference between
the two browsers is huge.  IE says 240px and FF says 160px.  I
certainly don't have 80px worth of padding on that element ...

Rob.

On Jan 30, 7:45 pm, Eric Garside gars...@gmail.com wrote:
 Different box models. I'd read up more on the difference between the
 IE/FF box models to point you in the right direction. I'd give you a
 quick tutorial, but I get out at 3 on Fridays! :D

 On Jan 30, 1:52 pm, rob303 rob.cub...@googlemail.com wrote:

  Hi,

  I've been working on this for days.  The chaps on IRC couldn't find an
  answer so I thought I'd post it here just in case anyone knows what's
  going on.

  I have a basic accordion type feature.  The designer wants to be able
  to open more than one of hidden the sections at once ...

  So, here is my code:

  $(.accordion .accordion_header).click(function() {
      if($(this).hasClass('accordion_selected')) {
            $(this).removeClass('accordion_selected').next().slideUp
  ({duration: 'slow', easing: 'easeInOutQuad'});
          } else {
            $(this).addClass('accordion_selected').next().slideDown
  ({duration: 'slow', easing: 'easeInOutQuad'});
          }
    }).next().hide();

  .accordion {
    width: 97%;
    list-style-type: none;

  }

  .accordion_header {
    display: block;
    height: 20px;
    background: url(../images/bgd_accordion_off.gif) repeat-x;
    padding: 5px 10px 0 10px;

  }

  .accordion_header:hover {
    background: url(../images/bgd_accordion_on.gif) repeat-x;
    color: #d7d7d9;

  }

  .accordion_selected {
    background: url(../images/bgd_accordion_on.gif) repeat-x;
    color: #d7d7d9;

  }

  .accordion_section {
    display: block;
    line-height: 20px;
    padding: 0 10px 0 10px;

  }

  ul class=accordion
    li
      a href=javascript:; class=accordion_headerheading/a
      div class=accordion_section
        A bunch of text
      /div
    /li
  /ul

  The problem I face is that the content within the hidden div
  (accordion_section) is db driven so I have no idea what content to put
  in there.  This means I cannot fix the height of those divs.  This in
  turn breaks the animate on the slideDown function.  If I set the
  height of the div the animate is perfect.  Without it everythings all
  jumpy and broken looking.  So I figured that all I needed to do was to
  get the height of the hidden div and then apply it using  a css()
  call.  This works fine in IE but Firefox doesn't seem able to give me
  the correct height for the div.  For example if I use this code:

  var h = $(this).next().height();
  alert(h);

  IE gives me 240 - which correct for that particular div.  But firefox
  gives 160 for the same div! Anyone know why?

  Many thanks in advance for any help.

  Rob.


[jQuery] Re: Getting the height of a hidden div in Firefox

2009-01-30 Thread rob303

Oh, one other thing.  If I call .css('display', 'block') on the
element before using height() FF gives me the correct value of 240px.
Obviously, that breaks the accordion because I want the element
hidden!

/me scratches head ...

Rob.

On Jan 30, 7:57 pm, rob303 rob.cub...@googlemail.com wrote:
 Thanks for the reply Eric.  But what have different box models got to
 do with it? I'm not setting any border or padding properties on my
 hidden div that would effect the height.  And the difference between
 the two browsers is huge.  IE says 240px and FF says 160px.  I
 certainly don't have 80px worth of padding on that element ...

 Rob.

 On Jan 30, 7:45 pm, Eric Garside gars...@gmail.com wrote:

  Different box models. I'd read up more on the difference between the
  IE/FF box models to point you in the right direction. I'd give you a
  quick tutorial, but I get out at 3 on Fridays! :D

  On Jan 30, 1:52 pm, rob303 rob.cub...@googlemail.com wrote:

   Hi,

   I've been working on this for days.  The chaps on IRC couldn't find an
   answer so I thought I'd post it here just in case anyone knows what's
   going on.

   I have a basic accordion type feature.  The designer wants to be able
   to open more than one of hidden the sections at once ...

   So, here is my code:

   $(.accordion .accordion_header).click(function() {
       if($(this).hasClass('accordion_selected')) {
             $(this).removeClass('accordion_selected').next().slideUp
   ({duration: 'slow', easing: 'easeInOutQuad'});
           } else {
             $(this).addClass('accordion_selected').next().slideDown
   ({duration: 'slow', easing: 'easeInOutQuad'});
           }
     }).next().hide();

   .accordion {
     width: 97%;
     list-style-type: none;

   }

   .accordion_header {
     display: block;
     height: 20px;
     background: url(../images/bgd_accordion_off.gif) repeat-x;
     padding: 5px 10px 0 10px;

   }

   .accordion_header:hover {
     background: url(../images/bgd_accordion_on.gif) repeat-x;
     color: #d7d7d9;

   }

   .accordion_selected {
     background: url(../images/bgd_accordion_on.gif) repeat-x;
     color: #d7d7d9;

   }

   .accordion_section {
     display: block;
     line-height: 20px;
     padding: 0 10px 0 10px;

   }

   ul class=accordion
     li
       a href=javascript:; class=accordion_headerheading/a
       div class=accordion_section
         A bunch of text
       /div
     /li
   /ul

   The problem I face is that the content within the hidden div
   (accordion_section) is db driven so I have no idea what content to put
   in there.  This means I cannot fix the height of those divs.  This in
   turn breaks the animate on the slideDown function.  If I set the
   height of the div the animate is perfect.  Without it everythings all
   jumpy and broken looking.  So I figured that all I needed to do was to
   get the height of the hidden div and then apply it using  a css()
   call.  This works fine in IE but Firefox doesn't seem able to give me
   the correct height for the div.  For example if I use this code:

   var h = $(this).next().height();
   alert(h);

   IE gives me 240 - which correct for that particular div.  But firefox
   gives 160 for the same div! Anyone know why?

   Many thanks in advance for any help.

   Rob.


[jQuery] Re: How PHP script can return two variables ?

2009-01-30 Thread Eric Garside

That XML is a lot of unnecessary work. If you're running with PHP5,
simply print on success:

echo json_encode(array('success' = true, message = ''));

or on failure:

echo json_encode(array('success' = false, message = ''));

And for the jQuery bit:

$.post('somurl.php', function (data){
if (data.success){
// Code for successful comment post
} else {
   // Code for failed comment post
}
}, 'json');

On Jan 30, 12:42 pm, GreatBigBore robfbis...@mac.com wrote:
 Have your PHP script return an XML document, and then parse that XML
 with JQuery:

 PHP:

         /*
         FunctionResult
                 FunctionStatus success=1 message=Request processed /
         /FunctionResult
         */
         $document = DOMImplementation::createDocument();
         $document-formatOutput = true;
         $document-preserveWhitespace = true;

         $functionResult = $document-createElement('FunctionResult');
         $document-appendChild($functionResult);

         $functionStatus = $document-createElement('FunctionStatus');
         $functionResult-appendChild($functionStatus);

         $success = true;
         $message = 'Request successful';

 ...Do stuff that changes $success and $message if necesssary...

         $functionStatus-setAttribute('success', $success);
         $functionStatus-setAttribute('message', addslashes($message));

         // Now respond to the requestor
         Header(Content-type: text/xml, 1);
         echo $document-saveXML();

 Javascript:

 $.post('http://myserver.com/ajax.php',
         {       'function' : 'getEfforts',
                 'parameter1' : something
         },

         function(xml) {
                 /*
                 FunctionResult
                         FunctionStatus success=1 message=Request 
 processed /
                 /FunctionResult
                 */
                 var statusNode = $('FunctionStatus', xml).get(0);
                 var success = intToBool(statusNode.getAttribute('success'));
                 if(success === true) {
                 } else {
                 }
         }
 );


[jQuery] jQuery + Cycle Plugin (Duplicating Problem with Pager Anchors in IE)

2009-01-30 Thread Matt M.

I'm having an issue where the pager is building twice as many anchors
as there are pics. I only have this issue in IE. The script is working
great in FF/Safari. You can see the difference on the page below. Any
help is appreciated. Thanks!

http://70.32.114.139/bases/naval-base-kitsap-bangor

(Using jQuery Cycle Plugin Version: 2.32)


[jQuery] jQuery + Cycle Pager Nav Issue in IE

2009-01-30 Thread Matt M.

I'm having a weird problem where IE is adding twice as many nav pager
elements. As you can see, the script works nicely in FF/Safari, but
when viewed in IE, the nav gets wonky. I'm having trouble figuring it
out, so any help is appreciated. Thanks!

http://70.32.114.139/bases/naval-base-kitsap-bangor


  1   2   >