#251 ✓invalid
mazengh

Exception in Ajax.Request.isSameOrigin when non-string is used as the target URL (like window.location)

Reported by mazengh | July 28th, 2008 @ 11:16 PM

check screenshot, i had to change

var m = this.url.match(/^\s*https?:\/\/[^\/]*/);

to

var m = this.url.toString().match(/^\s*https?:\/\/[^\/]*/);

tested in firefox and IE 7, same problem.

Comments and changes to this ticket

  • Tobie Langel

    Tobie Langel July 28th, 2008 @ 11:21 PM

    • Assigned user set to “Tobie Langel”
  • Tobie Langel

    Tobie Langel July 28th, 2008 @ 11:21 PM

    url is supposed to be a string.

    What are you using instead ?

  • mazengh

    mazengh July 28th, 2008 @ 11:33 PM

    the original call is

    new Ajax.Updater($(wrapperDiv), window.location, opt);

    so probably i should have it window.location.toString()

    should have thought about that. thanks for the hint

  • John-David Dalton

    John-David Dalton July 28th, 2008 @ 11:38 PM

    • State changed from “new” to “invalid”

    Actually window.location.href

    http://developer.mozilla.org/en/...
    
  • Sergiu Dumitriu

    Sergiu Dumitriu March 15th, 2010 @ 03:12 AM

    • Title changed from “isSameOrigin” to “Exception in Ajax.Request.isSameOrigin when non-string is used as the target URL (like window.location)”

    I think that this issue should be fixed, even if it's a user error. The fix is quite simple, see the attached patch.

  • Sergiu Dumitriu

    Sergiu Dumitriu November 17th, 2010 @ 04:17 AM

    • Importance changed from “” to “”

    Any chance of applying the provided patch?

  • Andrew Dupont

    Andrew Dupont November 18th, 2010 @ 07:20 AM

    Probably not. I could envision us doing string coercion just to support stuff like the window.location thing, but adding a sniff for a DOM node would go too far. Feel free to write a patch that does something like that and submit a new enhancement ticket.

  • Quentin0

    Quentin0 December 12th, 2018 @ 12:45 PM

    I have been facing this issue now from quite a long time and don’t know how to fix it. Exception in Ajax.Request.isSameOrigin when non-string is utilized as the target URL such as window.location. On the webpage there is nothing informative about it, so it would be helpful if someone add some information here. Those students who are looking college paper review then here a lot of different sites available on internet to read and select the best site for help.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Attachments

Pages