I'm trying to display an image on the page, I'm using javascript to write out the image tag with the source pulled from the data source. When debugging, the value that is being passed is:
<img align='Left' style='width:100px;' alt='sample alt text.' src='http://www.website.com/IMAGE-05185619.jpg>.
But what is in the page is:
<img align='Left' style='width:100px;' alt='sample alt text.' src='http://www.website.com/IMAGE-05185619.jpg>
So when viewing the page, I see the img tag instead of the image.
My code:
<span data-bind="text: myImgFunc"></span>
var model = JSON.parse($('#cg-jsonall').text());
var viewModel = kendo.observable({
model: model,
myImgFunc: function() {
if (this.get('model.org.org_logo'))
{
var img = "<img align='Left' style='width:100px;' alt='" + this.get('model.org.name') + ".' src='http://reach.hillel.org/cache/upload/" + this.get('model.university.univ_picture') + ">";
return img;
}};
kendo.bind($("span"), viewModel);
Any suggestions?
Thanks.
<img align='Left' style='width:100px;' alt='sample alt text.' src='http://www.website.com/IMAGE-05185619.jpg>.
But what is in the page is:
<img align='Left' style='width:100px;' alt='sample alt text.' src='http://www.website.com/IMAGE-05185619.jpg>
So when viewing the page, I see the img tag instead of the image.
My code:
<span data-bind="text: myImgFunc"></span>
var model = JSON.parse($('#cg-jsonall').text());
var viewModel = kendo.observable({
model: model,
myImgFunc: function() {
if (this.get('model.org.org_logo'))
{
var img = "<img align='Left' style='width:100px;' alt='" + this.get('model.org.name') + ".' src='http://reach.hillel.org/cache/upload/" + this.get('model.university.univ_picture') + ">";
return img;
}};
kendo.bind($("span"), viewModel);
Any suggestions?
Thanks.