Yes, this is the first content part code:
@{
Script.Require("jQuery");
Script.Require("Publish");
}
<div id="buttondiv">
<button id ="create" >Create</button>
</div>
Script for that part:
publish.js
(function ($) {
$(document).ready(function () {
$(window).bind('storage', function (e) {
alert('change');
});
localStorage.setItem('someItem', 'someValue');
$("#create").click(function () {
localStorage.setItem("test", "data");
});
});
})(jQuery);
ResourceManifest.cs:
public void BuildManifests(ResourceManifestBuilder builder)
{
var manifest = builder.Add();
manifest.DefineScript("jQuery").SetUrl("jquery-1.6.4.min.js", "jquery-1.6.4.js").SetVersion("1.6.4");
manifest.DefineScript("Publish").SetUrl("Publish.js").SetDependencies("jQuery");
}
Second content part is simple:
@{
Script.Require("jQuery");
}
<h2>Simple text info</h2>
Script for second content part:
(function ($) {
$(document).ready(function () {
$(window).bind('storage', function (e) {
alert('storage changed');
});
});
})(jQuery);
When i run this, i wait that when i click 'Create' button alert should be happens at least but nothing happens at all...
|