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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:50:34+00:00 2026-05-22T12:50:34+00:00

First of all I am new to javascript so this question might be stupid.

  • 0

First of all I am new to javascript so this question might be stupid.
I have a requirement where i would provide a js script to other websites to include in their webpages.

Now my question is should I use jquery or plain javascript.Will/Can jquery effect the rest of the functionality of the site.
Plus what is the benefit I will get using jquery over plain javascript.

My requirement is to get all images of the website and do some processing on the images on these websites.

Thanks in Advance.

  • 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-22T12:50:35+00:00Added an answer on May 22, 2026 at 12:50 pm

    I would say, if the processing does not involve jQuery then do not use it.

    You need to deal with the following issues if you include it

    • failure to load (for network reasons)
    • conflict with other versions locally loaded
    • conflict with other libraries locally loaded

    All issues have workarounds/solutions but you have to implement each an everyone of those.

    If you just need to find all images in page, then you can use the .getElementsByTagName() method

    var imagelist = document.getElementsByTagName('img');
    

    and just do the processing on that..

    You might need of-course to attach your code at the load event to be sure that whatever your code does, the DOM is ready to accept it..

    for modern browsers that would be .addEventListener(), while for IE it would be .attchEvent()

    your script could be something like this

    (function(){ // wrap in a self-invoking function to avoid global name-space pollution
    
      // attach to the load event so out code runs once the page has loaded
      if (window.addEventListener) { // modern
        window.addEventListener('load', imageProcessor, false);
      }
      else if (window.attachEvent) { // IE
        window.attachEvent('onload', imageProcessor );
      }
    
      function imageProcessor(){
        // get all images
        var imagelist = document.getElementsByTagName('img');
    
        // loop the list of images to do something with each image
        for (var img = 0; img < imagelist.length; img++)
         {
           var currentImage = imagelist[img];
           // do processing on the currentImage which hold a reference to the image
         }
      }
    
    })(); // do the self-invoking
    

    demo: http://jsfiddle.net/gaby/nXPzk/

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

Sidebar

Related Questions

First of all, let me say I am very new to rails, have been
First of all there is a partial question regarding this, but it is not
First of all, i'm a Graphic designer so please ignore if this programming question
First of all, I would like to apologize for posting this again. I am
First i have declare that i am new to javascript. I have created a
I am fairly new to Jquery and javascript and have jumped in head first
This might be a 2 part question. First one is what am I doing
First of all this is not a question about how can I use http
I am new to programming so this question of mine might seems irrelevant. I
I have this code: <script type=text/javascript> var url = http://www.xxxxx.xxx/xxxxxxxxx; var txt; var id1;

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.