Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7841849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:11:13+00:00 2026-06-02T16:11:13+00:00

Im using the following script to add in startup screens for my mobile website,

  • 0

Im using the following script to add in startup screens for my mobile website, once its been added to the home screen.

<script>
(function(){

    var a;
    if(navigator.platform === "iPad") {
        a = window.orientation!==90||window.orientation === -90 ? 
             "/assets/img/startup/startup-tablet-landscape.png" :
             "/assets/img/startup/startup-tablet-portrait.png";
    }
    else {
        a = window.devicePixelRatio === 2 ? 
             "/assets/img/startup/startup-retina.png" :
             "/assets/img/startup/startup.png";
    }
    document.write('<link rel="apple-touch-startup-image" href="' + a + '"/>');

})();
</script>

This works for iPhone but not for iPad, I’m testing on the new iPad, does this matter? All I get is a white screen before it loads.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:11:14+00:00Added an answer on June 2, 2026 at 4:11 pm

    You don’t need javascript for that, you could use this snipplet and it should pick the right image automatically:

    <!-- For iPhone 4 with high-resolution Retina display: -->
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png">
    
    <!-- For first-generation iPad: -->
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
    
    <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
    <link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
    
    
    <!-- 320x460 for iPhone 3GS -->
    <link rel="apple-touch-startup-image" media="(max-device-width: 480px) and not (-webkit-min-device-pixel-ratio: 2)" href="startup-iphone.png">
    
    <!-- 640x920 for retina display -->
    <link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="startup-iphone4.png">
    
    <!-- iPad Portrait 768x1004 -->
    <link rel="apple-touch-startup-image" media="(min-device-width: 768px) and (orientation: portrait)" href="startup-iPad-portrait.png">
    
    <!-- iPad Landscape 1024x748 -->
    <link rel="apple-touch-startup-image" media="(min-device-width: 768px) and (orientation: landscape)" href="startup-iPad-landscape.png"> 
    

    Source: https://gist.github.com/1375646

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following script in my website in order to create pagination next-previous
I am using the following script to upload pictures to my website. It is
I am using the following script to add default values to input text boxes:
I am using the following script to close a contact panel: <script type=text/javascript> $(document).ready(function(){
I've tried to change filenames using following script: find dir/ -type f -exec mv
I'm using the following script within a Chrome extension I made. It replaces old
I'm using the following script to request new content to a file called index.html:
I'm using the following script to force a specific page - when loaded for
I am currently using the following script to set this value as a String:
I'm using the following script for a window.onload custom radio button replacement (http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/custom-form-elements.js) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.