This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); | |
const param = urlParams.get('param'); | |
console.log(param ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_request = json_decode(file_get_contents('php://input')); | |
$requestArray = get_object_vars($post_request); | |
$data = $requestArray['data']; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sendForm = async function(form){ | |
let XHR = new XMLHttpRequest(); | |
let FD = new FormData(form); | |
window.location.reload(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('template_redirect','my_non_logged_redirect'); | |
function my_non_logged_redirect() | |
{ | |
if(is_page('login') || is_page('my-account')){ | |
return; | |
} | |
if ( !is_user_logged_in() ){ | |
ob_clean(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches; | |
if (isMobile) { | |
console.log("You are on mobile!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function runOnScroll() { | |
const header = document.getElementById("header"); | |
const bodyScroll = document.getElementsByTagName("body")[0].scrollTop; | |
// Chrome | |
const htmlScroll = document.getElementsByTagName("html")[0].scrollTop; | |
if ( bodyScroll >= 400 || htmlScroll >= 400) { | |
header.style.background = "#615e5d"; | |
} | |
else{ |