Time of Update: 2014-01-20
首先將jquery檔案引入src="jquery.js"></script>1、入口 ,頁面載入時執行$(document).ready(function() { // 載入時執行,初始化});2、以控制項id擷取控制項$("#id名")3、控制項綁定事件$("#id名").bind("click",function(){})$.ajax({type:"post",url:
Time of Update: 2014-01-19
<div id="localImag" style="width: 328px; float: left; height: 113px;"> <img id="preview" src="SearchCompanyPhoto.ashx" width="140" height="150" />
Time of Update: 2014-01-19
$(function(){ var bar2D = new FusionCharts( "../script/Charts/Bar2D.swf", "myChartId", "100%", "540", "0" ); bar2D.setXMLUrl("data/bar2D.xml");
Time of Update: 2014-01-19
直接看例子啦:function fmoney(s, n) //s:傳入的float數字 ,n:希望返回小數點幾位{ n = n > 0 && n <= 20 ? n : 2; s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) +
Time of Update: 2014-01-19
通過A頁面通過window.open開啟一個B頁面,B頁面提交過後,希望局部重新整理A頁面。 window.open(url, '','width=100,height=100,resizable=no,status=no,menubar=no,scrollbars=no');<form action="BAction?method=save"> <input type="submit" value="提交&
Time of Update: 2014-01-19
最近做的一個項目中有個功能是滑鼠移動到某一塊id為A,然後A的子項目id為B在下方緊貼著父元素A顯示出來,B裡面的內容是滑鼠移動到A元素上才請求服務端擷取資料。我使用了mouseover,mouseout事件,採用jquery的on方法。大致如下$(document).on("mouseover","#A",function(){
Time of Update: 2014-01-19
拼接的資料顯示不同的格式顯示引入的js和css <link rel="stylesheet"type="text/css" href="themes/default/easyui.css" /> <link rel="stylesheet"type="text/css" href="CSS/icon.css" />
Time of Update: 2014-01-19
update方法,param參數包含2個屬性:[javascript] view plaincopyRe: Tabs初始化時如何讓特定的tab處於選中狀態 $('#tt').tabs('update',{tab:$('#tt').tabs('getTab','Tab2'),options:{selected:true}});目前我項目中使用是的是<div id="tabs" class="easyui-tabs"
Time of Update: 2014-01-19
JSON.parse 將 JSON
Time of Update: 2014-01-19
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html;
Time of Update: 2014-01-19
1023456789 下面的代碼匹配的是0-9和. 顯示效果: 0.123456789注意兩個的Regex不同,匹配不一樣。第一個,只能輸入>0的正整數。第二個,只能輸入0-9的數字和小數點。Js代碼 [js] view plaincopy否則不能禁用,inactive 代表IME為英文auto 代表開啟IME (預設)disable 代表關閉IME
Time of Update: 2014-01-19
html() - 設定或返回所選元素的內容(包括 HTML 標籤)val() - 設定或返回表單欄位的值 attr() 方法用於擷取屬性值。 下面的例子示範如何通過 jQuery text(),html(),val(),attr() 方法來獲得內容:執行個體$("#btn1").click(function(){alert("Text: " +
Time of Update: 2014-01-19
jQuery 的團隊考慮到了這個問題,並實現了 noConflict() 方法。noConflict() 方法會釋放會 $ 標識符的控制,這樣其他指令碼就可以使用它了。$.noConflict();jQuery(document).ready(function(){jQuery("button").click(function(){jQuery("p").text("jQuery 仍在運行!");});});var jq =
Time of Update: 2014-01-19
append() - 在被選元素的結尾插入內容 •prepend() - 在被選元素的開頭插入內容 •after() - 在被選元素之後插入內容 •before() - 在被選元素之前插入內容 •$("p").append("Some appended text.");$("p").prepend("Some prepended text.");不過,append() 和 prepend()
Time of Update: 2014-01-15
#include <iostream>#include <list>using namespace std;// 抽象介面class CUSBDevice{public: virtual ~CUSBDevice(){} virtual void Add(CUSBDevice* _pDev){} virtual void Remove(CUSBDevice* _pDev){} virtual void Transmit(){} virtual
Time of Update: 2014-01-15
好久沒有更新Cocos2d-html5的博文了,這兩個月忙著一些比賽,所以就耽誤了,嘿嘿,不過關於這個專欄還是有很多章節要寫,所以還是慢慢來更新吧。Schedule,從翻譯的角度上來說就是”時間表“,差不多就是一個定時規劃,在cocos2d裡面使用的情境一般就是比如你想讓一個精靈間隔多少次執行什麼動畫,或者一個情境想延遲多久進行跳轉,ok,那麼就應該使用這個來實現。下面簡單說一下這個用法,因為這個函數是間隔執行的,所以不好展示畫面,所以我就用代碼和文字來說明一下。1.
Time of Update: 2014-01-19
設平面上有N 個離散資料點( xi , yi ) ( i = 1, 2, ., n) , 其多邊形重心G( . x1, . y1) 為: 成累加和:#include <iostream>#include <algorithm>#include <cstring>#include <cstdio>using namespace std;struct Point{double x,y;};//叉積求面積double Area(const Point
Time of Update: 2014-01-19
Jquery版本:1.10.2GOOGLE CHROME瀏覽器可正常執行。IE11和FIREFOX 26出現BUG。<select id="id123" name="id123" multiple="multiple"><option>test 1</option><option>test 2</option><option>test
Time of Update: 2014-01-19
D. Road Maptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output cities in Berland. Each city has its index — an integer number from to n. The capital has index r. All the
Time of Update: 2014-01-19
n-1.181 21 02 12 23 23 14 04 212題意:給定n個點,判斷這n點能不能組成一個多邊形,並且點都在直角上,如果可以輸出周長,不行輸出-1.思路:對於橫座標為x的所有點,如果是奇數個點,那麼肯定不行,因為同一橫座標x的點,要能折出去再折回來,必然為偶數個,代碼:#include <stdio.h>#include <string.h>#include <stdlib.h>#include <map>#include <