Bug Tracker

Modify

Ticket #10941 (closed bug: invalid)

Opened 18 months ago

Last modified 18 months ago

When the same request multiple jsonp, browser through a window[jsonpCallback] not defined.

Reported by: cfddream Owned by: cfddream
Priority: low Milestone: None
Component: ajax Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

First, I do not define the window[jsonpCallback] function, jQuery will define it. But when the same request multiple jsonp, the browser through a error window[jsonpCallback] not defined. I test it from v1.5.2 to v1.7.1.

!#javascript
$.ajax({
    type: 'get',
    dataType: 'jsonp',
    data: 'query=' + encodeURIComponent(v),
    jsonp: 'callback',
    jsonpCallback: 'docallback',
    cache: true,
    url: 'http://abcd.com/e.php',
    success: function (data) {
        //do something        
    }
});

So I had to this way fix it.

Error: Failed to load processor javascript
No macro or processor named 'javascript' found

Change History

comment:1 Changed 18 months ago by cfddream

window[jsonpCallback] = function () {};

comment:2 follow-up: ↓ 4 Changed 18 months ago by sindresorhus

  • Owner set to cfddream
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:3 Changed 18 months ago by cfddream

  • Status changed from pending to new

comment:4 in reply to: ↑ 2 Changed 18 months ago by cfddream

Replying to sindresorhus:

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

This is my test case  http://jsfiddle.net/cfddream/ZHPLB/

comment:5 follow-up: ↓ 6 Changed 18 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to ajax

You'd set your testcase to use jQuery 1.5.2. When I set it to jQuery 1.7.1, I didn't get any error.

comment:6 in reply to: ↑ 5 Changed 18 months ago by cfddream

Replying to sindresorhus:

You'd set your testcase to use jQuery 1.5.2. When I set it to jQuery 1.7.1, I didn't get any error.

Thanks. But, " i != data.i" . I think the correct result should be "i === data.i".

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.