Announcement

Collapse
No announcement yet.

Javascript, PHP or ASP what?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Javascript, PHP or ASP what?

    In order to automatically switch people arriving at my website to a mobile or desktop version, I need to install some code to do this (Im using goMobi), however, I have the option of Javascript, PHP or ASP.

    Which one is best to place on the index page and how to go about this - is it possible to use a Fragment or do I need to get down dirty with Layouts or something?

    Thanks in advance for your help!

    #2
    Javascript - easy to implement, add your JS in exactly the same way actinic adds its own JS in the <HEAD> area of your template**
    ASP - means you will need Windows hosting, not the best with Actinic, keep it simple
    PHP - possible, need to rename your home page, but why not keep it simple and just use the JS route**

    ** bearing in mind not everyone has JS enabled

    Comment


      #3
      I'd go with Javascript e.g. something like

      Code:
      // JavaScript 
      if((navigator.userAgent.match(/iPhone/i))  || (navigator.userAgent.match(/iP0d/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/BlackBerry/i)) || (navigator.userAgent.match(/Android/i)))   {
      
      document.write ('Do something for Mobile devices here') 
      } 
      else 
      {  
      document.write('Do something for normal browsers here')
      }
      Fergus Weir - teclan ltd
      Ecommerce Digital Marketing

      SellerDeck Responsive Web Design

      SellerDeck Hosting
      SellerDeck Digital Marketing

      Comment

      Working...
      X