Skip to main content
Copy edited.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Extracting ajaxAjax return data in JQueryjQuery

I have done jQuery and Ajax  , but I am not able to get the response into a Div element. This This is the code:

Index.html

 $.ajax({   type:"POST",   url: "ajax.php",   data:"id="+id ,   success: function(html){   $("#response").html(data);   }  });  

It is receiving the response to my <div id="response"></div>.

The ajax.phpajax.php returns following code to the index.htmlindex.html file:

<div id ="one">OneVal="one"> OneVal </div> <div id ="sub"> SubVal </div>  

Will I able to extract the OneVal and Subval into a variable, and how can I extract the OneVal"OneVal" and SubVal"SubVal", instead of above response?

Extracting ajax return data in JQuery

I have done jQuery and Ajax  , but I am not able to get the response into a Div element. This is the code:

Index.html

 $.ajax({   type:"POST",   url: "ajax.php",   data:"id="+id ,   success: function(html){   $("#response").html(data);   }  });  

It is receiving the response to my <div id="response"></div>.

The ajax.php returns following code to the index.html

<div id ="one">OneVal </div> <div id ="sub"> SubVal </div>  

Will I able to extract the OneVal and Subval into a variable, and how can I extract the OneVal and SubVal, instead of above response?

Extracting Ajax return data in jQuery

I have done jQuery and Ajax, but I am not able to get the response into a Div element. This is the code:

Index.html

$.ajax({ type:"POST", url: "ajax.php", data:"id="+id , success: function(html){ $("#response").html(data); } }); 

It is receiving the response to my <div id="response"></div>.

The ajax.php returns following code to the index.html file:

<div id ="one"> OneVal </div> <div id ="sub"> SubVal </div> 

Will I able to extract the OneVal and Subval into a variable, and how can I extract "OneVal" and "SubVal", instead of above response?

Restructed almost the whole question
Source Link
Andreas Grech
  • 108.4k
  • 102
  • 303
  • 362

I have done JQueryjQuery and ajaxAjax , Here MY Probem,but I am not able to get Response Onthe response into a Div element. here myThis is the code Index.html:

Index.html

 $.ajax({ type:"POST", url: "ajax.php", data:"id="+id , success: function(html){ $("#response").html(data); } }); It able to Receive the Response to My <div id="response"></div>.  The ajax.php returns following code to Index.html   

It is receiving the response to my <div id="response"></div>.

The ajax.php returns following code to the index.html

<div id ="one">OneVal </div>  <div id ="sub"> SubVal </div> 

Will I able to extract the OneVal and Subval into Jquery Variable, How to Extract the OneVal and SubVal ,Instead of Above Response,Any one Help me.

Will I able to extract the OneVal and Subval into a variable, and how can I extract the OneVal and SubVal, instead of above response?

I have done JQuery and ajax , Here MY Probem, I able to get Response On Div element. here my code Index.html

 $.ajax({ type:"POST", url: "ajax.php", data:"id="+id , success: function(html){ $("#response").html(data); } }); It able to Receive the Response to My <div id="response"></div>.  The ajax.php returns following code to Index.html   <div id ="one">OneVal </div>  <div id ="sub"> SubVal </div> 

Will I able to extract the OneVal and Subval into Jquery Variable, How to Extract the OneVal and SubVal ,Instead of Above Response,Any one Help me.

I have done jQuery and Ajax , but I am not able to get the response into a Div element. This is the code:

Index.html

 $.ajax({ type:"POST", url: "ajax.php", data:"id="+id , success: function(html){ $("#response").html(data); } }); 

It is receiving the response to my <div id="response"></div>.

The ajax.php returns following code to the index.html

<div id ="one">OneVal </div> <div id ="sub"> SubVal </div> 

Will I able to extract the OneVal and Subval into a variable, and how can I extract the OneVal and SubVal, instead of above response?

Source Link
venkatachalam
  • 102.4k
  • 31
  • 74
  • 77

Extracting ajax return data in JQuery

I have done JQuery and ajax , Here MY Probem, I able to get Response On Div element. here my code Index.html

 $.ajax({ type:"POST", url: "ajax.php", data:"id="+id , success: function(html){ $("#response").html(data); } }); It able to Receive the Response to My <div id="response"></div>. The ajax.php returns following code to Index.html <div id ="one">OneVal </div> <div id ="sub"> SubVal </div> 

Will I able to extract the OneVal and Subval into Jquery Variable, How to Extract the OneVal and SubVal ,Instead of Above Response,Any one Help me.