i am very new to jquery, so any advise and help will be much appreciated.
The aim is: when a user refreshes a page the below jquery action should take place but i am unsure how to use window.location.reload in the code - any advise help would be much appreciated
<script> $(document).ready(function () { $ window.location.reload(true); $(".message-content" ).removeClass( "hide" ) $(".unlimited-content" ).addClass( "hide" ) $(".basic-content" ).addClass( "hide" ) $("#paypal_express_checkout input:first").val("10165346"); }); }); </script> i decided to try the below, it partially works as it displays the jquery action but then it does an automatics refresh which does not display the result of the jquery code to be excuted
<script> $(window).on('beforeunload', function(){ $(".message-content" ).removeClass( "hide" ) $(".unlimited-content" ).addClass( "hide" ) $(".basic-content" ).addClass( "hide" ) $("#paypal_express_checkout input:first").val("10165346"); }); </script>
});too much, and a lost$beforewindow.