온라인상에서 웹개발 및 테스트, 공유가 가능한 서비스가 있다.


바로 jsFiddle 이다.



단순한 회원가입 과정을 거치면 다음과 같은 화면이 나온다.



Create a new Fiddle 버튼을 누르면 자기만의 프로젝트를 하나 만들 수 있다.

  • 4개로 나뉜 에디터가 나타나고 각각 HTML, CSS, Javascript 를 입력 할 수 있고, Result 창에서는 결과를 볼 수 있다.
  • HTML 을 입력할때에는 HTML 태그를 비롯하여 META 태그, HEAD 태그, BODY 태그는 없어도 된다.
    • 창에 보이는 CSS, Javascript 에디터의 소스는 기본적으로 HTML 소스에 반영이 된다.
    • 외부 Javascript, CSS 소스는 좌측에 External Resources 버튼을 클릭하여 링크를 걸어줄 수 있다.



상단메뉴

  • Run
    • 현재 프로젝트를 실행하는 버튼으로 우측하단에 Result 화면에서 확인 할 수 있다.
  • Debug on Mobile
  • Save
    • 현재 프로젝트를 저장하여 다른사람과 공유 가능하다.
    • Save 를 하면  Update, Fork, Share 메뉴가 더 생긴다.
      • Update
        • 현재 프로젝트를 Update
      • Fork
        • 현재 프로젝트를 Fork
      • Base
        • Base 프로젝트로 이동
      • Share
        • 다른사람에게 현재 프로젝트를 공유가능
  • TidyUp
    • Editor 의 Indentation 을 정렬해주는 버튼
  • JSHint
    • Javascript Validation


좌측 네비게이션

  • jsFiddle Settings Sidebar Document
  • Frameworks & Extensions
    • jQuery, jQuery Mobile, YUI 등 다양한 외부 라이브러리를 적용한 프로젝트를 구성 할 수 있다.
    • onLoad, onDomready 등의 함수를 overloading 가능하다.
  • Fiddle Options
    • Title, Description
      • jsFiddle 에서 보여지는 Tilte bar, Description 을 수정 할 수 있다.
    • Normalized CSS
      • 기본 CSS 인 normalized.css 적용여부
    • Body Tag
      • body 에 class 등을 적용하는 등의 customizing 가능
    • DTD
      • HTML5, XHTML, HTML4 등의 DTD 설정
    • Freamwork <script> attribute
  • External Resources
    • 외부 Resources 의 URI 를 포함 할 수 있다.
  • Languages
    • 다음과 같이 다양한 웹언어지원
    • HTML, CSS, SCSS, JavaScript, Coffeescript, JavaScript 1.7
  • Ajax Requests
    • Ajax 를 통한 json 등의 시뮬레이션이 가능한 기능으로 보인다.
  • Example
    • 다양한 자바스크립트 라이브러리 예제를 제공한다.



Posted by leechwin
,

웹 기술을 이용하여 개발을 하다보면, 각 브라우져별 호환성을 맞추기 위해 코딩을 다르게 해야 할 경우가 종종 생겨난다.


많은 자바스크립트 라이브러리들이 브라우져 호환성을 보장해주기도 하지만 때론 개발자의 손길이 필요 할 경우도 종종 생겨난다.


