[jQuery] Qunit - ok(boolean)

2009-11-22 Thread jeanluca
Hi All

how does this test work. I've copied the demo test page (http://
docs.jquery.com/QUnit) and played with this function, but whatever I
do, it always prints 'test success':

ok( true, test success );
ok( false, test success );

It should behave identical to assertTrue, so I expect only to see
'test success' when 'true'
I'm sure there is no bug here, its me :), but what am I missing ?

cheers
LuCa



[jQuery] Re: AJAX: Display raw XML Document

2009-09-17 Thread jeanluca

does that also work in IE(6) ?

On Sep 17, 12:43 am, Jonathan jonandke...@gmail.com wrote:
 That did it. I was using success which did not provide access to the
 xml as a string I could output, but complete works great. Thanks! Now
 I cane easily get the text, the HTTP Response code.

 On Sep 16, 1:32 pm, Mike Alsup mal...@gmail.com wrote:

   I still can't find a solution to simply print out the XML response
   from an AJAX call. I'm surprised jQuery can't handle something that
   simple, as it can otherwise do so much.

   The other js libraries don't seem to have a problem with it, it looks
   like jQuery just isn't up to the task, and I can't use it for this
   project.

  Try hooking the 'complete' callback and access the responseText
  property of the XHR:

  $.ajax({
      ...
      complete: function(xhr, status) {
          alert(xhr.responseText);
      }

  });




[jQuery] Re: improve/extend the selectors

2009-09-08 Thread jeanluca

:) you're right about the first thing, my mistake!

