I have a very small jquery app with one button and a jquery function. here is the ode:
JS:
<script type="text/javascript">
function swapcookie() {
$.cookie('IsMobile', 'False', { expires: 3000, path: '/' });
}
</script>
HTML
<a class="force-desktop" href="" data-role="button" onclick="swapcookie();">Force desktop</a>
My goal is to change the value of the cookie (which works fine), and then reload the page. But strangely when I click the button, nothing happens. Also I tried putting current url in href=”” but that didn’t work either. Any ideas?
Have you tried this: