Created
May 17, 2013 00:37
-
-
Save tatsuyaueda/5596200 to your computer and use it in GitHub Desktop.
jQueryMobile Dynamic Content Rewrite(2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".force-reload").click(function() { | |
$.get(document.URL, function(data) { | |
// 読み込みし直すページコンテナを指定 | |
var anchor = "#" + document.URL.split("#")[1]; | |
var $content = $(anchor).children(":jqmData(role=content)") | |
var $newContent = $("<div>" + data + "</div>").children(anchor).children(":jqmDatazrole=content)").children(); | |
$content.html($newContent).trigger("create"); | |
$content.find(":jqmData(role=listview)").listview(); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment