This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
$('#app-opener').bind('click', | |
function(){ | |
var timer = setTimeout(function(){ | |
alert('you not installed the x-myapp!!'); | |
},1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @start INT = 1; | |
DECLARE @end INT = 50; | |
WITH #KEYS AS ( | |
SELECT @start AS Number, REPLACE(LEFT(NEWID(), 18), '-', '') AS [KEY] | |
UNION ALL | |
SELECT Number + 1, REPLACE(LEFT(NEWID(), 18), '-', '') AS [KEY] | |
FROM #KEYS | |
WHERE Number < @end | |
) | |
SELECT * FROM #KEYS OPTION (MAXRECURSION 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<script> | |
$(function(){ | |
$('#wrapper').on('click','#onlink',function(event){ | |
alert('on link was clicked'); | |
}); | |
$("#livelink").live('click',function(){ | |
alert('live link was clicked'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//隨機GUID | |
function RandomGUID(){ | |
return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
} | |
//隨機整數 | |
function RandomNum(Min,Max){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////example | |
////http://goo.gl/FOMIgW | |
//template = '<li{is Selected}>{isChecked}<a href="/learn/{rootId}/topic/{courseId}">{indexStr} {courseName}</a></li>'; | |
//var data = { | |
// isSelected: node.CourseId == Info.PageData.cId * 1 ? ' class="sel"' : "", | |
// isChecked: renderCheckedBox(node.CourseNodeType, node.Percentage, node.CourseId), | |
// indexStr: node.LevelIndex.join("-"), | |
// courseName: node.Name, | |
// rootId: Info.PageData.rId, | |
// courseId: node.CourseId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function creates a new anchor element and uses location | |
// properties (inherent) to get the desired URL data. Some String | |
// operations are used (to normalize results across browsers). | |
function parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
source: url, | |
protocol: a.protocol.replace(':',''), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Date DATETIME | |
Set @Date = GetDate() | |
DECLARE @Start DATETIME,@End DATETIME | |
DECLARE @Index INT | |
SET @Start = DATEADD(MONTH,DATEDIFF(MONTH,0,@Date),0) | |
SET @End = DATEADD(MONTH,1,@Start) | |
SET @Index = DATEDIFF(DAY,-1,@Start)%7 - 1; | |
SET @Start = DATEADD(mm,DATEDIFF(mm,0,@Date),0) | |
SET @End = DATEADD(mm,1,@Start) - 1 | |
SET @Index= DATEDIFF(day,0,@Start)%7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//namespace pattern | |
var MYAPP = MYAPP || {}; | |
MYAPP.namespace = function(ns_string){ | |
var parts = ns_string.split('.'), | |
parent = MYAPP, | |
i; | |
if(parts[0]==="MYAPP"){ | |
parts = parts.slice(1); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION [dbo].[UF_SliptToTable] | |
( | |
@psCSString VARCHAR(8000) | |
) | |
RETURNS @otTemp TABLE(sID VARCHAR(100)) | |
AS | |
BEGIN | |
DECLARE @sTemp VARCHAR(100) | |
WHILE LEN(@psCSString) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stopEventBubble(e) { | |
if (e && e.stopPropagation) { | |
e.stopPropagation(); | |
} | |
else {//why always IE | |
window.event.cancelBubble = true; | |
} | |
} |
OlderNewer