Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Weird javascript error with the .split() string method in Chrome browser
- $(document).ready(function() {
- currentURL = window.location.pathname + "/order=vote/genres=/dates=";
- $(".date").click(function() {
- var thisButton = $(this);
- if (thisButton.html() == 'Today') {
- var dateText = 'today';
- } else if (thisButton.html() == 'All') {
- var dateText = 'all';
- } else {
- var dateText = '';
- }
- console.log(currentURL);
- var splitURL = currentURL.split('dates=');
- var filterDateURL = splitURL[0] + 'dates=' + dateText;
- $.ajax({
- url: filterDateURL,
- success: function(response) {
- $("#show_container").html($("#show_container", response).html());
- $("#genre_filters").html($("#genre_filters", response).html());
- currentURL = filterDateURL;
- // add selected to this button, remove from other date filters
- thisButton
- .addClass('selected')
- .removeClass('unselected')
- .siblings("a")
- .removeClass('selected')
- .addClass('unselected');
- }
- });
- return false;
- });
- });
- if (console && console.log){
- console.log(currentURL);
- }
Add Comment
Please, Sign In to add comment