Passing a table object to AJAX may be not the best idea :)
You should normally mass data to the server, not data+presentation.

Passing anything to $.ajax is just setting additional option in the data
opbect parameter:
$.ajax({
data:{
   var1:'val1',
   table:$('#table') //<--- here it goes
  }
url:'your/script.php',
......
}
);

Best regards,
Konstantin Mirin
 
mailto:konstantin.mi...@gmail.com
mailto:i...@konstantin.takeforce.net


> -----Original Message-----
> From: jquery-en@googlegroups.com 
> [mailto:jquery...@googlegroups.com] On Behalf Of jQuery Lover
> Sent: Saturday, February 07, 2009 9:14 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Several questions regarding jQuery Approach...
> 
> 
> 
> 1. you can acces them like this $('tr td', this).each(...); 
> Also see here for custom plugins and functions: 
> http://jquery-howto.blogspot.com/search/label/plugin
> 
> 2. when you use $('table') you'll get a selection of all 
> tables. If you do this you would get the same object instance:
> 
> var $table = $('table');
> $table.table();
> $table.TableSetTitles({col1:"test", col3: "test3", col5: "notexist"});
> 
> 3. if a function takes an argument pass it a $table as 
> parameter ... (give us a concrete example, and we could give 
> a proper answer to this
> question...)
> 
> ----
> Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com
> 
> 
> 
> On Sat, Feb 7, 2009 at 10:22 AM, ShurikAg <shuri...@gmail.com> wrote:
> >
> > Hi,
> >
> > 1.
> > Assume that there is a table on a page:
> > <table>
> >  <tr>
> >        <td></td>
> >        <td></td>
> >  </tr>
> > </table>
> >
> > and I'm using jQuery to manipulate this table by: 
> $("table").table();
> >
> > What is the right way of accessing "td" elements inside the 
> function:
> > (function(jQ) {
> >   jQ.fn.table = function(options, titles, data){
> >   ...
> >   ...
> >   }
> > })(jQuery);
> >
> > 2.
> > When I'm accessing the same table outside of plugin, like this:
> >                $("table").table();
> >                $("table").TableSetTitles({col1:"test", 
> col3: "test3", 
> > col5: "not exist"}); Do I actually accessing the same 
> object instance? 
> > If not, what is the right way of doing it?
> >
> > 3.
> > If I need to use additional jQuery object (.ajax for instance) by 
> > passing the table object to it; what is the right way of doing it?
> >
> > Thank you in advance.

Reply via email to