Don’t use .replace()
for this, just assign the value directly.
$("body").keydown(function(event) { if(event.keyCode == 37) { // left window.location = "http://newsii.abudayah.com/photo/2"; } else if(event.keyCode == 39) { // right window.location = "http://newsii.abudayah.com/photo/31"; } });
Related Posts:
- How do I redirect to another webpage?
- How do I redirect to another webpage?
- How to manage a redirect request after a jQuery Ajax call
- window.location.href and window.open () methods in JavaScript
- Cross-Origin Read Blocking (CORB)
- What does [object Object] mean?
- Remove class using jQuery
- How do I check whether a checkbox is checked in jQuery?
- How to make history.back() without getting a warning on the browser to reload the page?
- convert Hsl to rgb and hex
- JQuery – $ is not defined
- jQuery: Wait/Delay 1 second without executing code
- How to solve ‘Redirect has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header’?
- jQuery setTimeout() Function [duplicate]
- How can I refresh a page with jQuery?
- How to add jQuery code into HTML Page
- What does jQuery.fn mean?
- JavaScript replace/regex
- Nested JSON objects – do I have to use arrays for everything?
- How to find the sum of an array of numbers
- Bootstrap Dropdown menu is not working
- jquery SlideToggle effect in upward direction?
- How can I determine if a variable is ‘undefined’ or ‘null’?
- jQuery AJAX cross domain
- Set timeout for ajax (jQuery)
- jQuery AJAX submit form
- How can I upload files asynchronously with jQuery?
- How do I format date in jQuery datetimepicker?
- How to use npm jquery module?
- Jquery swipe left or right on mobile
- How to move an element into another element?
- What is causing the error `string.split is not a function`?
- bootstrap-datetimepicker for bootstrap 4
- Proper way to wait for one function to finish before continuing?
- Uncaught TypeError: data.push is not a function
- What is causing the error `string.split is not a function`?
- How do I get an element to scroll into view, using jQuery?
- How do I check if string contains substring? [duplicate]
- How to check a radio button with jQuery?
- Get current URL with jQuery?
- explode string in jquery
- TypeError: $(…).modal is not a function with bootstrap Modal
- document.getElementsByClassName().innerHTML always returns “undefined”
- How to add a “readonly” attribute to an ?
- JQuery $(“#content”).append not working
- jQuery: Check if div with certain class name exists
- using jQuery $(this).addClass not working, simple code not working
- Why is this jQuery click function not working?
- How to uncheck a radio button?
- Phone mask with jQuery and Masked Input Plugin
- JQuery get all elements by class name
- How to change value of object which is inside an array using JavaScript or jQuery?
- How to detect pressing Enter on keyboard using jQuery?
- Attaching ‘onclick’ event to D3 chart background
- The preferred way of creating a new element with jQuery
- Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded
- What is jQuery Unobtrusive Validation?
- CreateElement with id?
- How to get height of div in px dimension
- Set value of hidden input with jquery
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- Creating a div element in jQuery
- How to use in jQuery :not and hasClass() to get a specific element without a class
- What is the best way to remove a table row with jQuery?
- Get class list for element with jQuery
- Convert array to JSON
- How to disable scrolling temporarily?
- How do you remove all the options of a select box and then add one option and select it with jQuery?
- Add and remove multiple classes in jQuery
- How to get unique values in an array
- jQuery: Get selected element tag name
- Only on Firefox “Loading failed for the script with source”
- How to add a button dynamically using jquery
- Why is jquery show() not working in example
- How can I use jQuery to run MySQL queries?
- jQuery if Element has an ID?
- Complex JSON nesting of objects and arrays
- jQuery – Increase the value of a counter when a button is clicked
- Print a div content using Jquery
- How can JavaScript save to a local file?
- Download a file by jQuery.Ajax
- Defining a HTML template to append using JQuery
- jQuery select option elements by value
- How to change cursor from pointer to finger using jQuery?
- jQuery equivalent of body onLoad
- Replace spaces with dashes and make all letters lower-case
- Simulate a click on ‘a’ element using javascript/jquery
- How to use aria-expanded=”true” to change a css property
- How to pre-fill Google Forms URLs with logged-in WordPress user’s data
- WordPress loads whole jQuery UI library
- How can I get my Calculate Contact Form 7 field to update with jQuery? [closed]
- Contact Form 7 – Uncaught TypeError: wpcf7.initForm is not a function [closed]
- contact form 7 repeatable fields calculations [closed]
- How to set javascript options for select2 in PHP array of plugin
- how to prevent added meta box from being injected with style=”position: fixed; top: 56px;” at scroll down
- How to run Javascript popup modal in a loop?
- Remove escape characters from JSON string pulled from a database
- WordPress Theme – jQuery JavaScript Library Issue
- Access jQuery tabs from primary menu while adding/removing class on tab container elements (accessing diff. tabs/tab content via primary menu items)