19 Eylül 2019 Perşembe
JavaScript or JQuery redirect to URL on select
JavaScript:
<select onChange="window.document.location.href=this.options[this.selectedIndex].value;">
<option vlaue="http://deneme.com/">Option 1</option>
<option vlaue="http://deneme.net/">Option 2</option>
<option vlaue="http://deneme.org/">Option 3</o
jQuery:
jQuery(function($) {
$('select').on('change', function() {
var url = $(this).val();
if (url) {
window.location = url;
}
return false;
});
});
18 Eylül 2019 Çarşamba
Web sayfasında geri tuşunu pasif etmek ...
history.pushState(null, null, location.href);
window.addEventListener('popstate', function (event) {
// The popstate event is fired each time when the current history entry changes.
var r = false;// confirm("Geri butonu çalışmayacak..?!");
if (r == true) {
// Call Back button programmatically as per user confirmation.
history.back();
// Uncomment below line to redirect to the previous page instead.
// window.location = document.referrer // Note: IE11 is not supporting this.
} else {
// Stay on the current page.
history.pushState(null, null, window.location.pathname);
}
history.pushState(null, null, window.location.pathname);
}, false);
window.addEventListener('popstate', function (event) {
// The popstate event is fired each time when the current history entry changes.
var r = false;// confirm("Geri butonu çalışmayacak..?!");
if (r == true) {
// Call Back button programmatically as per user confirmation.
history.back();
// Uncomment below line to redirect to the previous page instead.
// window.location = document.referrer // Note: IE11 is not supporting this.
} else {
// Stay on the current page.
history.pushState(null, null, window.location.pathname);
}
history.pushState(null, null, window.location.pathname);
}, false);
Kaydol:
Kayıtlar (Atom)