Good Evening,
I have been hunting around for a solution to my problem and I cant find one anywhere!
(So if its out there and I have missed it, I am very sorry for wasting any ones time with this post.)
I have an Ajax call (shown below) that calls a php page to return some data pre-formatted into html. The call works fine and the data is returned into the value 'html', I know this (I think) because if I change Line 11 to Alert out the Data I can see it.
My problem is I would like to change the success portion of the Ajax call to point to a dynamic element id of my choosing (As this changes each time its called, and I don't know what it will be). Thus inserting the result into a dynamically assigned location.
As you may have guessed I cant get this to work.
Is this possible, can someone help me get this working. I can provide more code if it helps, but i am hopeful this is enough.
Many Thanks
J
- $('#cat_select_div').on('click', 'li', function(){
- var id = '.' + this.id;
- var row_value = $(this).attr('value');
- $.ajax({
- type: 'GET',
- url: 'ajax_product_select2.php',
- data: 'Level=' + row_value,
- success: function(html){
- $(id).html(html);
- }
- })