JQueryTest.cshtml
Dosyayı İndir
@{
ViewBag.Title = "JQueryTest";
}
<h2>
JQueryTest</h2>
<p id="text">
Burası paragraf.
</p>
<button id="fader">
Soldur</button>
<button id="mybutton">
Çöğün</button>
<div style="background: #98bf21; height: 100px; width: 100px; position: absolute;"
id="mydiv">
Yazı
</div>
<button id="animator">
Start Animation</button>
<br />
<br />
<br />
<br />
<br />
<br />
<input type="text" id="myinput" />
<input type="text" id="myoutput" />
<button id="getter">
Aktar</button>
<br />
<br />
<div id="remote">
Bu metin değişecek</div>
<br />
<button id="download">
İndir</button>
<button id="bring">
Getir</button>
<button id="send">
Gönder</button>
<button id="jsoner">
JSON</button>
@section Scripts {
<script type="text/javascript">
$(document).ready(function () {
$("#fader").click(function () {
$("#text").fadeOut();
});
});
$("#mybutton").click(function () {
$("#text").toggle();
});
$(document).ready(function () {
$("#animator").click(function () {
$("#mydiv").animate({ height: '250px', fontSize: '3em' }, 30000);
});
});
$("#getter").dblclick(function () {
$("#myoutput").val($("#myinput").val() + " Çıktısı");
$("#myinput").css("background-color", "red");
});
$(document).ready(function () {
$("#download").click(function () {
$("#remote").load("/Home/MyLoaded");
});
});
$("#bring").click(function () {
$.get("/Home/MyLoaded", function (data, status) {
alert("Veri: " + data + "\nDurum: " + status);
});
});
/*
$("#send").click(function () {
$.post("/Home/PingData",
{
sampleName: $("#myinput").val(),
sampleValue: 1234
},
function (data, status) {
$("#myoutput").val(data );
});
});
*/
$("#jsoner").click(function () {
alert("Tıklandı");
$.getJSON('http://localhost:49210/Home/RawJson', function (data) {
alert("Sonuç geldi");
$.each(data, function (i, object) {
$.each(object, function (property, value) {
alert(property + "=" + value);
});
});
});
});
</script>
}
Dosyayı İndir