posted by 뚱2

링크: http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript


RegExp.escape = function(str) {

return str.replace(/[[\]{}()*+?.\\|^$\-,&#\s]/g, "\\$&");

};


posted by 뚱2

[React] ReactJS 링크

JavaScript/JavaScript 2015. 5. 30. 22:03

링크: http://wit.nts-corp.com/2014/11/19/2584

링크: http://taegon.kim/archives/5097


링크: https://scotch.io/?s=react

posted by 뚱2

링크: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode#Notification

posted by 뚱2

링크: https://github.com/mishoo/UglifyJS

posted by 뚱2

링크: http://addyosmani.com/blog/taming-the-unicorn-easing-javascript-memory-profiling-in-devtools/

posted by 뚱2

조금만 찾아보면 누군가 만들어 놓은 라이브러리들이 참 많다.

링크: http://semu.github.io/timesheet.js/

posted by 뚱2

링크: http://jamesallardice.github.io/Placeholders.js/


posted by 뚱2

링크: http://ejohn.org/blog/javascript-method-overloading/


Overriding 기능찾다가 찾게 되었다. 나중에 써먹어야겠다.

참고로 존레식은 jQuery 만든 사람이다.


// addMethod - By John Resig (MIT Licensed)

function addMethod(object, name, fn){

    var old = object[ name ];

    object[ name ] = function(){

        if ( fn.length == arguments.length )

            return fn.apply( this, arguments );

        else if ( typeof old == 'function' )

            return old.apply( this, arguments );

    };

}



posted by 뚱2

[ScalaJs] Scala.js

JavaScript/JavaScript 2014. 6. 22. 11:49

참 재미있는 개발이다.

서버사이드 언어를 자바스크립트로 만들다니.

링크: http://www.scala-js.org/

posted by 뚱2

링크: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow


function getSize() {

  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {

    //Non-IE

    myWidth = window.innerWidth;

    myHeight = window.innerHeight;

  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    //IE 6+ in 'standards compliant mode'

    myWidth = document.documentElement.clientWidth;

    myHeight = document.documentElement.clientHeight;

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

    //IE 4 compatible

    myWidth = document.body.clientWidth;

    myHeight = document.body.clientHeight;

  }

  return [myWidth, myHeight];

}



function getScrollXY() {

  var scrOfX = 0, scrOfY = 0;

  if( typeof( window.pageYOffset ) == 'number' ) {

    //Netscape compliant

    scrOfY = window.pageYOffset;

    scrOfX = window.pageXOffset;

  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {

    //DOM compliant

    scrOfY = document.body.scrollTop;

    scrOfX = document.body.scrollLeft;

  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {

    //IE6 standards compliant mode

    scrOfY = document.documentElement.scrollTop;

    scrOfX = document.documentElement.scrollLeft;

  }

  return [ scrOfX, scrOfY ];

}


posted by 뚱2

[JavaScript] RegExr

JavaScript/JavaScript 2014. 6. 14. 00:15

자바스크립트 정규표현식 테스트 하기 좋은 곳

링크: http://www.regexr.com/


posted by 뚱2

링크: http://www.w3schools.com/jsref/jsref_shift.asp

링크: http://www.w3schools.com/jsref/jsref_pop.asp


shift: 배열의 앞쪽을 리턴하고 배열에서 삭제한다.

pop: 배열의 뒷쪽을 리턴하고 배열에서 삭제한다.

posted by 뚱2

링크: http://bower.io/

링크: http://blog.outsider.ne.kr/933

posted by 뚱2
posted by 뚱2

링크: http://youngman.kr/?p=1540



posted by 뚱2

http://gozillacj.com/wordpress/jsprocedure/

'JavaScript > JavaScript' 카테고리의 다른 글

[JavaScript] JavaScript Closure & scope  (0) 2014.04.04
[JavaScript] 메소드 후킹 구현하기  (0) 2014.03.31
[JavaScript] jsfiddle  (0) 2014.01.24
[JavaScript] 클로져(Closures)  (0) 2014.01.22
[JavaScript] use strict  (0) 2013.12.25
posted by 뚱2

[JavaScript] jsfiddle

JavaScript/JavaScript 2014. 1. 24. 14:49

링크: http://jsfiddle.net/

자바스크립트를 테스트 할수 있는 환경

posted by 뚱2

링크: https://docs.google.com/presentation/d/1YYv8eYoPpY694xAFvdTY3htoCGaMJlzfCYFthAIQe3U/edit#slide=id.p

링크: https://developer.mozilla.org/ko/docs/JavaScript/Guide/Closures

posted by 뚱2

[JavaScript] use strict

JavaScript/JavaScript 2013. 12. 25. 21:33

링크 : http://msdn.microsoft.com/ko-kr/library/ie/br230269(v=vs.94).aspx

posted by 뚱2

링크 : http://www.regexper.com/

'JavaScript > JavaScript' 카테고리의 다른 글

[JavaScript] 클로져(Closures)  (0) 2014.01.22
[JavaScript] use strict  (0) 2013.12.25
[JavaScript] JavaScript OOP Tutorial  (0) 2013.12.04
[JavaScript] 자바스크립트 모듈화 require.js  (0) 2013.10.18
[JavaScript] Date Format  (0) 2013.10.15
posted by 뚱2

링크 : http://www.techumber.com/2013/08/javascript-object-oriented-programming-tutorial.html

posted by 뚱2
posted by 뚱2

[JavaScript] Date Format

JavaScript/JavaScript 2013. 10. 15. 14:15

링크 : http://blog.stevenlevithan.com/archives/date-time-format

 

posted by 뚱2

/*

* strTemp  : [필수] 크로스사이트 스크립팅을 검사할 문자열

* level    : [옵션] 검사레벨

*            0 (기본) -> XSS취약한 문자 제거

*            1 (선택) -> 단순한 <, > 치환

*/

function XSS_Check(strTemp, level) {     

if ( level == undefined || level == 0 ) {

strTemp = strTemp.replace(/\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-/g,"");

}

else if (level != undefined && level == 1 ) {

strTemp = strTemp.replace(/\</g, "&lt;");

strTemp = strTemp.replace(/\>/g, "&gt;");

}

return strTemp;

}


posted by 뚱2

링크 : http://dean.edwards.name/packer/ 



posted by 뚱2

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;

var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;


posted by 뚱2

링크 : http://blog.naver.com/PostView.nhn?blogId=jjoommnn&logNo=130149113595&parentCategoryNo=22&categoryNo=&viewDate=&isShowPopularPosts=true&from=search 

posted by 뚱2

링크 : http://www.w3schools.com/jsref/jsref_regexp_source.asp 

Definition and Usage

The source property returns the text of the RegExp pattern.

Syntax

RegExpObject.source


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The source property is supported in all major browsers.


Example

Example

Return the text of the RegExp pattern:

<script>

var str="Visit W3Schools";
var patt1=/W3S/g;
document.write("The text of the RegExp is: " + patt1.source);

</script>

Try it yourself »

posted by 뚱2

//==================================================================

// 스크립트 오류 메세지

//==================================================================

function myDebug(errmsg, url, linenum)

{

    errWin=window.open('','','width=350,height=220,scrollbars=no');

    errWin.document.open();

    errWin.document.write('<CENTER><H1>스크립트오류 정보</H2></CENTER>');

    errWin.document.write('에러메시지: <FONT COLOR=RED>'+errmsg+'</FONT><BR>');

    errWin.document.write('에러가 난 문서: <FONT COLOR=RED>'+url+'</FONT><BR>');

    errWin.document.write('에러가 난 라인: <FONT COLOR=RED>'+linenum+'</FONT>');

    errWin.document.close();


    return true;

}

window.onerror=myDebug;


posted by 뚱2