mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-17 14:30:28 +00:00
In starting markup, pages should now be identified with the attribute data-role="page". This allows us to then add ui-page programatically, hiding all non-active pages, and apply ui-page-active to one page at a time to show it. mobile.js is updated to find pages by this attribute now, instead of ui-page class. fixes issue 32
60 lines
No EOL
2.8 KiB
HTML
60 lines
No EOL
2.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang='en'><head><meta http-equiv='content-type' content='text/html; charset=UTF-8' /></head><body>
|
|
<div data-role="page">
|
|
<div class="ui-header">
|
|
<h1>jQuery.removeData()</h1>
|
|
|
|
</div>
|
|
<div class="ui-content ui-body ui-body-c" id="jQuery.removeData1">
|
|
<h2 class="jq-clearfix roundTop section-title">
|
|
<span class="name">jQuery.removeData( element, [ name ] )</span> <span class="returns">Returns: <a class="return" href="http://docs.jquery.com/Types#jQuery">jQuery</a></span>
|
|
</h2>
|
|
<div class=" entry-details">
|
|
<p class="desc"><strong>Description: </strong>Remove a previously-stored piece of data.</p>
|
|
<ul class="signatures"><li class="signature" id="jQuery.removeData-element-name">
|
|
<h4 class="name">
|
|
<span class="versionAdded">version added: <a href="/category/version/1.2.3/">1.2.3</a></span>jQuery.removeData( element, [ name ] )</h4>
|
|
<p class="arguement"><strong>element</strong>A DOM element from which to remove data.</p>
|
|
<p class="arguement"><strong>name</strong>A string naming the piece of data to remove.</p>
|
|
</li></ul>
|
|
<div class="longdesc">
|
|
<p><strong>Note:</strong> This is a low-level method, you should probably use <code><a href="/removeData">.removeData()</a></code> instead.</p>
|
|
<p>The <code>jQuery.removeData()</code> method allows us to remove values that were previously set using <code><a href="/jQuery.data">jQuery.data()</a></code>. When called with the name of a key, <code>jQuery.removeData()</code> deletes that particular value; when called with no arguments, all values are removed.</p>
|
|
</div>
|
|
<h3>Example:</h3>
|
|
<div id="entry-examples" class="entry-examples"><div id="example-0">
|
|
<h4><span class="desc">Set a data store for 2 names then remove one of them.</span></h4>
|
|
<pre><code class="example demo-code"><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
div { margin:2px; color:blue; }
|
|
span { color:red; }
|
|
</style>
|
|
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
|
</head>
|
|
<body>
|
|
<div>value1 before creation: <span></span></div>
|
|
<div>value1 after creation: <span></span></div>
|
|
<div>value1 after removal: <span></span></div>
|
|
<div>value2 after removal: <span></span></div>
|
|
<script>
|
|
var div = $("div")[0];
|
|
$("span:eq(0)").text("" + $("div").data("test1"));
|
|
jQuery.data(div, "test1", "VALUE-1");
|
|
jQuery.data(div, "test2", "VALUE-2");
|
|
$("span:eq(1)").text("" + jQuery.data(div, "test1"));
|
|
jQuery.removeData(div, "test1");
|
|
$("span:eq(2)").text("" + jQuery.data(div, "test1"));
|
|
$("span:eq(3)").text("" + jQuery.data(div, "test2"));</script>
|
|
</body>
|
|
</html></code></pre>
|
|
<h4>Demo:</h4>
|
|
<div class="demo code-demo"></div>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body></html> |