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?
- Load custom field value into div with AJAX
- 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
- js file in root loading without
- WooCommerce – Reset quantity input field when variation changes
- class click counter save number
- 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
- WordPress Sending data to Ajax with select option
- 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
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- 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
- 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
- How to disable controls in theme customizer?
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- Form Security: nonce vs. jQuery
- How do I Import / Upload Files with jQuery AJAX?
- Why does wp_head hook my functions to the beginning of my source code?
- Automatically set all tags to have a height of 0 if there is no content inside the tag [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?
- Function won’t run onclick using Ajax
- WordPress plugin admin page – using WordPress function in linked php file
- A $_POST should occur when submit form but is not?
- How to use the wpsnonce clone post link?
- Shortcode to pull posts
- How to add post thumbnail dynamically using Jquery?
- calling function in external js file
- How to refresh a page from jquery [closed]
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Execute PHP code only with specific user role
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- WordPress – Query specific category and automatically change category each month
- Admin-ajax.php 404 error
- How to pass values from one function to the other using an array variable
- How to change PHP variables with AJAX request in WordPress
- If user has clicked link add class and store using PHP/WordPress
- Update $wpdb query with AJAX
- AJAX to add to cart multiple products woocommerce
- How to create an Email Subscription input in WordPress?
- WordPress ajax filter returning all posts when it should be filtering by category
- Remove specific javascript when viewing page in Customizer?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- Remove item from post_meta array via AJAX
- WordPress load javascript file if something… (after the page is loaded)
- Let user select the number of posts shown per page jquery error
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- I was wondering if it’s possible to implement card.js on WordPress
- AJAX Filter WHILE Loop not working WordPress
- 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 pagination
- WordPress AJAX load post metadata in modal
- Form not working as it should in WordPress, but in a normal HTML site it does
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- AJAX Not Working With WordPress Database properly
- 500 (Internal Server Error) of external php file
- How can I correctly POST to a WordPress page?
- Adding instant search to wordpress page
- Fatal error: Call to a member function get_results() on a non-object in on line 26
- What is the best way to get the first few post from WordPress in different divs using a loop?
- jQuery vs. $ – Creating jQuery scripts in JavaScript in WordPress using External Libraries
- reorder a WP_Query, using a dropdown
- Edit Image/Image Details – Replace button missing
- Use ajax response in PHP function
- 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
- getJSON response to PHP
- generate excerpt from the part of big text dump that contains keyword
- get_post_meta returns on side but it doesn’t return on bottom of admin page