I have a little issue that I couldn't figure out. I have a slider and I want to change url when I click prev and next buttons. Here are my codes below but it doesn't work correctly. Every time I click the button, url appending instead of replacing.
var url = window.location.href;
url = url + "page/" + 1; // this number is dynamic actually
window.location.href = url;
For instance it displays; http://ift.tt/28OK2SY and I clicked http://ift.tt/28QKtRm and again http://ift.tt/28OK11h
But I just want to replace it http://ift.tt/28QKtRm to http://ift.tt/28QKvs9
How can I fix it? Thank you for your help.
Aucun commentaire:
Enregistrer un commentaire