url search params - Basit Al Fath

Jumat, 16 Oktober 2026

url search params

 Mengirim id dan emindahkan halaman


const showDetail = (id) => {
window.location.href = `./detail.html?id=${id}`
}


mengambil id dari url


const params = new URLSearchParams(window.location.search)
const id = params.get('id')



Comments


EmoticonEmoticon