Bug Tracker

Modify

Ticket #3224 (closed bug: fixed)

Opened 5 years ago

Last modified 14 months ago

$.ajax type=script error while using base tag

Reported by: guai Owned by:
Priority: trivial Milestone:
Component: ajax Version: 1.2.6
Keywords: ajaxrewrite Cc:
Blocking: Blocked by:

Description

Hello. I guess, I found a little bug.

I use 3rd level domains on my host. Like jjj.test.ru And set <base>'s href attribute to access files|css|js from 2nd level domain (test.ru) with short urls like /files/jjj.jj And I need to send asynchronous requests. Setting document.domain to "test.ru" does not work on some browsers to allow cross-domain ajax requests. So I use

$.ajax({

type: "GET", url: "/some_addr", (!!!) data: ..., success: function(data) {

... },

dataType: "script" });

and it does not work too because of remote.test(s.url) in following line of jquery-1.2.6.js returns false

#2658:

if ( s.dataType == "script" && type == "GET"

&& remote.test(s.url) && remote.exec(s.url)[1] != location.host ){

Of course it can be easily fixed with writing full-formed url, but, erm... :/

Change History

comment:1 Changed 5 years ago by guai

And some more: #2677: head.removeChild( script ); should be changed to $(script).remove(); because in IE the script finds himself inside <base> tag :)

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to open
  • Milestone 1.3 deleted

comment:3 Changed 2 years ago by rwaldron

  • Keywords ajaxrewrite added

comment:4 Changed 2 years ago by danheberden

  • Status changed from open to closed
  • Resolution set to fixed

The basetag taken into consideration on relative urls for ajax as of 1.5

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.