Trigger the event:

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


Trigger the event:
$("input[name='lom']").change(function(){
  // Do something interesting here
});

Radio Button:

To get the selected value:
var v=$('input[name=Sex]:checked').val();
if( typeof(v) == 'undefined'){
  //there's no button selected
}

To select radio button from value:
$("input[name=Sex][value='2']").attr('checked',true);

To select radio button from index:
$('input[name=Sex]')[1].checked = true;



Checkbox:

To see whether checkbox is checked:
$('#chk').is(':checked');

To set checkbox:
$("#chk1").attr("checked",'');
$("#chk2").attr("checked",true); 



Selecter:

To get the selected value:
$('#selectList').val();
$('#selectList :selected').text();

To add a new option:
$('#selectList').addOption(value,text);

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

first, to be sure the google analytics api is new version, such as
var _gaq = _gaq || [];

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

first, to be sure the google analytics api is new version, such as

var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxxxx-x']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

the way 1. use ajaxSetup for all calls to $.ajax.

文章標籤

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


$(document).ready(function () {
  $('[placeholder]').focus(function () {
    var input = $(this);
    if (input.val() == input.attr('placeholder')) {
      input.val('');
      input.removeClass('placeholder');
    }
  }).blur(function () {
    var input = $(this);
    if (input.val() == '' || input.val() == input.attr('placeholder')) {
      input.addClass('placeholder');
      input.val(input.attr('placeholder'));
    }
  }).blur();

  $('[placeholder]').parents('form').submit(function () {
    $(this).find('[placeholder]').each(function () {
      var input = $(this);
      if (input.val() == input.attr('placeholder')) {
        input.val('');
      }
    })
  });
});

CSS Styling

::-webkit-input-placeholder {
  color: red;
}
:-moz-placeholder {
  color: red;
}
.placeholder {
  color: #ccc;
}


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

Environmental Setting
1. Install office 2003

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

Environmental Setting
1. Install office 2003

文章標籤

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