阅读全文>>
$.ajax({
type: "post",
url: "{:u('cart/totalByCard')}?t="+Math.random(9999),
data: {'address':address,'delivity':delivity,'payment':payment,$('#card_form').serialize()},
dataType: "json",
success: function(json)
{
$('#cost_item').html('¥'+parseFloat(json....阅读全文>>
阅读全文>>
有中文乱码是因为Javascript页面和action类中使用的编码方式不一致造成的,可采用如下两种方法解决:
(1)页面的Javascript做两次encodeURI,服务器端获取后做一次UTF-8转码,因为前两次进行编码后都变成了英文的字节码,所以到服务器端无论如何解码都不会错误,推荐使用该方法。
var url=“Ajaxserver?name=”+encodeURI(encodeURI($("#userName").val()));
(2)在客户端JavaSc...阅读全文>>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<script type="text/javascript" src="lu.js"></script>
<div>
<audio contr...阅读全文>>
阅读全文>>
function popNotice() {
if (Notification.permission == "granted") {
var notification = new Notification("Hi,你好:", {
body: '可以加你个好友吗?',
&n...阅读全文>>
var express = require('express');
var app = express();
app.use(express.static('./'));
var server = app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});阅读全文>>
/*设置cookie*/
function setCookie(name, value, days){
if(days == null || days == ''){
days = 300;
}
var exp = new Date();
exp.setTime(exp.getTime() + days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + "; path=/;expires=" + exp.toGMTString();
}
/*获取cookie*/
function getCoo...阅读全文>>
(function(){ var re=/x/; var i=0; console.log(re); re.toString=function(){ window.close(); return '第'+(++i)+'次打开控制台'; } })();阅读全文>>