ok, lets only focus on the second (I've modified it a little bit!!)

  $.ajax({
   type: GET,
   url: 'myxml.xml',
   dataType: 'xml',
   success: function(xml){
   alert( $(body, xml).html() ) ; // this cannot be
done!!
   $(body).html( $(h1, xml).html() ) ; // insert it
   }
   }) ;

suppose the xml file contains something like

myxml
  body
h1 hello /h1
  /body
/myxml

Is if, for example, possible to add functionality to the $ function ?
ps for example, http://james.padolsey.com/javascript/regex-selector-for-jquery/
adds functionality to jquery selectors!
pps currently I've nothing online, but if it would still help, I'll
try to get something online as soon as possible!

Hopefully this makes any sense!
On Sep 8, 2:31 am, Michael Geary m...@mg.to wrote:
 Whoa, that's three things. (And the first one isn't even JavaScript.)

 Could we get this down to one specific, concrete case that you want to
 solve?

 I'm not very good at solving general problems that handle a lot of
 possibilities, but if there is one specific piece of code that you'd like to
 get working, and there's one particular missing link in it, I'm pretty sure
 I could help you find or code that missing link. But without actual data to
 look at, I don't have a way of testing any possible solution I might come up
 with. That means a link to a test page that shows what you're trying to do.

 Now somebody else may come along who understands the problem better and can
 give you a good solution - that would be great and I would be off the hook.
 :-) but since I volunteered, I'm just saying what I need to understand it
 and try to help you solve it. Send that link and I'll be happy to take a
 look!

 -Mike

 On Mon, Sep 7, 2009 at 2:27 PM, jeanluca lca...@gmail.com wrote:

  suppose you could ask for an array of div's like:

    obj-get_me _all_divs() ; // -- gives an array with div elements

  Or:

       $.ajax({
            type: GET,
            url: 'myxml.xml',
            dataType: 'xml',
            success: function(xml){
                alert( $(body, xml) ) ; // this cannot be done!!
            }
        }) ;

  (In this case xml is een XML object and this doesn't work)

  or

       $.ajax({
            type: GET,
            url: 'myhtml.html',
            dataType: 'html',
            success: function(text){    // 'text' is a string
                alert( $(body, text) ) ; // this doesn't seem to work
  too
            }
        }) ;

  On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
   You need to explain a little more about what you want. If you've created
  an
   object of your own, I don't think it will have div elements in it, will
   it? What *is* in your object, and what do you want to happen when you
   iterate over it? Could you give a complete specific example, with the
  actual
   object that you want to use and the results you're looking for?
   -Mike

   On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

Hi All

I need some help with the following:

Suppose I have the following object

var obj = new XYZ() ;

Now I want to do:

$(div, obj).each(function(){.}) ;

Now, of course, jquery will throw an error because it doesn't know
what to do with 'obj'. So I want to add/extend jquery, so it knows how
to treat 'obj'.  Can this be done ? Is there documentation explaining
how to do this ?

thnx a lot
LuCa


[jQuery] Re: improve/extend the selectors

2009-09-08 Thread jeanluca

I've created a page demonstrating my problem/question (hope it helps!)

http://www.ajaxify.org/jquery/

On Sep 8, 9:49 am, jeanluca lca...@gmail.com wrote:
 :) you're right about the first thing, my mistake!

 ok, lets only focus on the second (I've modified it a little bit!!)

   $.ajax({
            type: GET,
            url: 'myxml.xml',
            dataType: 'xml',
            success: function(xml){
                alert( $(body, xml).html() ) ; // this cannot be
 done!!
                $(body).html( $(h1, xml).html() ) ; // insert it
            }
        }) ;

 suppose the xml file contains something like

 myxml
   body
     h1 hello /h1
   /body
 /myxml

 Is if, for example, possible to add functionality to the $ function ?
 ps for example,http://james.padolsey.com/javascript/regex-selector-for-jquery/
 adds functionality to jquery selectors!
 pps currently I've nothing online, but if it would still help, I'll
 try to get something online as soon as possible!

 Hopefully this makes any sense!
 On Sep 8, 2:31 am, Michael Geary m...@mg.to wrote:

  Whoa, that's three things. (And the first one isn't even JavaScript.)

  Could we get this down to one specific, concrete case that you want to
  solve?

  I'm not very good at solving general problems that handle a lot of
  possibilities, but if there is one specific piece of code that you'd like to
  get working, and there's one particular missing link in it, I'm pretty sure
  I could help you find or code that missing link. But without actual data to
  look at, I don't have a way of testing any possible solution I might come up
  with. That means a link to a test page that shows what you're trying to do.

  Now somebody else may come along who understands the problem better and can
  give you a good solution - that would be great and I would be off the hook.
  :-) but since I volunteered, I'm just saying what I need to understand it
  and try to help you solve it. Send that link and I'll be happy to take a
  look!

  -Mike

  On Mon, Sep 7, 2009 at 2:27 PM, jeanluca lca...@gmail.com wrote:

   suppose you could ask for an array of div's like:

     obj-get_me _all_divs() ; // -- gives an array with div elements

   Or:

        $.ajax({
             type: GET,
             url: 'myxml.xml',
             dataType: 'xml',
             success: function(xml){
                 alert( $(body, xml) ) ; // this cannot be done!!
             }
         }) ;

   (In this case xml is een XML object and this doesn't work)

   or

        $.ajax({
             type: GET,
             url: 'myhtml.html',
             dataType: 'html',
             success: function(text){    // 'text' is a string
                 alert( $(body, text) ) ; // this doesn't seem to work
   too
             }
         }) ;

   On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
You need to explain a little more about what you want. If you've created
   an
object of your own, I don't think it will have div elements in it, 
will
it? What *is* in your object, and what do you want to happen when you
iterate over it? Could you give a complete specific example, with the
   actual
object that you want to use and the results you're looking for?
-Mike

On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

 Hi All

 I need some help with the following:

 Suppose I have the following object

 var obj = new XYZ() ;

 Now I want to do:

 $(div, obj).each(function(){.}) ;

 Now, of course, jquery will throw an error because it doesn't know
 what to do with 'obj'. So I want to add/extend jquery, so it knows how
 to treat 'obj'.  Can this be done ? Is there documentation explaining
 how to do this ?

 thnx a lot
 LuCa


[jQuery] Re: improve/extend the selectors

2009-09-08 Thread jeanluca

I've created a page demonstrating my problem/question (hope it helps!)

http://www.ajaxify.org/jquery/

On Sep 8, 9:49 am, jeanluca lca...@gmail.com wrote:
 :) you're right about the first thing, my mistake!

 ok, lets only focus on the second (I've modified it a little bit!!)

   $.ajax({
            type: GET,
            url: 'myxml.xml',
            dataType: 'xml',
            success: function(xml){
                alert( $(body, xml).html() ) ; // this cannot be
 done!!
                $(body).html( $(h1, xml).html() ) ; // insert it
            }
        }) ;

 suppose the xml file contains something like

 myxml
   body
     h1 hello /h1
   /body
 /myxml

 Is if, for example, possible to add functionality to the $ function ?
 ps for example,http://james.padolsey.com/javascript/regex-selector-for-jquery/
 adds functionality to jquery selectors!
 pps currently I've nothing online, but if it would still help, I'll
 try to get something online as soon as possible!

 Hopefully this makes any sense!
 On Sep 8, 2:31 am, Michael Geary m...@mg.to wrote:

  Whoa, that's three things. (And the first one isn't even JavaScript.)

  Could we get this down to one specific, concrete case that you want to
  solve?

  I'm not very good at solving general problems that handle a lot of
  possibilities, but if there is one specific piece of code that you'd like to
  get working, and there's one particular missing link in it, I'm pretty sure
  I could help you find or code that missing link. But without actual data to
  look at, I don't have a way of testing any possible solution I might come up
  with. That means a link to a test page that shows what you're trying to do.

  Now somebody else may come along who understands the problem better and can
  give you a good solution - that would be great and I would be off the hook.
  :-) but since I volunteered, I'm just saying what I need to understand it
  and try to help you solve it. Send that link and I'll be happy to take a
  look!

  -Mike

  On Mon, Sep 7, 2009 at 2:27 PM, jeanluca lca...@gmail.com wrote:

   suppose you could ask for an array of div's like:

     obj-get_me _all_divs() ; // -- gives an array with div elements

   Or:

        $.ajax({
             type: GET,
             url: 'myxml.xml',
             dataType: 'xml',
             success: function(xml){
                 alert( $(body, xml) ) ; // this cannot be done!!
             }
         }) ;

   (In this case xml is een XML object and this doesn't work)

   or

        $.ajax({
             type: GET,
             url: 'myhtml.html',
             dataType: 'html',
             success: function(text){    // 'text' is a string
                 alert( $(body, text) ) ; // this doesn't seem to work
   too
             }
         }) ;

   On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
You need to explain a little more about what you want. If you've created
   an
object of your own, I don't think it will have div elements in it, 
will
it? What *is* in your object, and what do you want to happen when you
iterate over it? Could you give a complete specific example, with the
   actual
object that you want to use and the results you're looking for?
-Mike

On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

 Hi All

 I need some help with the following:

 Suppose I have the following object

 var obj = new XYZ() ;

 Now I want to do:

 $(div, obj).each(function(){.}) ;

 Now, of course, jquery will throw an error because it doesn't know
 what to do with 'obj'. So I want to add/extend jquery, so it knows how
 to treat 'obj'.  Can this be done ? Is there documentation explaining
 how to do this ?

 thnx a lot
 LuCa


[jQuery] Re: improve/extend the selectors

2009-09-08 Thread jeanluca

I've created a page demonstrating my problem/question (hope it helps!)

http://www.ajaxify.org/jquery/

On Sep 8, 9:49 am, jeanluca lca...@gmail.com wrote:
 :) you're right about the first thing, my mistake!

 ok, lets only focus on the second (I've modified it a little bit!!)

   $.ajax({
            type: GET,
            url: 'myxml.xml',
            dataType: 'xml',
            success: function(xml){
                alert( $(body, xml).html() ) ; // this cannot be
 done!!
                $(body).html( $(h1, xml).html() ) ; // insert it
            }
        }) ;

 suppose the xml file contains something like

 myxml
   body
     h1 hello /h1
   /body
 /myxml

 Is if, for example, possible to add functionality to the $ function ?
 ps for example,http://james.padolsey.com/javascript/regex-selector-for-jquery/
 adds functionality to jquery selectors!
 pps currently I've nothing online, but if it would still help, I'll
 try to get something online as soon as possible!

 Hopefully this makes any sense!
 On Sep 8, 2:31 am, Michael Geary m...@mg.to wrote:

  Whoa, that's three things. (And the first one isn't even JavaScript.)

  Could we get this down to one specific, concrete case that you want to
  solve?

  I'm not very good at solving general problems that handle a lot of
  possibilities, but if there is one specific piece of code that you'd like to
  get working, and there's one particular missing link in it, I'm pretty sure
  I could help you find or code that missing link. But without actual data to
  look at, I don't have a way of testing any possible solution I might come up
  with. That means a link to a test page that shows what you're trying to do.

  Now somebody else may come along who understands the problem better and can
  give you a good solution - that would be great and I would be off the hook.
  :-) but since I volunteered, I'm just saying what I need to understand it
  and try to help you solve it. Send that link and I'll be happy to take a
  look!

  -Mike

  On Mon, Sep 7, 2009 at 2:27 PM, jeanluca lca...@gmail.com wrote:

   suppose you could ask for an array of div's like:

     obj-get_me _all_divs() ; // -- gives an array with div elements

   Or:

        $.ajax({
             type: GET,
             url: 'myxml.xml',
             dataType: 'xml',
             success: function(xml){
                 alert( $(body, xml) ) ; // this cannot be done!!
             }
         }) ;

   (In this case xml is een XML object and this doesn't work)

   or

        $.ajax({
             type: GET,
             url: 'myhtml.html',
             dataType: 'html',
             success: function(text){    // 'text' is a string
                 alert( $(body, text) ) ; // this doesn't seem to work
   too
             }
         }) ;

   On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
You need to explain a little more about what you want. If you've created
   an
object of your own, I don't think it will have div elements in it, 
will
it? What *is* in your object, and what do you want to happen when you
iterate over it? Could you give a complete specific example, with the
   actual
object that you want to use and the results you're looking for?
-Mike

On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

 Hi All

 I need some help with the following:

 Suppose I have the following object

 var obj = new XYZ() ;

 Now I want to do:

 $(div, obj).each(function(){.}) ;

 Now, of course, jquery will throw an error because it doesn't know
 what to do with 'obj'. So I want to add/extend jquery, so it knows how
 to treat 'obj'.  Can this be done ? Is there documentation explaining
 how to do this ?

 thnx a lot
 LuCa


[jQuery] Re: improve/extend the selectors

2009-09-08 Thread jeanluca

I've created a page demonstrating my problem/question (hope it helps!)

http://www.ajaxify.org/jquery/

On Sep 8, 9:49 am, jeanluca lca...@gmail.com wrote:
 :) you're right about the first thing, my mistake!

 ok, lets only focus on the second (I've modified it a little bit!!)

   $.ajax({
            type: GET,
            url: 'myxml.xml',
            dataType: 'xml',
            success: function(xml){
                alert( $(body, xml).html() ) ; // this cannot be
 done!!
                $(body).html( $(h1, xml).html() ) ; // insert it
            }
        }) ;

 suppose the xml file contains something like

 myxml
   body
     h1 hello /h1
   /body
 /myxml

 Is if, for example, possible to add functionality to the $ function ?
 ps for example,http://james.padolsey.com/javascript/regex-selector-for-jquery/
 adds functionality to jquery selectors!
 pps currently I've nothing online, but if it would still help, I'll
 try to get something online as soon as possible!

 Hopefully this makes any sense!
 On Sep 8, 2:31 am, Michael Geary m...@mg.to wrote:

  Whoa, that's three things. (And the first one isn't even JavaScript.)

  Could we get this down to one specific, concrete case that you want to
  solve?

  I'm not very good at solving general problems that handle a lot of
  possibilities, but if there is one specific piece of code that you'd like to
  get working, and there's one particular missing link in it, I'm pretty sure
  I could help you find or code that missing link. But without actual data to
  look at, I don't have a way of testing any possible solution I might come up
  with. That means a link to a test page that shows what you're trying to do.

  Now somebody else may come along who understands the problem better and can
  give you a good solution - that would be great and I would be off the hook.
  :-) but since I volunteered, I'm just saying what I need to understand it
  and try to help you solve it. Send that link and I'll be happy to take a
  look!

  -Mike

  On Mon, Sep 7, 2009 at 2:27 PM, jeanluca lca...@gmail.com wrote:

   suppose you could ask for an array of div's like:

     obj-get_me _all_divs() ; // -- gives an array with div elements

   Or:

        $.ajax({
             type: GET,
             url: 'myxml.xml',
             dataType: 'xml',
             success: function(xml){
                 alert( $(body, xml) ) ; // this cannot be done!!
             }
         }) ;

   (In this case xml is een XML object and this doesn't work)

   or

        $.ajax({
             type: GET,
             url: 'myhtml.html',
             dataType: 'html',
             success: function(text){    // 'text' is a string
                 alert( $(body, text) ) ; // this doesn't seem to work
   too
             }
         }) ;

   On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
You need to explain a little more about what you want. If you've created
   an
object of your own, I don't think it will have div elements in it, 
will
it? What *is* in your object, and what do you want to happen when you
iterate over it? Could you give a complete specific example, with the
   actual
object that you want to use and the results you're looking for?
-Mike

On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

 Hi All

 I need some help with the following:

 Suppose I have the following object

 var obj = new XYZ() ;

 Now I want to do:

 $(div, obj).each(function(){.}) ;

 Now, of course, jquery will throw an error because it doesn't know
 what to do with 'obj'. So I want to add/extend jquery, so it knows how
 to treat 'obj'.  Can this be done ? Is there documentation explaining
 how to do this ?

 thnx a lot
 LuCa


[jQuery] improve/extend the selectors

2009-09-07 Thread jeanluca

Hi All

I need some help with the following:

Suppose I have the following object

var obj = new XYZ() ;

Now I want to do:

$(div, obj).each(function(){.}) ;

Now, of course, jquery will throw an error because it doesn't know
what to do with 'obj'. So I want to add/extend jquery, so it knows how
to treat 'obj'.  Can this be done ? Is there documentation explaining
how to do this ?

thnx a lot
LuCa


[jQuery] Re: improve/extend the selectors

2009-09-07 Thread jeanluca

suppose you could ask for an array of div's like:

   obj-get_me _all_divs() ; // -- gives an array with div elements

Or:

  $.ajax({
   type: GET,
   url: 'myxml.xml',
   dataType: 'xml',
   success: function(xml){
   alert( $(body, xml) ) ; // this cannot be done!!
   }
   }) ;

(In this case xml is een XML object and this doesn't work)

or

  $.ajax({
   type: GET,
   url: 'myhtml.html',
   dataType: 'html',
   success: function(text){// 'text' is a string
   alert( $(body, text) ) ; // this doesn't seem to work
too
   }
   }) ;


On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
 You need to explain a little more about what you want. If you've created an
 object of your own, I don't think it will have div elements in it, will
 it? What *is* in your object, and what do you want to happen when you
 iterate over it? Could you give a complete specific example, with the actual
 object that you want to use and the results you're looking for?
 -Mike

 On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

  Hi All

  I need some help with the following:

  Suppose I have the following object

  var obj = new XYZ() ;

  Now I want to do:

  $(div, obj).each(function(){.}) ;

  Now, of course, jquery will throw an error because it doesn't know
  what to do with 'obj'. So I want to add/extend jquery, so it knows how
  to treat 'obj'.  Can this be done ? Is there documentation explaining
  how to do this ?

  thnx a lot
  LuCa


[jQuery] Re: improve/extend the selectors

2009-09-07 Thread jeanluca

suppose you could ask for an array of div's like:

   obj-get_me _all_divs() ; // -- gives an array with div elements

Or:

  $.ajax({
   type: GET,
   url: 'myxml.xml',
   dataType: 'xml',
   success: function(xml){
   alert( $(body, xml) ) ; // this cannot be done!!
   }
   }) ;

(In this case xml is een XML object and this doesn't work)

or

  $.ajax({
   type: GET,
   url: 'myhtml.html',
   dataType: 'html',
   success: function(text){// 'text' is a string
   alert( $(body, text) ) ; // this doesn't seem to work
too
   }
   }) ;


On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
 You need to explain a little more about what you want. If you've created an
 object of your own, I don't think it will have div elements in it, will
 it? What *is* in your object, and what do you want to happen when you
 iterate over it? Could you give a complete specific example, with the actual
 object that you want to use and the results you're looking for?
 -Mike

 On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

  Hi All

  I need some help with the following:

  Suppose I have the following object

  var obj = new XYZ() ;

  Now I want to do:

  $(div, obj).each(function(){.}) ;

  Now, of course, jquery will throw an error because it doesn't know
  what to do with 'obj'. So I want to add/extend jquery, so it knows how
  to treat 'obj'.  Can this be done ? Is there documentation explaining
  how to do this ?

  thnx a lot
  LuCa


[jQuery] AJAX: process the response XML

2009-08-28 Thread jeanluca

Hi All

I'm truggling with this for a while now, without succes. Here is the
test code:

$.ajax({
  type: GET,
  url: url,
  cache: false,
  dataType: 'xml',
  async: true,
  complete: function(data, status) {
  // get title name of the book element with id  'xyz'
  }
}) ;

suppose the xml send from the server is

?xml version=1.0 encoding=UTF-8?
books
  book id='abc'
   titleSome Title/title
  /book
  book id='xyz'
titleOther title/title
  /book
/books

So my question is: How do I get the title from the book element with
id 'xyz'
I've tried to parse data.responseXML or something like

var d = $(data) ;
d.find('#xyz').each(function() { ... }) ;

It would be great if I could do something like:

alert(TITLE IS  + $(#xyz, data.responseXML).text() );

Any suggestions ?
or maybe these a plugin that can help?

thnx a lot


[jQuery] How to create XML

2009-08-20 Thread jeanluca

Hi All

I need to create XML, for example, this is (simplified) what I have to
do:

  var x = jQuery.makeXML('myXMLversion8.1/version/myXML) ; //
this line is my problem!!
  console.log(Version = %s, $('version', x).text() ) ;

Is this possible and what is the best way to do this ?

cheers


[jQuery] fxqueues with afterFinish ?

2009-08-02 Thread jeanluca

Hi All

I've beem using prototype and scriptaculous and want to swith to
jQuery. The thing is that scriptaculous has a very nice queuing
mechanism. I think most of it can also be done by fxqueues, however I
don't see how to call a function when a certain effect finishes. Can
this be done ? and is fxqueues the best choice ?

Scriptaculous does something like:


new Effect.Parallel(effect[i], { queue: 'end', duration: duration[i],
afterFinish:callback} )
...

thnx
LuCa

ps fxqueues: http://www.decodeuri.com/jquery-fxqueues-plugin-20/


[jQuery] Re: extend an Object

2009-07-23 Thread jeanluca

thats exactly it!!
What is exactly '$'  ? its not the same as 'jQuery'. Do you have a
link to a doc ?

thnx a lot!

On Jul 23, 2:23 am, Jules jwira...@gmail.com wrote:
 Something like this?

     function person(name, address) {
         this.name = name;
         this.address = address;
         this.whoAmI = function() {
             if (this.creditLimit)
                 alert(this.name + ' address:' + this.address + 'credit
 limit:' + this.creditLimit);
             else
                 alert(this.name + ' address:' + this.address);

         }
         return this;
     }

     function customer() {
         this.creditLimit = 0;
         this.creditCheck = creditCheck;
         return this;

         function creditCheck() {
             alert(this.creditLimit);
         }
     }

     var a = new person('john smith', '10 main st');
     var cust = new customer();
     a.whoAmI();

     $.extend(a, cust);
     a.creditLimit = 1000;
     a.whoAmI();

 On Jul 22, 10:02 pm, jeanluca lca...@gmail.com wrote:

  Hi All

  I tried to add functions to an object like

       function User(n, a) {
           this.name = n ;
          this.aux = a ;
       }
       function auxis() {
         alert(this.aux);
       }

         $(document).ready( function() {
           var u = new User(Jack) ;
           u.extend({
               whoami: function() { alert(this.name); },
              autis: auxis
           }) ;
           u.whoami() ;

  }) ;

  Eventually I will have 2 object A and B and I want to merge A into B:

      B.exend(A) ;

  However it doesn't work at all. Any suggestions how to fix this ?


[jQuery] Re: extend an Object

2009-07-23 Thread jeanluca

I just noticed that $ and the jQuery object are the same thing!!


On Jul 23, 10:27 am, jeanluca lca...@gmail.com wrote:
 thats exactly it!!
 What is exactly '$'  ? its not the same as 'jQuery'. Do you have a
 link to a doc ?

 thnx a lot!

 On Jul 23, 2:23 am, Jules jwira...@gmail.com wrote:

  Something like this?

      function person(name, address) {
          this.name = name;
          this.address = address;
          this.whoAmI = function() {
              if (this.creditLimit)
                  alert(this.name + ' address:' + this.address + 'credit
  limit:' + this.creditLimit);
              else
                  alert(this.name + ' address:' + this.address);

          }
          return this;
      }

      function customer() {
          this.creditLimit = 0;
          this.creditCheck = creditCheck;
          return this;

          function creditCheck() {
              alert(this.creditLimit);
          }
      }

      var a = new person('john smith', '10 main st');
      var cust = new customer();
      a.whoAmI();

      $.extend(a, cust);
      a.creditLimit = 1000;
      a.whoAmI();

  On Jul 22, 10:02 pm, jeanluca lca...@gmail.com wrote:

   Hi All

   I tried to add functions to an object like

        function User(n, a) {
            this.name = n ;
           this.aux = a ;
        }
        function auxis() {
          alert(this.aux);
        }

          $(document).ready( function() {
            var u = new User(Jack) ;
            u.extend({
                whoami: function() { alert(this.name); },
               autis: auxis
            }) ;
            u.whoami() ;

   }) ;

   Eventually I will have 2 object A and B and I want to merge A into B:

       B.exend(A) ;

   However it doesn't work at all. Any suggestions how to fix this ?


[jQuery] Re: extend an Object

2009-07-23 Thread jeanluca

I just noticed that $ and the jQuery object are the same thing!!


On Jul 23, 10:27 am, jeanluca lca...@gmail.com wrote:
 thats exactly it!!
 What is exactly '$'  ? its not the same as 'jQuery'. Do you have a
 link to a doc ?

 thnx a lot!

 On Jul 23, 2:23 am, Jules jwira...@gmail.com wrote:

  Something like this?

      function person(name, address) {
          this.name = name;
          this.address = address;
          this.whoAmI = function() {
              if (this.creditLimit)
                  alert(this.name + ' address:' + this.address + 'credit
  limit:' + this.creditLimit);
              else
                  alert(this.name + ' address:' + this.address);

          }
          return this;
      }

      function customer() {
          this.creditLimit = 0;
          this.creditCheck = creditCheck;
          return this;

          function creditCheck() {
              alert(this.creditLimit);
          }
      }

      var a = new person('john smith', '10 main st');
      var cust = new customer();
      a.whoAmI();

      $.extend(a, cust);
      a.creditLimit = 1000;
      a.whoAmI();

  On Jul 22, 10:02 pm, jeanluca lca...@gmail.com wrote:

   Hi All

   I tried to add functions to an object like

        function User(n, a) {
            this.name = n ;
           this.aux = a ;
        }
        function auxis() {
          alert(this.aux);
        }

          $(document).ready( function() {
            var u = new User(Jack) ;
            u.extend({
                whoami: function() { alert(this.name); },
               autis: auxis
            }) ;
            u.whoami() ;

   }) ;

   Eventually I will have 2 object A and B and I want to merge A into B:

       B.exend(A) ;

   However it doesn't work at all. Any suggestions how to fix this ?


[jQuery] extend an Object

2009-07-22 Thread jeanluca

Hi All

I tried to add functions to an object like

 function User(n, a) {
 this.name = n ;
this.aux = a ;
 }
 function auxis() {
   alert(this.aux);
 }

   $(document).ready( function() {
 var u = new User(Jack) ;
 u.extend({
 whoami: function() { alert(this.name); },
autis: auxis
 }) ;
 u.whoami() ;
}) ;

Eventually I will have 2 object A and B and I want to merge A into B:

B.exend(A) ;

However it doesn't work at all. Any suggestions how to fix this ?


[jQuery] Re: $(document).unload() does not fire.

2009-07-16 Thread jeanluca

did you  try $(window).unload( function(){  }) ;  ?

On Jul 16, 9:04 am, Nitin nitins.shu...@gmail.com wrote:
 Hello,

 I am extensively using jquery.ajax calls to display data on my web
 page (which build using partial rendering). In certain navigation flow
 a user move from one page to another. Before he moves I need to
 capture information filled in by user in first page(form) and save it
 in java script variable. Since my complete page is built using partial
 rendering the first form gets unloaded and new form gets loaded making
 ajax call.

 In order to capture the data user has filled in first form I have
 tried to use $(document).unload, $.unload(), $(#form_id).unload()
 (form_id is the id of the form in the page) to update the java script
 variable with user's input for form1. But neither scenario my call
 back function gets fired.

 I am not sure if I unload will be corrent event to add callback
 function to update user input.

 Any pointers and help on how to make my callback function fire will be
 appreciated.

 Thanks n Regards,
 Nitin


[jQuery] how to get the response header of an ajax request

2009-07-16 Thread jeanluca

Hello

I want to access the headers of pages I load through ajax. However I
don't know how to do this with jQuery

First of all, I'm only interested in the headers, not its content, so

$('#someID').load(somefile.html) ;

is not really what I want.

Is there a way I can get the XMLHttpRequest object so I can do

xmlDoc.getAllResponseHeaders()

Thnx in advance


[jQuery] Re: how to get the response header of an ajax request

2009-07-16 Thread jeanluca

$.ajax({
  type: GET,
  url: my_url,
  async: false
}).getAllResponseHeaders() ;

On Jul 16, 11:31 am, jeanluca lca...@gmail.com wrote:
 Hello

 I want to access the headers of pages I load through ajax. However I
 don't know how to do this with jQuery

 First of all, I'm only interested in the headers, not its content, so

 $('#someID').load(somefile.html) ;

 is not really what I want.

 Is there a way I can get the XMLHttpRequest object so I can do

 xmlDoc.getAllResponseHeaders()

 Thnx in advance