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

  • Home
  • SEARCH
  • 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 8969515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:36:08+00:00 2026-06-15T17:36:08+00:00

Just like in the title. I got two files: one is javascript file and

  • 0

Just like in the title.

I got two files: one is javascript file and one is css file. And if user-agent is an iPad I want to load those files – but only when user-agent is iPad. So below two lines are only loaded when user-agent is an iPad. how can i achieve that

<link rel="stylesheet" href="/c/dropkick.css" type="text/css"/>
<script src="/s/jquery.dropkick-1.0.0.js" type="text/javascript"></script>
  • 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-15T17:36:09+00:00Added an answer on June 15, 2026 at 5:36 pm
    if (navigator.userAgent.match(/iPad/i) != null){ // may need changing?
      var js = document.createElement('script');
      js.type = "text/javascript";
      js.src = "/s/jquery.dropkick-1.0.0.js";
    
      var css = document.createElement('link');
      css.type = "text/css";
      css.rel = "stylesheet";
      css.href = "/c/dropkick.css";
    
      var h = document.getElementsByTagName('head')[0];
      h.appendChild(js);
      h.appendChild(css);
    }
    

    Or whatever would be in the User-Agent header for an iPad.

    References:

    • window.navigator.userAgent
    • document.createElement
    • node.appendChild
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just like in the title. I got GridView control that displaying some data from
In javascript, I've got a block of HTML like this: <h2>{title}</h2> <p><a href={url}>{content}</a></p> And
So, just like the title says, I need to create an application that gets
As in title users Just can't get the like button to work properly on
Just like in JavaScript : opener.document.getElementByName jQuery: ?? Is there any way to get
I've got two tables - one is Product and one is ProductSearchResult. Whenever someone
Here is the situation. I've got a standard link like so: <h2><a href=#>Link Title</a></h2>
I've got half a C class and maybe one or two shell scripts I've
I have two tables. One with videos (lol_videos): ID, title, Url, ... and a
I uses following code to send e-mail by hotmail service just like the User

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.