Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

rafraichir page javascript

//with no cache
document.location.reload(true);
//else
document.location.reload();

/**
 * Si le paramètre est nul, recharge la page, sinon recharge la page avec le paramètre.
 * If the parameter is null, reload the page, else, reload the page with the parameter
 * @param [param=null] - Le paramètre que vous souhaitez ajouter à l'URL.
 */
function reloadPage(param = null){

    if ( param != null ){
        window.location.href = window.location.href.replace( /[?#].*|$/, `${param}` );
    }

    else
    { 
        if ( window.location.href.split('?').length > 1 ){
            window.location.href = window.location.href.split('?')[0];
        }

        else 
            window.location.reload();
    }

    //param == null ? window.location.reload(): window.location.href = window.location.href.replace( /[?#].*|$/, `${param}` );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript text to speech 
Javascript :: how to get visitor ip address in javascript 
Javascript :: jquery add disabled to id 
Javascript :: javascript date to hours minutes seconds 
Javascript :: scroll to bottom 
Javascript :: javascript context arc set color 
Javascript :: javascript get random character from string 
Javascript :: load js file 
Javascript :: js date is weekend 
Javascript :: js addeventlistener click 
Javascript :: jquery on change function not working 
Javascript :: style hover js 
Javascript :: javascript truthy switch 
Javascript :: angular generate component without spec 
Javascript :: react index.js BrowserRouter 
Javascript :: remover clase jquery 
Javascript :: urlencoded json express 
Javascript :: traverse 2d array js 
Javascript :: event listener for functional component 
Javascript :: how can auto download window print in javascript 
Javascript :: moment date difference in days 
Javascript :: Firebase CLI v11.0.1 is incompatible with Node.js v14.17.6 Please upgrade Node.js to version = 14.18.0 
Javascript :: sort an array by characters length in js 
Javascript :: Make Array Consecutive javascript 
Javascript :: discord.js ticket system stackoverflow 
Javascript :: javascript check if is array 
Javascript :: get value of element html js 
Javascript :: express static auth 
Javascript :: javascript shuffle array 
Javascript :: js iterate object 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =