반응형
반응형

Node.js 웹서버로 만들기   http://localhost:3000

 

var http = require('http');
var fs = require('fs');
var app = http.createServer(function(request,response){
    var url = request.url;
    if(request.url == '/'){
      url = '/index.html';
    }
    if(request.url == '/favicon.ico'){
      //return response.writeHead(404);
      response.writeHead(404);
      response.end();
      return;
    }
    response.writeHead(200);
    console.log(__dirname + url);
    response.end(fs.readFileSync(__dirname + url));

});
app.listen(3000);

 

https://youtu.be/VGZTn1diz_I

 

opentutorials.org/course/3332/21032

 

Node.js - 웹서버 만들기 - 생활코딩

수업소개 Node.js는 웹서버 기능을 가지고 있습니다. 이런 특성을 이용해서 컨텐츠를 프로그래밍적으로 생산할 수 있게 됩니다. 여기서는 Node.js를 웹서버로 구동하는 방법을 살펴보겠습니다.  강

opentutorials.org

소스 : github.com/web-n/web1_html_internet

 

web-n/web1_html_internet

Contribute to web-n/web1_html_internet development by creating an account on GitHub.

github.com

 

반응형
반응형

nodejs.org/ko/들어가서 다운로드 후 설치.

 

설치 후 CMD 뛰워서 아래와 같이 버전 및 실행 테스트. 

 

C:\Users\HWKim>node -v
v14.15.1

C:\Users\HWKim>node
Welcome to Node.js v14.15.1.
Type ".help" for more information.
> console.log(1+1)
2
undefined
> console.log(1+1);
2
undefined
>
(To exit, press Ctrl+C again or Ctrl+D or type .exit)
>

C:\Users\HWKim>

강의 리스트 : opentutorials.org/course/3332

 

WEB2 - Node.js - 생활코딩

수업소개 이 수업은 JavaScript를 이용해서 Node.js를 제어해 동적으로 HTML 코드를 생성하는 웹애플리케이션을 만드는 방법에 대한 수업입니다.  수업대상 예를들어 1억개의 페이지로 이루어진 웹사

opentutorials.org

유튜브 재생목록 : www.youtube.com/playlist?list=PLuHgQVnccGMA9QQX5wqj6ThK7t2tsGxjm

 

WEB2 - Node.js

 

www.youtube.com

 

반응형
반응형

javascript Chart circular gauge color-bar

 

jscharting.com/examples/chart-types/circular-gauge/colorbar-marker/#

 

JavaScript Circular ColorBar Marker Chart | JSCharting

Gauge with axis line breaks and a point on top of the axis line.

jscharting.com

반응형

'프로그래밍 > Web' 카테고리의 다른 글

AWSOME DAY 온라인 컨퍼런스  (0) 2020.11.24
Active Server Pages (ASP)  (0) 2020.11.17
Windows의 ASP (Active Server Pages) 지원  (0) 2020.11.16
Ajaxload gif  (0) 2020.11.09
인풋박스(input) 기본입력 설정 ime-mode  (0) 2020.10.30
반응형

jQuery 데이터 속성 값을 기반으로 요소를 찾는 방법은 무엇입니까?

jQuery how to find an element based on a data-attribute value?

 

jQuery how to find an element based on a data-attribute value?

I've got the following scenario: var el = 'li'; and there are 5

  • 's on the page each with a data-slide=number attribute (number being 1,2,3,4,5 respectively). I now need to find the cur...

     

    stackoverflow.com

I've got the following scenario:

var el = 'li';

and there are 5 <li>'s on the page each with a data-slide=number attribute (number being 1,2,3,4,5 respectively).

I now need to find the currently active slide number which is mapped to var current = $('ul').data(current); and is updated on each slide change.

So far my tries have been unsuccessful, trying to construct the selector that would match the current slide:

$('ul').find(el+[data-slide=+current+]);

does not match/return anything…

The reason I can't hardcode the li part is that this is a user accessible variable that can be changed to a different element if required, so it may not always be an li.

반응형
반응형

How to format $.now() with Jquery

 

$.now() gives me the time as miliseconds. I need to show it something like hh:mm:ss

$ .now ()는 시간을 밀리 초 단위로 제공합니다. hh : mm : ss와 같이 표시해야합니다.

How to format $.now() with Jquery

 

function formatTimeOfDay(millisSinceEpoch) {
  var secondsSinceEpoch = (millisSinceEpoch / 1000) | 0;
  var secondsInDay = ((secondsSinceEpoch % 86400) + 86400) % 86400;
  var seconds = secondsInDay % 60;
  var minutes = ((secondsInDay / 60) | 0) % 60;
  var hours = (secondsInDay / 3600) | 0;
  return hours + (minutes < 10 ? ":0" : ":")
      + minutes + (seconds < 10 ? ":0" : ":")
      + seconds;
}

.

반응형
반응형

 jQuery - append, prepend, after, before

 

before : 선택한 요소의 앞에 내용 삽입

after : 선택한 요소의 뒤에 내용 삽입 

prepend : 선택한요소의 자식요소 앞에 내용삽입

append : 선택한요소의 자식요소 뒤에 내용삽입

after() Inserts content after selected elements
before() Inserts content before selected elements
append() Inserts content at the end of selected elements
prepend() Inserts content at the beginning of selected elements

 

 

.

반응형

+ Recent posts