ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohit <rohitksur...@yahoo.com>
Subject Unable to display images in ajax product jump form.
Date Tue, 27 Dec 2011 03:55:09 GMT

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

item.label = "<img src=\&quot;&quot; + item.value + &quot;\&quot;>";

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:
&lt;img src="http://ofbiz.apache.org/images/ofbiz_logo.gif"&gt; 

The tags "<" and ">" are being replaced by &alt; and &gt; which causes the
image URL to be displayed instead of the image itself. If i replace the
&alt; and &gt; 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.



View this message in context: http://ofbiz.135035.n4.nabble.com/Unable-to-display-images-in-ajax-product-jump-form-tp4236275p4236275.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

View raw message