We can achieve using the php and ajax.The following ajax call execute in every 10 seconds to check the status of session.If it expired the user redirected to seesionout page. Ajax call in every 10 seconds var check_current_session; function CheckForCurrentSession() { var strSession=”check_current_session=true”; jQuery.ajax({ type: “GET”, url: “check_current_session.php”, data: strSession, cache: false, success: function(result){…
Tag: javascript
Html Textarea auto resize using javascript
<script> var observer; if (window.attachEvent) { observer = function (element, event, handler) { element.attachEvent(‘on’+event, handler); }; } else { observer = function (element, event, handler) { element.addEventListener(event, handler, false); }; } function init (maximumHeight) { var text = document.getElementById(‘text’); var maxHeighter=maximumHeight; var olderHeight= text.scrollHeight; var newerHeight; function resize () { text.style.height = ‘auto’; newHeight=…
How to get the current URL in javascript and jquery?
Using the following jQuery script get the current loading URL Jquery -: var href = jQuery(location).attr(‘href’); Javascript-: var href = window.location.pathname; jQuery(document).ready(function() { setTimeout(function() { window.location.href = href; }, 3000); });