Senin, 12 November 2012

How to Detect Browser Internet Explorer with PHP

Tidak ada komentar:

How to Detect Browser Internet Explorer with PHP


You know, if you are website programmer or website designer you will understand why so important to detect Internet Explorer browser, cause generaly this browser have different treatment  in processing html, css and javascript. So maybe you need different page for this browser.
So this is PHP script will help you for detect Internet Explorer Browser or not.

<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], '(compatible; MSIE ')!==FALSE) {
   //action for internet explorer
   header('location:form-ie.php?idu='.$_GET['idu']);  
} else {
      //action for other browser
header('location:form.php?idu='.$_GET['idu']);
}


Rabu, 07 November 2012

Handling Event Window Close or Reload With jQuery

Tidak ada komentar:

Handling Event Window Close or  Reload With jQuery

         When we want to know that the user will leave the pages of the website, we need a trigger that can be used as a reference to determine the user has left the website pages.
There are some conditions in which the user can leave the web page:

- Refresh or reload page
- Back to previous page
- Close page

example with javascript:
window.onunload=function(){SomeJavaScriptCode};

example with jquery
$(window).unload(function() {
    //some javascript code
}

Some Problem :
onUnload only working on Firefox , Internet Explorer and Opera