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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:23:32+00:00 2026-05-20T12:23:32+00:00

I’m having a bit of a problem getting my custom JavaScript file to play

  • 0

I’m having a bit of a problem getting my custom JavaScript file to play nice in Google chrome when jquery is being loaded in my Magento site. This problem only seems to be appearing in Google chrome. I’ve tested for the problem in both Linux Ubuntu 10.10 (chrome 10.0.648.114 beta) and Windows XP (chrome 9.0.597.98). FF, Safari, IE don’t seem to have this problem.

When jQuery is added to the JS files to include, my personal JS file does not work when a hard refresh is sent (force a 200 request of the js file). if I do a regular refresh (304 request of the js file) and have it load from cache, then it works.

I have gone so far as to create a dummy page outside my magento site and I’m still getting this problem when I include the JS files from the magento site. but, if I move the JS files outside the magento site it works fine?

I have caching disabled in my magento admin and to my knowledge there isn’t any module or custom code/plugins that would affect JS files that are to be included.

Here is an example of my dummy page that is sitting in the root directory of my server

The only thing gearlists.js has in it, is

alert('external');

so I would expect two alert popups when I load that page. but on hard refreshes, I’m only getting one popup. “Internal”.

If i turn around and do a regular refresh, both JS files are loaded from the browser cache w/ a 304 status code and I get two popups “External” then “Internal”

Does Not Work With Hard Refresh

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript" src="http://VIRTUAL_SERVER_FOR_MAGENTO_SITE/catalog/js/jquery/jquery-1.5.1.js"></script>
        <script type="text/javascript" src="http://VIRTUAL_SERVER_FOR_MAGENTO_SITE/catalog/js/ads/gearlists.js"></script>
        <script type="text/javascript">
            alert('Internal');
        </script>
    </head>
    <body>
    </body>
</html>

Always Works

In this example, if I move the JS files out of the magento virtual server and into the root directory of my server, everything always works as expected. two popups are shown w/ every page refresh

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript" src="http://localhost/jquery-1.5.1.js"></script>
        <script type="text/javascript" src="http://localhost/gearlists.js"></script>
        <script type="text/javascript">
            alert('here');
        </script>
    </head>
    <body>
    </body>
</html>

Now if I remove the jquery file from my test, my custom js file always works fine whether its served from withing my magento VS or not…There is always two popups.

I’m a bit stuck on what could be causing this. Any ideas would be greatly appreciated.

  • 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-20T12:23:33+00:00Added an answer on May 20, 2026 at 12:23 pm

    OK, I figured this out. dumb mistake, but it took some time. The directory for the files were the initials for the site name js/ads/gearlists.js

    turns out my adblock extension uses a regex to find the word “ads” and filtered my script out. when I adjusted the directory from ads to adsinc problem went away.

    makes sense that id didn’t work in linux or windows since my chrome extensions are synced.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
i want to parse a xhtml file and display in UITableView. what is the
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,

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.