PIXNET Logo登入

工作需要筆記

跳到主文

歡迎光臨amychang2014在痞客邦的小天地

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 6月 26 週五 201510:55
  • C# 結合js的即時彈出視窗(alert)

用途:在codebehind寫txterrmsg.Text = "..."; 就會有即時的alert彈出來!
要放在$(function(){})裡用唷!

setInterval(function () {
var err = $('#<%=txterrmsg.ClientID%>').val();
if (err != '') {
myalert(err);
$('#<%=txterrmsg.ClientID%>').val('');
hidenowpop();
}
var topoffset = 0;
if (detectDevice()) {
topoffset = 0;
} else
topoffset = 60;
$('#pop').css('top', topoffset + parseInt($('body').scrollTop()) + 'px');
}, 200);
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(42)

  • 個人分類:ASP.NET C#
▲top
  • 6月 22 週一 201517:57
  • C# 日期比較

DateTime 開始時間 = DateTime.ParseExact(終止區間[0], "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture);
DateTime 結束時間 = DateTime.ParseExact(終止區間[1], "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture);
if (今天.Date < 開始時間.Date || 今天.Date > 結束時間.Date)
{
Response.Redirect("../expiry/" + Page.RouteData.Values["name"]);
}
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(381)

  • 個人分類:ASP.NET C#
▲top
  • 6月 18 週四 201516:41
  • jquery scroll到指定物件

var url = window.location.href;
if (url.indexOf("action=3") >= 0) {
$('html, body').animate({
scrollTop: $('.3').offset().top
}, 'fast');
} else {
if (url.indexOf("action=2") >= 0) {
$("body, html").animate({
scrollTop: $('.2').offset().top
}, 'fast');
}
}
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(21)

  • 個人分類:jQuery
▲top
  • 6月 18 週四 201515:46
  • jquery location.href reload page with hash

window.location.href +="#mypara";
location
.reload();
http://stackoverflow.com/questions/10612438/javascript-reload-the-page-with-hash-value
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(39)

  • 個人分類:jQuery
▲top
  • 6月 18 週四 201514:22
  • c# 清除所有空白字元

using System.Text.RegularExpressions;

string saveFile = FileUpload1.Value;
saveFile = Regex.Replace(saveFile, @"\s+", ""); //清除空白字元
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(154)

  • 個人分類:ASP.NET C#
▲top
  • 6月 18 週四 201514:21
  • javascript 計算array值重複次數

var your_array=[5,5,5,3,3,2,5];
var counts = {};
your_array.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });
document.write(counts[5])
 
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(2,585)

  • 個人分類:JavaScript
▲top
  • 6月 16 週二 201510:39
  • ajax fileupload 顯示設定


$(document).on('change','.browseimage',function(){
alert
('change');// check FormData and ajax ..});
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(176)

  • 個人分類:ASP.NET C#
▲top
  • 6月 12 週五 201514:22
  • bootstrap modal

<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button>
...more buttons...

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="recipient-name" class="control-label">Recipient:</label>
<input type="text" class="form-control" id="recipient-name">
</div>
<div class="form-group">
<label for="message-text" class="control-label">Message:</label>
<textarea class="form-control" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Send message</button>
</div>
</div>
</div>
</div>
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(295)

  • 個人分類:jQuery
▲top
  • 6月 12 週五 201512:20
  • ajax get JSON

var imagesJSON =[];

$
.ajax({
url
:"http://www.xyz.com/data.php?id=113&out=json",
cache
:false,
dataType
:"json",
success
:function(data){
$
.each(data.issue.page,function(i,item){
imagesJSON
[i]= item["@attributes"];});

alert
(imagesJSON.length);},
error
:function(request, status, error){ alert(status +", "+ error);}});
http://stackoverflow.com/questions/10315211/getjson-not-workin-in-ie
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(8)

  • 個人分類:JavaScript
▲top
  • 6月 12 週五 201510:43
  • javascript youtube 驗證


$(function () {
//var videoID = 'nUUVkiXFbO0';
var videoURL='<%= videoURL%>';
var video = videoURL.split('v=');
var videoID = video[1].substring(0, 11);

$.ajax({
url: "https://www.googleapis.com/youtube/v3/videos?id=" + videoID + "&key={YOUTUBE-API-KEY}&part=snippet",
cache: false,
dataType: "json",
success: function (data) {
var result = data['items']['length'];
if (result > 0)
{
alert('good');
} else
{
alert('err');
}
},
error: function (request, status, error) { alert(status + ", " + error); }
});

})
(繼續閱讀...)
文章標籤

amychang2014 發表在 痞客邦 留言(0) 人氣(20)

  • 個人分類:JavaScript
▲top
«1...78939»

個人資訊

amychang2014
暱稱:
amychang2014
分類:
不設分類
好友:
累積中
地區:

熱門文章

  • (1,234)c#移除HTML Tag
  • (544)ASP.NET C# 取得圖片長、寬by stream
  • (33)[PhoneGap] 獲得目前地理位置
  • (26)jQuery取url變數
  • (14)社會創新
  • (11)jQuery selector class child each
  • (9)C# Convert、Parse、TryParse、(int) 區別使用
  • (6)jQuery select ASP.NET Control
  • (2)INSERT、UPDATE FROM SELECT
  • (3)Beauty Design

文章分類

  • RWD (0)
  • JSON (1)
  • 物件導向 (1)
  • ASP.NET MVC (1)
  • JSON (1)
  • Google API (2)
  • IIS (3)
  • SQL (15)
  • CSR企業社會責任 (3)
  • PhoneGap (19)
  • Mobile (2)
  • Design (3)
  • CSS (38)
  • 其它 (18)
  • New Project (1)
  • jQuery (71)
  • MSSQL (12)
  • ASP.NET C# (136)
  • Facebook (5)
  • JavaScript (48)
  • 未分類文章 (1)

最新文章

  • 上傳前預覽
  • SQL 排序置換
  • 臨時網址
  • C# 載入資料夾內所有圖片
  • 判別行動裝置
  • 使用a 呼叫js 埋ga
  • C# 直接下載檔案
  • 圖片按鈕 input file
  • [轉貼]上傳檔案前,JavaScript檢查檔案格式、大小
  • css goTop

文章精選

文章搜尋

參觀人氣

  • 本日人氣:
  • 累積人氣: