用途:在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) 人氣()

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) 人氣()

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) 人氣()

window.location.href +="#mypara";
location.reload();

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

using System.Text.RegularExpressions;

string saveFile = FileUpload1.Value;
saveFile = Regex.Replace(saveFile, @"\s+", ""); //清除空白字元

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

var your_array=[5,5,5,3,3,2,5];
var counts = {};

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


$(document).on('change','.browseimage',function(){
    alert('change');// check FormData and ajax ..});


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

<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) 人氣()

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);}});

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


$(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) 人氣()