- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used "document.location.hash" to pass parameter to dynamic created panels and it works fine in release 1995 (both in emulator and my Android pad Intel App Preview). However, I noticed that the value of "document.location.hash" in the emulator became empty and caused my code not working correctly after upgrade to release 2170. But the same code still works well when I used "Intel App Preview" in my Android pad to run the program. Is the emulator cancel the support of "document.location.hash" or something wrong with it? Thank you!
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There was an issue in node webkit with setting relative location using document.location.href a while back. That was fixed a long time ago. Recently we have updated nw, I'm not sure if what you are seeing is a side effect of that. Can you describe your issue little more? What you mean by value of "document.location.hash" in the emulator became empty?
Can you post the snippet of the code that's having issue? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the prompt reply. Here are my code to use document.location.hash value: Actually, not only hash used in my code are empty (see line 5 in the image), all the hashes are empty string now. Thank you!
for (var i=0; i<venderArray.length; i++) {
var liHtml = '<li><a href="#'+venderArray._id+'/'+venderArray.username+'">';
liHtml += '<div id="'+venderArray.username+'" class="list-text">';
liHtml += '</a></li>';
$(".list").append(liHtml);
var panel_html = '<p>'+venderArray.nickname+'</p>';
panel_html += '<p>'+venderArray.address+'</p>';
panel_html += '<p>'+venderArray.tel+'</p>';
panel_html += '<ul class="list" id="menu_of_vender_list"> </ul>';
$.ui.addContentDiv(venderArray._id, panel_html, "Vender Detail");
$("#"+venderArray._id).unbind("loadpanel");
$("#"+venderArray._id).bind("loadpanel",function(evt){
var url=document.location.hash.replace("#"+evt.target.id+"/","");
var params=url.split("/");
var tmpString = params.toString();
getMenuItem(tmpString);
});
}
The snapshot in the debug window:

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page