from : http://mistonline.in/wp/detect-browser-close-event-and-alert-some-messages-using-javascript/


window.onbeforeunload = function (my_event) {
    var message = "Your logout page has been opened in a new window, Check that out. Make sure that you have enabled pop up in your browser to see that?";
    if (typeof my_event == 'undefined') {
        my_event = window.event;
    }
    if (my_event) {
        newWindow = window.open('test.html', '', 'width=450,height=350')
        newWindow.document.write("<p>This is 'newWindow'</p>")
        newWindow.focus();
        my_event.returnValue = message;
    }
    return message;
}

4대브라우저에서 먹히는 닫기 이벤트에 대한 이벤트 처리. 단 페이지이동등에도 역시 반응하므로 해당 부분에 대한 필터링이 필요하다.



뭐... 예전부터 ... 학생때부터였던가 졸업하고 난 후던가.. ezslookingaround.com 이라는 도메인을 내고 호스팅도 내고...

지금까지 운영해왔습니다. 2012년 부터는 사실상 ezsnote.tistory.com 으로 옮겼지만요  


eszlookingaround.com 이 올해로 9년째가 됐는데... 이번달이.. 정확히는 오늘까지가 갱신요금 내는 날이네요.

9년이나 운영하고 ... 문닫으려고 하니 차마 .. 쉽게 결정하진 못하겠네요; 차라리 이럴거면 9년이나 운영하지 말것을;
괜히 개인도메인내고 이짓을 했나; 싶기도 하고; 


결정못내리면... 뭐 자연스레 내려가는거겠죠. 그리고 그 사이트로 걸려있는 수많은(?) 링크가 사라지는거고.... 왠지 제 사이트로 와서 도움받았다고 글을 남기고 하셨던분들... 혹은 c 자료가 필요해서 들르셨을분들을 생각하면 약간 죄송하긴하네요. 사이트 하나 내리는데 이런데 9년 운영한 가게문 닫는건 어떨까 라는 생각도 들더군요.

뭐 아직 결정을 내리진 못했지만 이렇게 아쉬우나마 글을 적습니다. 혹시 내려간다면 이때까지 ezslookingaround.com 을 이용해주신 분들께 감사합니다~ 

3. run "update-manager -d" or "do-release-upgrade -m desktop -d


결국 난... 우분투 시디를 구해서 업그레이드 했다. 그냥 업그레이드 안되는 경우도 있으니 참고 바란다.

SELECT * 

FROM

(

SELECT '10' 원본컬럼값,'100' 컬럼2  FROM dual UNION ALL 

SELECT '20' 원본컬럼값,null 컬럼2  FROM dual UNION ALL

SELECT '30' 원본컬럼값,'300' 컬럼2  FROM dual

);

결과

원본컬럼값    컬럼2

--------------------

10         100

20         (null)

30         300


흐음.. 이런식으로 테스트용도의 테이블 형태 구조 생성 가능


from SQL의 컨셉 책...


toggle 은 한가지가 아니다; 

하나는 Effects>Basics  , 다른 하나는 Events > Mouse Events 이다.

Effects 쪽은 대상 엘리먼츠를 숨기거나 보여주는 역할이고

  • .toggle( [duration] [, callback] )

    durationA string or number determining how long the animation will run.

    callbackA function to call once the animation is complete.

  • version added: 1.4.3.toggle( [duration] [, easing] [, callback] )

    durationA string or number determining how long the animation will run.

    easingA string indicating which easing function to use for the transition.

    callbackA function to call once the animation is complete.

  • version added: 1.3.toggle( showOrHide )

    showOrHideA Boolean indicating whether to show or hide the elements.


Events 쪽은 두개 이상의 행들러를 대상에 바인드하는 역할을한다. ( 다른유형의 클릭에 실행되도록...)
    즉.. 이건 홀수,짝수의 동작에 반응하는거였다; 뭐 마지막 옵션에 해당하는 함수를 하나 더 넣으면 매번도 되는듯 하다.


  • version added: 1.0
    .toggle( handler(eventObject), handler(eventObject) [, handler(eventObject)] )

    handler(eventObject)A function to execute every even time the element is clicked.

    handler(eventObject)A function to execute every odd time the element is clicked.

    handler(eventObject)Additional handlers to cycle through after clicks.


'IT > jquery' 카테고리의 다른 글

$ 초기화...  (0) 2012.01.04

jQuery.each( collection, callback(indexInArray, valueOfElement) )

collectionThe object or array to iterate over.

callback(indexInArray, valueOfElement)The function that will be executed on every object.


each 를 쓸때 callback function 에  첫번째 파라미터는 index 값이다. i++ .. 과 같다고 봐도 된다.

---------------------------------

from https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach

Syntax

array.forEach(callback[, thisArg])

Parameters

callback
Function to execute for each element.
thisArg
Object to use as this when executing callback.


<script>

var arr = ['a','b','c','d','e'];

// item:a/index:0

arr.forEach(function (item,index) {
    alert('item:'+item+'/index:'+index);

});

</script>


from http://www.openjs.com/articles/delete.php

var arr = {
	"number": 42,
	"year"	: 2007,
	"hello"	: "world",
	"foo"	: "bar"
}
for(var ele in arr) {
	alert(ele + " : " + arr[ele]);
}
delete arr['hello']; //Removes the 'hello' key of the array

for(var ele in arr) {
	alert(ele + " : " + arr[ele]); //The 'hello' key and its value will be missing 

}


잘봐라.. 이거 배열이 아니라 객체이다. class 란 말이지 (왜 클래스가 객체가 되어버렸는지에 대해서는... 그냥 넘어가자; )

즉 delete 는 배열이 아니라 객체에서 해당 키의 를 제거해버리는 기능이다.


그리고 참고로 자바의 배열은 [] 지~


흐음.. 현재 node.js 는 빠른 변화(발전?)를 겪는건가 라는 생각이 들게 하는 상황이다.

나야 이제 node.js의 존재를 확인하는 레벨이다. 해서 책을 빌려서 보는 중인데 이 책도 얼마전에 나온 신간이다.
근데... 이 책의 몇몇 미들웨어들은 벌써 deprecated 됐거나.. 제거되었다;

즉 책의 예제를 돌려볼 수 없다. 이래저래 찾아서 이젠 스스로 새로운 버전에 맞게 수정할수 있는 지식도 얻게 해줬으니 고맙다고 해야할까;?

아무튼 connect의 router는 사라졌다. 

많은 예제들에 나와있는 코드일텐데 (해외도 마찬가지) 이 코드는 더 이상 존재하지 않는다. 어떤외국분이 git에서 소스를 가져와서 확인해보니 ..정확한 버전넘버(..는 아니지; hashcode니까?) 은 모르겠지만 아무튼 제거된었다는 포스팅도 읽었다.


흐음... ; 뭐 .. 오히려 최신버전을 몸소 다 겪고 있는 걸 다행이라고 여길까나?

아마 위의 에러메시지를 서칭해서 오신분들껜 쏘리.. 라는 말밖에;


'IT > node.js' 카테고리의 다른 글

node.js connect ... Cannot GET /  (0) 2012.04.16

+ Recent posts