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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:44:47+00:00 2026-05-24T04:44:47+00:00

i had a problem and solving which required a functionality built in mootools .

  • 0

i had a problem and solving which required a functionality built in mootools. so i began dissecting it.
there a function a am interested in
IframeShim.destroy
its like this

destroy: function(){
        if (this.shim) this.shim.destroy();
        return this;
    }

now what i cant understand in this what is shim.
Paricularly what i am trying to understand is
Request.JSONP.cancel
its code is like this

cancel: function(){
        if (this.running) this.clear().fireEvent('cancel');
        return this;
    }

now this cancel calls clear whose code is like this

clear: function(){
        this.running = false;
        if (this.script){
            this.script.destroy();
            this.script = null;
        }
        return this;
    }

now in this clear function i can see destroy() which takes me to shim(see code at the top) and i m stuck.
All these functions are in mootools-more.js

Help?

it would be great if somebody could provide a plain javascript implementation of Request.JSONP.cancel
Does it have a JQuery alternative?

  • 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-24T04:44:48+00:00Added an answer on May 24, 2026 at 4:44 am

    The destroy that is being called by the Request.JSONP.clear method isn’t IframeShim.destory, it’s part of the mootools core. Here’s the source:

    destroy: function(){
        var children = clean(this).getElementsByTagName('*');
        Array.each(children, clean);
        Element.dispose(this);
        return null;
    },
    

    All that Element.dispose does is call the native jasvascript DOM method Node.removeChild which deletes an element from the DOM.

    So all JSONP.cancel is doing is seeing if a script DOM node was added via Request.JSONP.cancel. If it was, it removes the script element from from the DOM via removeChild.

    The important thing is that it set the running flag to false. If you look at Request.JSONP.success, the first thing it does before calling your callback function is check if the running flag is set to false, and if it is, it returns immediately. This effectively “cancels” the execution.

    If you meant does it cancel the HTTP request, the answer is no, it does not.

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

Sidebar

Related Questions

Not too long ago, I had a problem which required me to set WinDbg.exe
I had a problem that was partially solved. To explain it quickly : I
I had a problem with committing changes after merging two branches of my project
I recently had a problem during the deployment of a windows service. Four computers
I've had this problem many times before, and I've never had a solution I
I recently had a problem in my app where some of the subviews I
I've had this problem a couple of times. Let's say I want to display
Today I had the problem that I couldn't delete a folder because it was
I had recently a problem with oom-killer starting to kill processes after some time.
I had an odd problem today when I was trying to serialize an object.

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.