You should be able to use a relative URL.
window.location.replace("/contact-us");
If that code was run on any page on example.com, it would redirect to example.com/contact-us
Related Posts:
- Retrieve POST data from AJAX call
- JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error
- Detect a focus on wp_editor
- WordPress Ajax always returns a 404 error
- problem with ajax and the path to the php page
- How to use wp_localize_script in a WordPress page other than functions.php?
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- How to stop loading multiple copies of jquery
- Update WordPress Custom Field with AJAX on cached page
- Targeting single page with JS
- JS completely stopped loading but Files are found
- Click loads template via ajax
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- Loading jQuery in the footer after removing jQuery migrate?
- Returning a value from a PHP page
- Sending jsPDF documents to the server
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Using shipped version of jquery
- js file in root loading without
- WooCommerce – Reset quantity input field when variation changes
- Checking for new message using AJAX and PHP. Server overload?
- jQuery not defined
- AJAX request status 200 but no actual “response”
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Is there a way to programmatically create multiple pages utilizing the same template but different content from a json file?
- How to design a table based on css values set from admin/dashboard
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Adding Custom Slider
- Save Search System
- dynamic dependent select dropdown
- Change “add to cart” button color based on Woocommerce product category [closed]
- Ajax request returns ‘Array’. How to output the actual results?
- Ajax load more button for comments wordpress
- Slick + PHP + ACF + JQuery slide reveal not working
- Gravity form built in Captcha
- Show success or error messages in Ajax response to WordPress custom registration form
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Fancybox type popup window that’s not an iframe
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- Form Security: nonce vs. jQuery
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- Pull GetOption() variable into jQuery dynamically created html
- Royalty-Free Sliders used in theme development
- Error – ‘create_function is deprecated’ [closed]
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- Is it save to use eval for a jQuery callback method coming from the database?
- Double jQuery loaded
- Trying to prepend a Hashtag symbol to the_tags links [closed]
- Javascript not loading on certain page
- WordPress plugin admin page – using WordPress function in linked php file
- A $_POST should occur when submit form but is not?
- Shortcode to pull posts
- Ajax search shows all results when user empties input?
- Why i can’t get custom fields value or post ID via Ajax?
- Get uploaded image and attach it to the new post
- Admin-ajax php not working on new wordpress version
- How to add post thumbnail dynamically using Jquery?
- calling function in external js file
- How to refresh a page from jquery [closed]
- Add a counter for mouseovers (custom field)
- Accessing an API with jQuery and AJAX
- Unexpected token ILLEGAL, even on clean install – jquery-issue?
- Admin Menu new tab external link
- How to set variables with AJAX request to use in another function in WordPress
- Add other class content with reference class value
- Ajax result show in console if is called outside function and not showing in array
- WordPress – Query specific category and automatically change category each month
- How to change PHP variables with AJAX request in WordPress
- WordPress ajax filter returning all posts when it should be filtering by category
- Remove specific javascript when viewing page in Customizer?
- Input field duplicates on form submit by jQuery
- How to echo a PHP code into WooCommerce variation product?
- include javascript Multiple files in wordpress through script.js
- Let user select the number of posts shown per page jquery error
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- Find the method which AJAX GET calls
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- How to create a radio button to alt between settings in wp_options table
- WordPress AJAX load post metadata in modal
- Add a downloaded JS file to WordPress
- How to call javascript function (jquery) in a shortcode?
- How to run ajax in WordPress Post?
- How can I correctly POST to a WordPress page?
- Adding instant search to wordpress page
- Add php function into .js file (for tinyMCE button)
- I am trying to call external database recieving error
- reorder a WP_Query, using a dropdown
- Edit Image/Image Details – Replace button missing
- JSON Object Value Show Undefine
- Adding jquery using php function
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- Different behaviour between “include_once” and directly echoing out html code?
- notify users when changed database
- How to use js variable to php in wordpress functions.php
- ajax problems on loading page [closed]
- generate excerpt from the part of big text dump that contains keyword
- Retrive the value of the Active variation of the product and then link it to the “read more” to dynamically change
- custom AJAX filtering logic and outputting results into an Elementor Loop Grid widget
- JQuery UI Autocomplete showing as bullets
- Partial refresh in WordPress live preview