[jQuery] binding event handlers to the new rows

2009-04-17 Thread mohan prasad

hello,

i have written two event handlers one on click of anchor tag class
(edit_item), another on click of row column class(show_subitems) as
mentioned below.
For the first time page load, its working perfectly(i am providing
event handler code inside jquery(document).ready)
So event handler is getting registered perfectly for the initial page
load

During event handling on the row column of table class outer_tab,  i
will make an ajax call and receive response data as table(lets suppose
this table is having class 'inner_tab').

i am creating a new row below the current row(as all the items in
response data table are subitems of the current row item) and keeping
the response data table in the new row column by providing proper
colspan for the td element of new row.

in the response data table also there are anchor tag with the same
class as similar to the outer_tab anchor tag class.
I want to bind the same event on the response data table anchor tag
also.

could anybody let me know how to achieve it?

table class=main_tab
thead
thfirst/th
thsecond/th
/thead
tr
td class=show_subitemsfirst cell/td
tda class=del_itemdelete/a/td
/tr
/table


// javascript code
$(function(){

$('.show_subitems').live('click', function(e) {
  var target = e.target;
  var my_tr = $(target.parentNode);
  //here ajax call should be made to get data from server, just
for testing hardcoded with dummy data
  var dummy_table = table class=\inner_tab\theadthsub
first/ththsub second/th/theadtbodytrtdsub col first/
tdtda class=\edit_item\sub col second/a/td/tr/tbody/
table;
  my_tr.after(tr id=\newrow\td colspan=2 + dummy_table +
/td/tr);
});

});

$('.edit_item').click( function(e){
 var target = e.target;
 $.get($(this).attr('href'));
 return false;
});

Best Regards,
Mohan


[jQuery] how to display ads after page load

2008-12-22 Thread mohan

Hi,
In my application, I have some ads which are from other sites.
They gave us the Javascript to display their ads. Its taking time to
load the entire page, because of their ads.
So I am trying to load their script after loading the page.
How can i do this?
Can anyone help me.

Thanks,
Mohan


[jQuery] how to get onchange select id

2008-11-20 Thread mohan

Hi,

in my web page, i have 4 dropdowns
When onchange event occurs, i want to know that dropdown id.
How can i get that usng jquery.
Help me.

Thanks,
Mohan


[jQuery] Re: how to get onchange select id

2008-11-20 Thread mohan

Hi,
I tried this
--
alert(this.id);
--
but it is not showing any id. Nothing is displaying in alert.
and again i tried
alert(alert = +$(this.id));
Alert showing [object object]

Anything missed??

On Nov 21, 5:12 am, Dave Methvin [EMAIL PROTECTED] wrote:
 So you are attaching a single onchange event to all of them? Something
 like this should work:

 $(select).change(function(){
   alert(this.id);



 });- Hide quoted text -

 - Show quoted text -


[jQuery] Re: how to get onchange select id

2008-11-20 Thread mohan

Sorry, its working. i forgotten to close the braces.

On Nov 21, 9:11 am, mohan [EMAIL PROTECTED] wrote:
 Hi,
 I tried this
 --
 alert(this.id);
 --
 but it is not showing any id. Nothing is displaying in alert.
 and again i tried
 alert(alert = +$(this.id));
 Alert showing [object object]

 Anything missed??

 On Nov 21, 5:12 am, Dave Methvin [EMAIL PROTECTED] wrote:



  So you are attaching a single onchange event to all of them? Something
  like this should work:

  $(select).change(function(){
    alert(this.id);

  });- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -