CodeIgniter 에러메시지 출력

PHP 2013. 8. 21. 15:42 Posted by Dayis

index.php 페이지 상단에 코드삽입


/* 에러메시지 출력 설정 시작 */

ini_set('display_errors', 0);

register_shutdown_function('error_alert'); 


function error_alert() 

if(is_null($e = error_get_last()) === false) 

print_r($e); // 이곳에서 디비처리, 메일, SMS발송, 해당소스 강제수정, 예외처리등등 가능

/* 에러메시지 출력 설정 끝 */

[jQuery] window와 document 비교

JAVASCRIPT 2013. 7. 9. 15:35 Posted by Dayis

1. 전체 문서 크기 : 창크기에 상관없이 일정한 값을 가짐 

- 스크롤에 의해 보이지 않은 영역까지 포함

$(document).height();

$(document).width();


2. 메뉴바, 툴바, 스크롤바를 제외한 크기 : 창크기에 따라 값이 변경 

- 스크롤에 의해 보이지 않는 영역은 미포함

$(window).height();

$(window).width();

'JAVASCRIPT' 카테고리의 다른 글

jquery 이미지 슬라이드  (0) 2014.12.25
jquery 타이머  (0) 2014.12.25
날씨 API  (0) 2013.07.03
jQuery ajaxForm plugin (form submit)  (0) 2013.06.17
jQuery 모바일 터치슬라이드  (0) 2013.05.29

날씨 API

JAVASCRIPT 2013. 7. 3. 13:42 Posted by Dayis

//**********************************************************************************

//날씨 아이콘 추가 시작

// API : http://api.openweathermap.org/data/2.5/weather?q=seoul,kr

// Icon : http://bugs.openweathermap.org/projects/api/wiki/Weather_Condition_Codes

//**********************************************************************************

var WeatherMain="";

var WeatherIcon="";

var WeatherTemp="";

function RequestWeather() {

var param = {"q":"seoul"};

// cross-domain 접근을 위해 callback 추가

var json;

$.ajax({

url : "http://api.openweathermap.org/data/2.5/weather",

data : "q=seoul&callback=fnWeather",

dataType : "jsonp",

jsonp : "callback"

});

}


function fnWeather(res)

{

$.each(res, function(key,val){

if (key=="weather") {

$.each(val, function(key2,val2){

$.each(val2, function(key3,val3){

if (key3=="main") {

WeatherMain = val3;

} else if (key3=="icon"){

WeatherIcon = val3;

}

});

});

} else if (key=="main") {

$.each(val, function(key2,val2){

if (key2=="temp") {

WeatherTemp = val2;

}

});

}

});


//alert(WeatherMain+", "+WeatherIcon);

if (WeatherIcon != "") {

$("#spnWeather").html("<img src='http://openweathermap.org/img/w/"+WeatherIcon+".png' border='0' width='40'>");

}


if (WeatherTemp != "") {

WeatherTemp=(WeatherTemp-273.15).toFixed(1)    //절대온도를 섭씨온도로 변경

$("#spnTemp").html(WeatherTemp+"℃)");

}

}

//날씨 아이콘 추가 끝

'JAVASCRIPT' 카테고리의 다른 글

jquery 타이머  (0) 2014.12.25
[jQuery] window와 document 비교  (0) 2013.07.09
jQuery ajaxForm plugin (form submit)  (0) 2013.06.17
jQuery 모바일 터치슬라이드  (0) 2013.05.29
jQuery 특정영역(div)만 출력  (0) 2013.05.13