Hi,
I am trying to display product images in the product jump form in the keyword search box of the catalog application. Currently, it displays only the product name, brand name and the product Id. I was trying to display the product image as well.
While I could get the image from the database and construct the image URL, the html returned by the jQuery escapes the image tags and displays the URL instead of displaying the image. For eg. after getting the image filepath i added the below code in the jQurey to append the image tag to form the image URL,
item.label = "<img src=\"" + item.value + "\">";
The code in the browser instead of showing the image, shows the URL as:
And when i check the code in google chrome developer tools, the html generated is displayed as below:
The tags "<" and ">" are being replaced by &alt; and > which causes the image URL to be displayed instead of the image itself. If i replace the &alt; and > tags in the debugger with "<" and ">" respectively, the image gets in the ajax request properly.
I will really appreciate if someone can help me prevent the tags "<" and ">" being replaced.
Thanks,
Rohit