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 6117299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:18:17+00:00 2026-05-23T15:18:17+00:00

In my custom JS code file I use various plugins, for instance, the Masonry

  • 0

In my custom JS code file I use various plugins, for instance, the Masonry plugin for JQuery. However, I don’t include the plugin on every page or at the master page file level (in some yes, in some no) but I do include my custom file on every page. Therefore, the code in my JS file will issue an error if the Masonry plugin is missing.

If someone could reply with a solution of how to:

  1. Check if certain JS plugin was referenced (included) and only run the code then,
  2. (optionally) include the file at runtime if it is missing.

I have it working with JQuery and JQuery UI because they both introduce a class into DOM structu (jquery and jquery.ui objects) but there are other plugin’s like lightbox scripts, the forementioned Masonry etc..

  • 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-05-23T15:18:18+00:00Added an answer on May 23, 2026 at 3:18 pm

    Rather than checking whether a particular JavaScript file has been ‘included’, I’d just check if the functionality that you need is available (i.e. if you need a function named foo, just do something along the lines of typeof foo == 'undefined' to see if it is there …).

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

Sidebar

Related Questions

I want to create custom error code and message mapping file. Currently I use
I wanna use custom font file. For that below is my code XML file:
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have a custom XML file format which can contain blocks of code within
The code below is a portion of a php file I use to update
I have a custom (code-based) workflow, deployed in WSS via features in a .wsp
Are there any best-practices that state custom code shouldn't be placed in a System
We have a project where a vendor produces some custom code for us and
Is there any Google Analytics testing/sandbox environment for testing your JS custom code before
Like the title says, how do you create custom code snippets in Visual Studio

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.