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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:36:53+00:00 2026-06-07T18:36:53+00:00

Basically I have been using this function to achieve cross domain JSONP but part

  • 0

Basically I have been using this function to achieve cross domain JSONP but part of the function _success.call(this, { responseText: data.results[0].replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')}, 'success'); fails with response Uncaught TypeError: Object #<Object> has no method 'isResolved'

Now I know .isResolved() http://api.jquery.com/deferred.isResolved/ has deprecated so I was wondering how I could go about getting it working with deffered.state() http://api.jquery.com/deferred.state/ which has taken over.

Any help would be massively appreciated. Going back to a previous version of jQuery isn’t an option really.

Full function below.

jQuery.ajax = (function(_ajax){

    var protocol = location.protocol,
        hostname = location.hostname,
        exRegex = RegExp(protocol + '//' + hostname),
        YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
        query = 'select * from html where url="{URL}" and xpath="*"';

    function isExternal(url) {
        return !exRegex.test(url) && /:\/\//.test(url);
    }

    return function(o) {

        var url = o.url;

        if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {

            // Manipulate options so that JSONP-x request is made to YQL

            o.url = YQL;
            o.dataType = 'json';

            o.data = {
                q: query.replace(
                    '{URL}',
                    url + (o.data ?
                        (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
                    : '')
                ),
                format: 'xml'
            };

            // Since it's a JSONP request
            // complete === success
            if (!o.success && o.complete) {
                o.success = o.complete;
                delete o.complete;
            }

            o.success = (function(_success){
                return function(data) {
                    if (_success) {
                        // Fake XHR callback.
                        _success.call(this, {
                            responseText: data.results[0]
                                // YQL screws with <script>s
                                // Get rid of them
                                .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
                        }, 'success');
                    }

                };
            })(o.success);

        }

        return _ajax.apply(this, arguments);

    };

})(jQuery.ajax);
  • 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-06-07T18:36:55+00:00Added an answer on June 7, 2026 at 6:36 pm

    I had same problem as you and found a solution. Event though it’s while ago since the questions was asked i decided to post my solution if somebody else should come across this question as i did.

    In jquery.xdomainajax.js go to line 62 and change

    if (_success) {
        // Fake XHR callback.
        _success.call(this, {
            responseText: (data.results[0] || '')
                // YQL screws with <script>s
                // Get rid of them
                .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
        }, 'success');
    }
    

    to

    if (_success) {
        // Fake XHR callback.
        var obj = {
            responseText: (data.results[0] || '')
                // YQL screws with <script>s
                // Get rid of them
                .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
        };  
        $.extend(obj,{
            isResolved: function() { return true; },
            done: function() { return true; }
        });
    
        _success.call(this, obj, 'success');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should have been pretty straightforward using the DOM but I seem to be
Sorry if this question is simple but I have been using node.js for only
I have been using LINQ with compiled queries, basically passing into the compiled query
Basically, I am using Wireshark looking at captures that have been created previously. How
I'm using the wp_list_bookmarks() function in wordpress to get links that have been added
I have been using metaprogramming quite a lot, but sometimes the combination of c
This may be a n00b topic but, anyways, I have been having a rather
I have been searching for an answer to this but can't find it on
I have been using the STOMP protocol in various guises. I have experienced this
I have been using the pareto.chart function from the qcc package in R and

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.