Skip to content

Instantly share code, notes, and snippets.

@crazylion
crazylion / 0_reuse_code.js
Created January 22, 2016 15:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
(function() {
var defaults = {
error_container : '#check_result',
waiting : '#waiting',
target_text : '編碼',
api_url: ''
}
var checkDuplicate = function(elem, options){
var currentTimer = 0;
<?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?>
<?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?>
<?php
//應該是這樣
if($field->widgetView($profile)){
echo $field->widgetView($profile);
}else{
$(".authBtn").live("click",function(){
var _this =this;
$.getJSON('auth_process.php?type=json',{Id:$(this).attr("id")},
function(ret) {
//成功
if(ret=="pass"){
$(_this).remove();
// console.log("啟用!!!");
}else if(ret=="fail"){
window.alert("驗證手續失敗請再試一次或刷新頁面!!!");