Created
October 26, 2019 18:23
-
-
Save jirawatee/4dde7b2ff60da830b1bd335d94353e48 to your computer and use it in GitHub Desktop.
LIFF v2 - Query String
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
<script> | |
const medium = 'https://medium.com/linedevth/'; | |
const queryString = decodeURIComponent(window.location.search).replace("?liff.state=", ""); | |
const params = new URLSearchParams(queryString); | |
const id = params.get('id'); | |
if (id != null && id != '') { | |
window.location.assign(medium + id); | |
} else { | |
window.location.assign("https://developers.line.biz"); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment