同じLAN内の他PCやスマートフォンから、 ローカルで公開している画面にアクセスできるよう設定する方法です。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*################################################# | |
# imgタグをレスポンシブ | |
#################################################*/ | |
<style> | |
.parent { | |
height:50vh; // 高さの指定は必要 | |
position:relative; | |
overflow:hidden; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get all users | |
var url = "http://localhost:8080/api/v1/users"; | |
var xhr = new XMLHttpRequest() | |
xhr.open('GET', url, true) | |
xhr.onload = function () { | |
var users = JSON.parse(xhr.responseText); | |
if (xhr.readyState == 4 && xhr.status == "200") { | |
console.table(users); | |
} else { | |
console.error(users); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See: Introduction to Range | |
// http://www.quirksmode.org/dom/range_intro.html | |
var range = document.createRange(); | |
// In which DOM node does the Range start or end? | |
range.setStart(selectionObject.anchorNode, selectionObject.anchorOffset); | |
// At which text offset does the Range start or end? The text offset is the position of the first or last character in the text node that's part of the Range. | |
range.setEnd(selectionObject.focusNode, selectionObject.focusOffset); |