简体   繁体   中英

How I can hide or change a url in anchor tag?

when i click on this link the url on page.php is http://localhost/1/page.php?id=1&edition=muzzaffarabad&dt=09-08-2017 . i want that after passing these parameters only edition name will show on url .like http://localhost/1/muzzaffarabad

this is anchor tag im using

<a class='imgFrame' href='page.php?id=1&edition=muzzaffarabad&dt=<?php echo $paper_set["muzzaffarabad_date"]?>'>

Just make your a tag like this:

<a onclick="changeHref()" class='imgFrame' href='page.php?id=1&edition=muzzaffarabad&dt=<?php echo $paper_set["muzzaffarabad_date"]?>'>

Then in your javascript file add function

function changeHref() {
    $(".imgFrame").attr("href", "http://localhost/1/muzzaffarabad");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM