简体   繁体   中英

javascript:document.location.href does not work

I am trying to use js functions to improvise navigation in my website, although I am not able to parse the function in using document.function.href. I have simplified my code here for clarity. Please help me.

<button href="javascript:document.location.href=destinationFunc("target.html");">PRESS</button>
<button onclick="var lnk='target.html'; document.location.href=destinationFunc(lnk);">PRESS</button>

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