Skip to content

Instantly share code, notes, and snippets.

View devheedoo's full-sized avatar
☺️
React + TypeScript

heedo devheedoo

☺️
React + TypeScript
  • Growdle
  • Seoul, South Korea
View GitHub Profile
@devheedoo
devheedoo / checkboxOptionAll.js
Created September 23, 2016 04:47
Checkboxs which contain 'All' checkbox
/**
* If you click 'All' checkbox, other checkboxs are cancelled.
*/
/* HTML Sample Code: Checkboxs which contains 'All' checkbox. */
// <input type="checkbox" name="hdBox" id="hdBoxAll" value="30000" onclick="checkHdBoxes(this);" checked /><label for="hdBoxAll">전체</label>
// <input type="checkbox" name="hdBox" id="hdBox1" value="30110" onclick="checkHdBoxes(this);" /><label for="hdBox1">지역1</label>
// <input type="checkbox" name="hdBox" id="hdBox2" value="30140" onclick="checkHdBoxes(this);" /><label for="hdBox2">지역2</label>
// <input type="checkbox" name="hdBox" id="hdBox3" value="30170" onclick="checkHdBoxes(this);" /><label for="hdBox3">지역3</label>
// <input type="checkbox" name="hdBox" id="hdBox4" value="30200" onclick="checkHdBoxes(this);" /><label for="hdBox4">지역4</label>
@devheedoo
devheedoo / checkUserMobile.js
Created September 23, 2016 04:41
Check user's agent is mobile or not.
var UserAgent = navigator.userAgent;
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
location.href = "/mobile/index.html";
}