Notice
Recent Posts
Recent Comments
Link
| ์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- optionํ๊ทธ
- Spring
- ๋์ปค
- JSP
- ๋์ ํ ์ด๋ธ
- ๋ช ๋ น์ด
- SQL
- order by
- select
- JS
- ๋์
- like
- ์ฝํ
- JavaScript
- ์ธ๋ผ์ธ๋ทฐ
- ๋ณ์
- oracle
- ํ ์ด๋ธ
- ํจ์
- ํ๋ก๊ทธ๋๋จธ์ค
- Update
- Ajax
- ์ปจํธ๋กค๋ฌ
- ๋ฐฐ์ด
- ๋ฆฌ๋ ์ค
- DATE_FORMAT
- ์๋ฐ์คํฌ๋ฆฝํธ
- post๋ฐฉ์
- ๋ฐฑํฑ
- MySQL
Archives
- Today
- Total
bom's happy life
์๋ฆผ์ฐฝ(alert)๋์ฐ๊ณ ํ์ด์ง ์ด๋ํ๊ธฐ(๋ฆฌ๋ค์ด๋ ํธ) ๋ณธ๋ฌธ
Deveolpment Study๐๏ธ/Javascript
์๋ฆผ์ฐฝ(alert)๋์ฐ๊ณ ํ์ด์ง ์ด๋ํ๊ธฐ(๋ฆฌ๋ค์ด๋ ํธ)
bompeach 2023. 5. 15. 18:04alert ๋์ฐ๊ณ sendRedirect ํ๋ฉด alert๊ฐ ์๋ฌ๋ค.
location.href์ฐ๋ฉด alert ๋จ๊ณ ํ์ด์ง ์ด๋์ด ์๋๋ค.
<script type="text/javascript">
alert("์ถ๊ฐ ๋์์ต๋๋ค. ");
location.href = "/์ด๋ํ ์ฃผ์";
</script>
.
.
.
์๋๋ ์ด์ ํ์ด์ง๋ก ์ด๋์ํฌ ๋ ์ฌ์ฉํ๋ค.
-1์ด๋ฉด ํ์ฌ์์ ๋ฐ๋ก ์ ์ผ๋ก ๊ฐ๋๊ฑฐ๊ณ
0์ด๋ฉด ํ์ฌ ํ์ด์ง ์๋ก๊ณ ์นจ๋๋ค.
history.go(-1); //๋ฐ๋ก ์ ํ์ด์ง๋ก ์ด๋
history.back();
history.go(0); //ํ์ฌ ํ์ด์ง ์๋ก๊ณ ์นจ
history.go();
<script type="text/javascript">
alert("์ถ๊ฐ ๋์์ต๋๋ค. ");
history.go(-1);
</script>
[์ถ์ฒ] alert ๋์ฐ๊ณ ํ์ด์ง ๋ฆฌ๋ค์ด๋ ํธ ํ๊ธฐ|์์ฑ์ ํ์
- ์๋ฆผ์ฐฝ ๋์ฐ๊ณ ํน์ ํ์ด์ง๋ก ์ด๋ํ๊ธฐ
<button onclick="test()">ํด๋ฆญ</button>
<script>
function test() {
alert("test ์
๋๋ค.");
window.location.href = "https://naver.com";
}
</script>
'Deveolpment Study๐๏ธ > Javascript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| ๊ฐ๋ฐ๊ณต๋ถํ๊ธฐ ์ข์ ๋ธ๋ก๊ทธ (0) | 2023.05.18 |
|---|---|
| js ๋ฌธ๋ฒ ์ฌ์ฉ๋ฒ ์ฌ์ดํธ (0) | 2023.05.15 |
| ์นด์ดํธ๋ค์ด๋ง๋ค๊ธฐ (0) | 2023.03.21 |
| ํ ์ด๋ ๋ฒํผ ๋ง๋ค๊ธฐ (0) | 2023.03.15 |
| ์ฌ๋ผ์ด๋ ๋ง๋ค๊ธฐ (0) | 2023.03.13 |