View Full Version : AJAX returning HTML as part of response text

22 Feb 2012, 10:52 AM
I recently noticed that my response text includes a blank page. The string that I get is:

<html><body></body></html>response text attached here

As a result my first array element has the "<html><body></body></html>" attached to it.

Is there a way to easily get rid of the HTML tags?


For those who would like to see the actual page/problem:

response text:

http://www.troutsalmonchar.com/Tables/combo_List_Flies.php?sp=TR&tp=wet (view page source)

The page where this info is used:

After a choice is made in the first two drop down menus, the third menu is populated with the elements from the response text in the php file above. Since the HTML tags are attached to the first element in the drop down menu, my first options do not work properly.

I have currently set up alerts to show up the response text on the page.

22 Feb 2012, 11:09 AM
OK, I found a solution. I used a function removing the HTML tags from a string.

But why was I getting HTML tags in the response text?