Posts

Showing posts from February 13, 2019

Convert a String from LowerTo Upper (vice-versa) without using type casting or built-in functions in Java...

Image
-5 How can we convert a String from lower to upper (Vice-versa ) in Java without using any built-in function or using any type casting ? java share | improve this question asked Nov 14 '18 at 15:23 Jay Jay 6 4 closed as too broad by achAmháin, kryger, GriffeyDog, oleg.cherednik, gnat Nov 15 '18 at 5:56 Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at

JS: Detect an URL change in a SPA

Image
0 I would like to listen to path changes in a SPA which is not maintained by me. I found one solution here: https://stackoverflow.com/a/44819548/7042552 But still, it seems kind of "hacky" to me - but still my implementation is like this: let url = window.location.href; ['click','popstate', 'onload'].forEach( evt => window.addEventListener(evt, function () { requestAnimationFrame(()=>{ if (url !== location.href) { // do stuff } url = location.href; }); }, true) ); Is there a better or more generic way to listen for page loads in a SPA? Thanks! javascript javascript-events single-page-application