I am trying to change the contents of a div using jquery in Tizen. When I am using .html(htmlString) it is having no effect, whereas if I use .text() the contents are replaced, but HTML is not parsed, as is the behaviour of .text(). Can someone please suggest a workaround/a point where I am missing , so that .html(htmlString) works correctly in Tizen web simulator.
The code is:
<script language="javascript">
function a()
{
var w='<b>'+
restaurantName+
"</b> "+
'<span class="badge">'+
userRating+
"</span>"+
"<br/>"+
address.replace("_","<br/>")+
"<br/>"+
"<b>Food for 2</b>"+
"<br/>"+
price+
"₹"+
'<div id="map_canvas">'+
'</div>';
sessionStorage.setItem("docHTML",w);
location.assign('restaurant.html');
}
</script>
function b() which is called on onload() event of restaurant.html
<script language="javascript">
function b()
{
var contentToSet=sessionStorage.getItem("docHTML");
$("#detailDiv").text(contentToSet);
sessionStorage.removeItem("docHTML");
}
</script>
In both of the pages, jquery is loaded correctly.
Thanks
Found out that
sessionStoragewas not carrying data to another page/tab. So changedto
localStorage.setItem("docHTML",w);infunction a()and infunction b()retrieved the same withThanks a lot everyone.