標籤: string中包含一些特殊的字元字面量,又叫逸出序列,\n 意思是換行,\t 意為製表,\b意為空白格,\r斷行符號,\\斜杠.1.ECMAScript中字串是不可變的.2.轉換字串的方法:toString() 返回相應值的字串形態.null和undefined沒有此方法,其他都有.3.在不知道要轉換的值是不是null或undefined的情況下,可以使用轉型函數String(),這個函數能將任意值轉換成字串. var value1=null; var
標籤:本伺服器採用了node-koa(2.0):koa是Express下的一個web框架。搭建步驟:1.首先我們建立一個web-koa目錄,在目錄下建立app.js,package.json,start.js三個檔案。2.然後我們來編輯最基本的package.json檔案,如下:$ npm init{ "name": "myapp", "version": "1.0.0", "description": "this is my test web app in nodejs ",
標籤:實際開發中,在不同網頁的輸出中,常常有許多公用的代碼或者變數需要使用,於是定義了以下類來縮減代碼量如下代碼所示:<?php class universalClass{ function warn($what=‘‘) { echo "<p class=‘pp‘>$what</p>"; } function goTo($where=‘/personalInfo.php‘,$second=1) { echo "<meta
標籤:一、模組介紹The ngx_http_stub_status_module module provides access to basic status information.This module is not built by default, it should be enabled with the --with-http_stub_status_module configuration
標籤:引子: 在寫程式間突然需要用到隨機數,於是用到了js的Math.random隨機函數,產生指定範圍內的隨機數,根據網上流傳的寫法產生指定範圍內的隨機數如下function random(min, max){ return Math.round(Math.random()*(max-min))+min;}var zero = one = two = three = 0;for(var i=0;i<10000;i++){ var num =