Last active
April 9, 2017 21:01
-
-
Save trigolgy/097b41a01d659a399d48abee3283bce5 to your computer and use it in GitHub Desktop.
guncel tarihe gore sayfa yonlendirmesi yapan js metodu
This file contains 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
function load() { | |
var date = new Date(); | |
var currentDay = date.getDate(); | |
var currentMonth = date.getMonth(); | |
var currentDayStr = currentDay.toString(); | |
var currentMonthStr = currentMonth.toString(); | |
var day_month = currentDayStr.concat('-',currentMonthStr); | |
console.log(currentDay ); | |
console.log(currentMonth ); | |
console.log(day_month ); | |
switch (day_month) { | |
// yeni yil | |
case '01-0': | |
window.location.href = "www.google.com"; | |
break; | |
// 23 nisan | |
case '23-3': | |
window.location.href = "www.tubitak.gov.tr"; | |
break; | |
// 19 mayis | |
case '19-4': | |
window.location.href = "https://www.tbmm.gov.tr"; | |
break; | |
} | |
} | |
window.onload = load; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment