Check if url contains string with JQuery [duplicate]

Use Window.location.href to take the url in javascript. it’s a
property that will tell you the current URL location of the browser.
Setting the property to something different will redirect the page.

if (window.location.href.indexOf("?added-to-cart=555") > -1) {
    alert("found it");
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)