<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="https://star12ap.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://star12ap.github.io/" rel="alternate" type="text/html" /><updated>2019-12-23T10:17:22+00:00</updated><id>https://star12ap.github.io/feed.xml</id><title type="html">데욱이의 블로그</title><subtitle>DK's Blog</subtitle><author><name>DeukWon Seo</name></author><entry><title type="html">AjaxCall의 Async가 false일 때</title><link href="https://star12ap.github.io/frontend/ajaxasyncopt/" rel="alternate" type="text/html" title="AjaxCall의 Async가 false일 때" /><published>2019-08-23T00:00:00+00:00</published><updated>2018-08-23T14:45:00+00:00</updated><id>https://star12ap.github.io/frontend/ajaxasyncopt</id><content type="html" xml:base="https://star12ap.github.io/frontend/ajaxasyncopt/">&lt;h2 id=&quot;explain&quot;&gt;Explain&lt;/h2&gt;

&lt;p&gt;ajax로 여러가지를 하다보니 다음과 같은 현상이 있었다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;기본적으로 ajaxcall을 할 때 사용하는 XMLHttpRequest.open에서 async 옵션을 false로 줘도 ajaxcall 이전의 것은 painting을 한다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;1의 조건에서 onreadystatechange에 alert시 painting을 하지 않는다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;1의 조건에서 서버측이 thread.sleep을 가지고 있는 경우 ajaxcall이전의 것도 그려지지 않는다.(painting이 안됨)&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3번을 막으려면 아마도 setTimeOut으로 따로 ajaxcall을 큐에 넣어 앞의 것을 painting 해야하지 않을까 싶은데..&lt;/p&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;
&lt;p&gt;1번 - onreadystatechange를 실행하기 전 red로 배경색이 칠해짐&lt;/p&gt;
&lt;div class=&quot;language-markdown highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;style=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;height:100px; background-color:red&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'main'&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  const ajax = () =&amp;gt; {
    var request = new XMLHttpRequest();
    
    request.onreadystatechange = function ()  {
      if (this.readyState == 4 &amp;amp;&amp;amp; this.status == 200){ 
        // alert(1);
        document.querySelector(&quot;#main&quot;).innerText = this.responseText
      }
    }
    request.open(&quot;GET&quot;, &quot;./test.jsp&quot;, false); // 동기 상태
    request.send();
  }
  ajax();  
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;2번 - onreadystatechange를 실행하기 전 red로 배경색이 칠해지지 않음&lt;/p&gt;
&lt;div class=&quot;language-markdown highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;style=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;height:100px; background-color:red&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'main'&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  const ajax = () =&amp;gt; {
    var request = new XMLHttpRequest();
    
    request.onreadystatechange = function ()  {
      if (this.readyState == 4 &amp;amp;&amp;amp; this.status == 200){ 
        alert(1);
        document.querySelector(&quot;#main&quot;).innerText = this.responseText
      }
    }
    request.open(&quot;GET&quot;, &quot;./test.jsp&quot;, false); // 동기 상태
    request.send();
  }
  ajax();  
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;3번 - onreadystatechange를 실행하기 전 red로 배경색이 칠해지지 않음&lt;/p&gt;
&lt;div class=&quot;language-markdown highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// 클라이언트
&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;style=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;height:100px; background-color:red&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'main'&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  const ajax = () =&amp;gt; {
    var request = new XMLHttpRequest();
    
    request.onreadystatechange = function ()  {
      if (this.readyState == 4 &amp;amp;&amp;amp; this.status == 200){
        document.querySelector(&quot;#main&quot;).innerText = this.responseText
      }
    }
    request.open(&quot;GET&quot;, &quot;./test.jsp&quot;, false); // 동기 상태
    request.send();
  }
  ajax();  
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

// 서버
&lt;span class=&quot;nt&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%@&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;language=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;java&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;contentType=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/html; charset=UTF-8&quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;pageEncoding=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;%
  request.setCharacterEncoding(&quot;utf-8&quot;);
  response.setContentType(&quot;text/html&quot;);
  response.setStatus(200);
  
  Thread.sleep(5000)
  String result = &quot;받았어요&quot;;
  
  out.print(result);
  
  
%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>DeukWon Seo</name></author><category term="ajax" /><category term="async" /><summary type="html">Explain</summary></entry><entry><title type="html">마우스 클릭 이벤트 순서(mouse click event)</title><link href="https://star12ap.github.io/frontend/mouseevent/" rel="alternate" type="text/html" title="마우스 클릭 이벤트 순서(mouse click event)" /><published>2019-08-17T00:00:00+00:00</published><updated>2018-08-17T12:42:00+00:00</updated><id>https://star12ap.github.io/frontend/mouseevent</id><content type="html" xml:base="https://star12ap.github.io/frontend/mouseevent/">&lt;h2 id=&quot;explain&quot;&gt;Explain&lt;/h2&gt;

&lt;p&gt;마우스 클릭시 발생하는 이벤트 순서는 onmousedown -&amp;gt; onmouseup -&amp;gt; click 순이다.&lt;/p&gt;

&lt;p&gt;onmousedown되고 onclick 되고 onmouseup아닌가라고 생각하기 쉬운데 아니더라.. ㅋ&lt;/p&gt;

&lt;p&gt;참고로 onmousedown에서 alert를 띄우면 클릭해도 onmouseup, onclick 이벤트 모두 발생하지 않지만, onmouseup에서 alert를 띄우면 onclick까지 정상적으로 먹는다.&lt;/p&gt;

&lt;p&gt;보아하니 down에서 alert시에는 이벤트가 끊기지만 up에서 alert를 하는 경우는 down에서 먹은 이벤트가 up과는 별개로 click까지 가는 모양이다.&lt;/p&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  const eventWriter = (e) =&gt; {
    document.getElementById(&quot;test&quot;).textContent += (event &amp;&amp; event.type) + &quot; &quot; ;
  }
&lt;/script&gt;

&lt;div style=&quot;vertical-align: middle&quot;&gt;
  &lt;div onclick=&quot;eventWriter(this)&quot; onmousedown=&quot;if (document.querySelector('select').selectedIndex == 1) {alert('onmousedown');}eventWriter(this)&quot; onmouseup=&quot;if (document.querySelector('select').selectedIndex == 2) {alert('onmouseup');} eventWriter(this)&quot; style=&quot;font-size: initial; background-color:black; text-align: center; color:white; width:50px; height:25px; display:inline-block; cursor:pointer&quot;&gt;
    클릭
  &lt;/div&gt;
  &lt;div style=&quot;font-size: initial; background-color:black; text-align: center; color:white; width:75px; height:25px; cursor:pointer; display:inline-block;&quot; onclick=&quot;document.getElementById('test').textContent=''&quot;&gt;클리어&lt;/div&gt;
  &lt;label style=&quot;font-size: initial; display:inline-block; margin: 0px 0px 0px 25px; vertical-align: middle;&quot;&gt; alert &lt;/label&gt;
  &lt;select style=&quot;font-size: initial; display:inline-block; margin: 0px; padding:0px; height:28px; vertical-align: middle&quot;&gt;
    &lt;option&gt;추가 안함(default)&lt;/option&gt;
    &lt;option&gt;mousedown에 추가&lt;/option&gt;
    &lt;option&gt;mouseup에 추가&lt;/option&gt;
  &lt;/select&gt;
  &lt;div id=&quot;test&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</content><author><name>DeukWon Seo</name></author><category term="mouse" /><category term="event" /><category term="onmouseup" /><category term="onmousedown" /><category term="onclick" /><summary type="html">Explain</summary></entry><entry><title type="html">IE 스크롤 제약 사항(IE scroll limit)</title><link href="https://star12ap.github.io/frontend/iescrolllimit/" rel="alternate" type="text/html" title="IE 스크롤 제약 사항(IE scroll limit)" /><published>2019-08-15T00:00:00+00:00</published><updated>2018-08-15T13:42:00+00:00</updated><id>https://star12ap.github.io/frontend/iescrolllimit</id><content type="html" xml:base="https://star12ap.github.io/frontend/iescrolllimit/">&lt;h2 id=&quot;explain&quot;&gt;Explain&lt;/h2&gt;

&lt;p&gt;IE에는 스크롤할 수 있는 양의 제약이 있다.&lt;/p&gt;

&lt;p&gt;정확히 말하자면 스크롤 내에 들어갈 수 있는 픽셀수가 제약이 있는데, 이는 대략 1533767px 이다.&lt;/p&gt;

&lt;p&gt;저 정도를 넘어갈일은 없지만 대용량 데이터를 로딩하는 경우 일부 데이터가 스크롤이 안될 문제가 발생할수 있겠다.&lt;/p&gt;

&lt;p&gt;아래 예제를 ie에서 해보자.&lt;/p&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;
&lt;div&gt;
  &lt;div style=&quot;float:left; width:150px;&quot;&gt;1704803px&lt;/div&gt;
  &lt;div style=&quot;float:left; width: 34px; height: 150px; overflow-y: auto; margin-left: -17px; -ms-overflow-y: auto;&quot; onscroll=&quot;this.nextSibling.nextSibling.innerHTML = this.scrollTop&quot;&gt;
      &lt;div style=&quot;width: 1px; height: 1704803px; overflow: hidden;&quot;&gt;&amp;nbsp;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div style=&quot;float:left; width:150px;&quot;&gt;&amp;nbsp;&lt;/div&gt;
  &lt;div style=&quot;float:left; width:150px;&quot;&gt;1531000px&lt;/div&gt;

  &lt;div style=&quot;float:left; width: 34px; height: 150px; overflow-y: auto; margin-left: -17px; -ms-overflow-y: auto;&quot; onscroll=&quot;this.nextSibling.nextSibling.innerHTML = this.scrollTop&quot;&gt;
      &lt;div id=&quot;s&quot; style=&quot;width: 1px; height: 1531000px; overflow: hidden;&quot;&gt;&amp;nbsp;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div style=&quot;float:left; width:150px;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;</content><author><name>DeukWon Seo</name></author><category term="ie" /><category term="html" /><category term="scroll" /><summary type="html">Explain</summary></entry><entry><title type="html">minimal mistakes 테마를 이용해 github.io 블로그 구축하기</title><link href="https://star12ap.github.io/blogging/myfirst/" rel="alternate" type="text/html" title="minimal mistakes 테마를 이용해 github.io 블로그 구축하기" /><published>2019-08-10T00:00:00+00:00</published><updated>2018-08-10T11:00:00+00:00</updated><id>https://star12ap.github.io/blogging/myfirst</id><content type="html" xml:base="https://star12ap.github.io/blogging/myfirst/"></content><author><name>DeukWon Seo</name></author><summary type="html"></summary></entry></feed>