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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:35:27+00:00 2026-05-26T20:35:27+00:00

I am trying out a few things, and among those I tried to insert

  • 0

I am trying out a few things, and among those I tried to insert jquery on a site, namely, http://www.tesco.com/wine.

For some reason, I was not able to able access jQuery even though I was able to successfully append a new script tag to the body element. Also, the page seems to have a window.$ function that I tried to delete with delete window.$. This, seems to return false for me. How do you make something undeleteable?

Here is the code I used to append the jQuery script to the document:

var s = document.createElement('script');
s.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js";
document.body.appendChild(s)

It is working on other pages.

  • 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-26T20:35:28+00:00Added an answer on May 26, 2026 at 8:35 pm

    After discussing this in JavaScript chat, Tim Stone discovered that the JS on the page adds its own implementation of Object.prototype.extend – which breaks the jQuery script. To fix it (but potentially break another script on the page), you can delete that before adding jQuery:

    delete Object.prototype.extend;
    var s = document.createElement('script');
    s.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js";
    document.body.appendChild(s)
    

    $ is already defined on that page with the following function declaration:

    function $(A){return document.getElementById(A)}
    

    It is not uncommon to alias document.getElementById() with $() — in fact, Firebug and WebKit’s developer tools do this in their console.

    It is not deletable, because it is declared as a function statement and not an object property. While delete may work in some browsers, it shouldn’t and won’t in others. That being said, I was able to override the function with a simple assignment:

    $ = function () {}
    

    When jQuery loads, it creates the jQuery namespace and aliases this namespace with $. Therefore, if something else on the page is overriding $, you can still use jQuery().

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

Sidebar

Related Questions

I am trying out few things on windows with emacs. In my case, I
I am trying to figure out a way to pre-process few things before my
I'm new to java and web apps and after trying out a few things
I am trying to implement a rails Recipe application from the site http://oreilly.com/ruby/archive/rails-revisited.html .
Im trying a few things out with the AChart for android. Ive got a
I'm trying to write a stored procedure in which I insert a few things
I'm new to Haskell and I'm trying out a few tutorials. I wrote this
I have been trying out Cassandra and need some help in understanding a few
I've been for the past few hours trying to figure out why openCV doesn't
I've spent quite a few hours researching and trying to figure out why I'm

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.