각 브라우져별로 지원하는 특이한 CSS, Javascript 특성으로 사용자가 사용중인 브라우져 종류를 알아내는 방법을 알아보자.


  • Chrome
    • Selector
    • /* Chrome 24- and Safari 5- */
      ::made-up-pseudo-element, .selector {}
    • Media Query
    • /* Chrome, Safari 3+ */
      @media screen and (-webkit-min-device-pixel-ratio:0) {}
    • JavaScript
    • /* Chrome */
      var isChrome = !!window.chrome;

  • Firefox
    • Selector
    • /* Firefox 1.5 */
      body:empty .selector {} /* Firefox 2+ */
      .selector, x:-moz-any-link {} /* Firefox 3+ */
      .selector, x:-moz-any-link; x:default {} /* Firefox 3.5+ */
      body:not(:-moz-handler-blocked) .selector {}
    • Media Query
    • /* Firefox 3.5+, IE 9/10, Opera */
      @media screen and (min-resolution: +72dpi) {}
      
      /* Firefox 3.6+ */
      @media screen and (-moz-images-in-menus:0) {}
      
      /* Firefox 4+ */
      @media screen and (min--moz-device-pixel-ratio:0) {}
    • JavaScript
      /* Firefox */
      var isFF = !!navigator.userAgent.match(/firefox/i);
      
      /* Firefox 2 - 13 */
      var isFF = !!window.globalStorage;
      
      /* Firefox 2/3 */
      var isFF = /a/[-1]=='a';
      
      /* Firefox 3 */
      var isFF = (function x(){})[-5]=='x';
      
    • Miscellaneous
    • /* Firefox 3+ */
      @-moz-document url-prefix() {}

  • Internet Explorer
    • Selector
    • /* IE 6 and below */
      * html .selector  {} 
      .suckyie6.selector {} /* .suckyie6 can be any unused class */
      
      /* IE 7 and below */
      .selector, {}
      
      /* IE 7 */
      *:first-child+html .selector {} 
      .selector, x:-IE7 {} 
      *+html .selector {} 
      
      /* Everything but IE 6 */
      html > body .selector {}
      
      /* Everything but IE 6/7 */
      html > /**/ body .selector {}
      head ~ /* */ body .selector {}
      
      /* Everything but IE 6/7/8 */
      :root *> .selector {} 
      body:last-child .selector {} 
      body:nth-of-type(1) .selector {} 
      body:first-of-type .selector {}
      
    • Property/Value
    • /* IE 6 */
      .selector { _color: blue; } 
      .selector { -color: blue; }
      
      /* IE 6/7 - any combination of these characters: 
       ! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > | */
      .selector { !color: blue; } 
      .selector { $color: blue; } 
      .selector { &color: blue; } 
      .selector { *color: blue; } 
      /* ... */
      
      /* IE 6/7 - acts as an !important */
      .selector { color: blue !ie; } 
      /* string after ! can be anything */
      
      /* IE 8/9 */
      .selector { color: blue\0/; } 
      /* must go at the END of all rules */
      
      /* IE 9/10 */
      .selector:nth-of-type(1n) { color: blue\9; }
      
      /* IE 6/7/8/9/10 */
      .selector { color: blue\9; } 
      .selector { color/*\**/: blue\9; }
      
      /* Everything but IE 6 */
      .selector { color/**/: blue; }
      
    • Media Query
      /* IE 6/7 */
      @media screen\9 {}
      
      /* IE 6/7/8 */
      @media \0screen\,screen\9 {}
      
      /* IE 8 */
      @media \0screen {}
      
      /* IE 8/9/10 & Opera */
      @media screen\0 {}
      
      /* IE 9/10, Firefox 3.5+, Opera */
      @media screen and (min-resolution: +72dpi) {}
      
      /* IE 9/10 */
      @media screen and (min-width:0\0) {}
      
      /* IE 10+ */
      @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {}
      
      /* Everything but IE 6/7/8 */
      @media screen and (min-width: 400px) {}
      
    • JavaScript
    • /* IE <= 8 */
      var isIE = '\v'=='v';
      
      /* IE 6 */
      (checkIE = document.createElement("b")).innerHTML = ""; 
      var isIE = checkIE.getElementsByTagName("i").length == 1;
      
      /* IE 7 */
      (checkIE = document.createElement("b")).innerHTML = ""; 
      var isIE = checkIE.getElementsByTagName("i").length == 1;
      navigator.appVersion.indexOf("MSIE 7.")!=-1
      
      /* IE 8 */
      (checkIE = document.createElement("b")).innerHTML = ""; 
      var isIE = checkIE.getElementsByTagName("i").length == 1;
      
      /* IE 9 */
      (checkIE = document.createElement("b")).innerHTML = ""; 
      var isIE = checkIE.getElementsByTagName("i").length == 1;
      
      /* IE 10 */
      var isIE = eval("/*@cc_on!@*/false") && document.documentMode === 10;
      
      /* IE 10 */
      var isIE = document.body.style.msTouchAction != undefined;
      

  • Safari
    • Selector
    • /* Safari 2/3 */
      html[xmlns*=""] body:last-child .selector {} 
      html[xmlns*=""]:root .selector  {}
      
      /* Safari 2/3.1, Opera 9.25 */
      *|html[xmlns*=""] .selector {}
      
      /* Safari 5- and Chrome 24- */
      ::made-up-pseudo-element, .selector {}
      
    • Media Query
    • /* Safari 3+, Chrome */
      @media screen and (-webkit-min-device-pixel-ratio:0) {}
    • JavaScript
      /* Safari */
      var isSafari = /a/.__proto__=='//';
      



Posted by leechwin
,

Eclipse 의 WTP(Web Tool Platform) 에 대한 정리



Posted by leechwin
,