码迷,mamicode.com
首页 > Web开发 > 详细

MVC 随记

时间:2014-09-04 16:52:09      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   os   io   ar   strong   2014   div   

2014-09-04

[1] Json

var contact = new Object();
contact.firstname = "Jesper";
contact.surname = "Aaberg";
contact.phone = ["555-0100", "555-0120"];

var memberfilter = new Array();
memberfilter[0] = "surname";
memberfilter[1] = "phone";
var jsonText = JSON.stringify(contact, memberfilter, "\t");
document.write(jsonText);

JSON.stringify IE8、IE9不兼容,解决方法


[2] popup

 

$.ajaxSetup({ cache: false });

$(document).ready(function () {
$(".openDialog").live("click", function (e) {
e.preventDefault();

$("<div></div>")
.addClass("dialog")
.attr("id", $(this)
.attr("data-dialog-id"))
.appendTo("body")
.dialog({
title: $(this).attr("data-dialog-title"),
close: function () { $(this).remove(); },
modal: true,
height: 250,
width: 400,
left: 0

})
.load(this.href);
});

$(".close").live("click", function (e) {
e.preventDefault();
$(this).closest(".dialog").dialog("close");
});
});

-------------------------------------

<%: Html.ActionLink("Detail~~", "Detail",
new { code=item.Name },
new { @class = "openDialog", data_dialog_id = "aboutlDialog", data_dialog_title = "About Us"}
)%>

MVC 随记

标签:style   http   color   os   io   ar   strong   2014   div   

原文地址:http://www.cnblogs.com/dufu/p/3956171.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!