tags:

views:

18

answers:

1

Hi,

I am using AJAX to return a response which includes a script.

Through that script, how can I determine the ID of the parent element the script is running in without passing id's to the server? Is there a way?

Thanks.

A: 

If you assign an ID to the script (which will explode in ancient browsers), you can try:

var id = $("#idOfTheScript").parent()[0].id;
karim79
Awesome - thank you!
KcYxA