HTTPS Relative XMLHttpRequest

Discussion in 'Javascript' started by MC, Jan 28, 2012.

  1. MC

    MC Guest

    Dear Group,

    I have searched and found references by pointy-ears and Cornfed that it
    is possible to do a relative addressed secure XMLHttpRequest but nowhere
    can I find a sample of how to do it, nor can I figure it out. Can
    someone please present an example or link to such?

    Thanks!
     
    MC, Jan 28, 2012
    #1
    1. Advertisements

  2. MC wrote:

    > I have searched and found references by pointy-ears and Cornfed […]


    Please do not feed the troll (adjust your score-/killfile instead).


    F'up2 where it belongs

    PointedEars
    --
    Sometimes, what you learn is wrong. If those wrong ideas are close to the
    root of the knowledge tree you build on a particular subject, pruning the
    bad branches can sometimes cause the whole tree to collapse.
    -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
     
    Thomas 'PointedEars' Lahn, Jan 28, 2012
    #2
    1. Advertisements

  3. MC

    Tim Streater Guest

    In article <>,
    Stefan Weiss <> wrote:

    > On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
    > > MC wrote:
    > >
    > >> I have searched and found references by pointy-ears and Cornfed […]

    > >
    > > Please do not feed the troll (adjust your score-/killfile instead).

    >
    > A troll, you say? Would that be the person who asked a legitimate JS
    > related question, or the one who tried to divert replies to
    > alt.my.little.pony?
    > I'm sure most readers of this group are able to make their own decisions
    > about how to score posters. We generally don't feel the need to announce
    > every filter adjustment in our postings, however.
    >
    > Back on topic...
    > @OP: Yes, it is possible to use relative URLs in the XHR's open()
    > method. The URL will be resolved relative to the base URL of the current
    > document/window (see the XHR specification(s) for details).


    In fact that's all I ever use.

    See:

    <http://www.clothears.org.uk>

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Jan 29, 2012
    #3
  4. Stefan Weiss wrote:

    > On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
    >> MC wrote:
    >>> I have searched and found references by pointy-ears and Cornfed […]

    ^^^^^^^^^^^^^^^^^^^^^^^
    >> Please do not feed the troll (adjust your score-/killfile instead).

    >
    > A troll, you say? Would that be the person who asked a legitimate JS
    > related question, or the one who tried to divert replies to
    > alt.my.little.pony?


    It is the person who started calling long-time contributors to this
    newsgroup names (literally), while *pretending* to not know. As that
    was obviously not obvious to some rather naive people (like you), I have
    attempted to point out the history of the OP. As for "legitimate JS
    related question": you can't be serious.


    PointedEars
    --
    Anyone who slaps a 'this page is best viewed with Browser X' label on
    a Web page appears to be yearning for the bad old days, before the Web,
    when you had very little chance of reading a document written on another
    computer, another word processor, or another network. -- Tim Berners-Lee
     
    Thomas 'PointedEars' Lahn, Jan 29, 2012
    #4
  5. MC

    MC Guest

    On 1/29/2012 12:31 AM, Stefan Weiss wrote:
    > On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
    >> MC wrote:
    >>
    >>> I have searched and found references by pointy-ears and Cornfed […]

    >>
    >> Please do not feed the troll (adjust your score-/killfile instead).

    >
    > A troll, you say? Would that be the person who asked a legitimate JS
    > related question, or the one who tried to divert replies to
    > alt.my.little.pony?
    > I'm sure most readers of this group are able to make their own decisions
    > about how to score posters. We generally don't feel the need to announce
    > every filter adjustment in our postings, however.
    >
    > Back on topic...
    > @OP: Yes, it is possible to use relative URLs in the XHR's open()
    > method. The URL will be resolved relative to the base URL of the current
    > document/window (see the XHR specification(s) for details).
    > If the current URL uses the "https" scheme, you should be fine. If the
    > scheme, domain, or port parts of the URL you want to request differ from
    > the current base URL, you're going to run into problems with the
    > browsers' same origin policy. But in that case, there's not much point
    > in using relative URLs, anyway.
    > There may be ways to relax this restriction, but I'd need to know more
    > about your use case before I can recommend one. Please also describe
    > what you have already tried and what did/didn't work for you.
    >
    >> F'up2 where it belongs

    >
    > Duly ignored.
    >
    >
    > - stefan


    Stefan,

    I'm trying to clear up the browser mixed-mode error in the URL. The page
    is delivered via Https and all of the resources are relative addressed
    including the XmlHttpsRequest. The research I done seems to suggest I
    need to do an explicit Https XmlHttpsRequest to resolve the error.

    This is what I'm using for my XmlHttpsRequest:
    myXmlHttpRequest.open("POST", "/ws/webserviceXYZ.jsp");
    myXmlHttpRequest.onreadystatechange = myResponse;
    myXmlHttpRequest.send(myPostData);

    I do not want to do the following as the domain is different in testing,
    production, and in affiliate modes:
    myXmlHttpRequest.open("POST",
    "https://www.mydomain.com/ws/webserviceXYZ.jsp");

    From what you posted, the XmlHttpRequest should be defaulting to Https
    since the page was accessed from it. Chrome is complaining it is not
    though. Any help is greatly appreciated as I am not a troll. Pointy-ears
    just does not like it when one of the lesser JS smart people vocalize
    their disappointment in his depredations on their skills and character.

    MC
     
    MC, Jan 30, 2012
    #5
  6. MC

    MC Guest

    On 1/29/2012 4:58 AM, Tim Streater wrote:
    > In article <>,
    > Stefan Weiss <> wrote:
    >
    >> On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
    >> > MC wrote:
    >> > >> I have searched and found references by pointy-ears and Cornfed […]
    >> > > Please do not feed the troll (adjust your score-/killfile instead).

    >>
    >> A troll, you say? Would that be the person who asked a legitimate JS
    >> related question, or the one who tried to divert replies to
    >> alt.my.little.pony?
    >> I'm sure most readers of this group are able to make their own decisions
    >> about how to score posters. We generally don't feel the need to announce
    >> every filter adjustment in our postings, however.
    >>
    >> Back on topic...
    >> @OP: Yes, it is possible to use relative URLs in the XHR's open()
    >> method. The URL will be resolved relative to the base URL of the current
    >> document/window (see the XHR specification(s) for details).

    >
    > In fact that's all I ever use.
    >
    > See:
    >
    > <http://www.clothears.org.uk>
    >


    Tim,

    Yes Stefan pointed this out but in the example I replied to, Chrome does
    not seem to be doing this.

    Thank you,
    MC
     
    MC, Jan 30, 2012
    #6
  7. MC

    MC Guest

    Who is the troll?

    Me who asks a question - or you who waits under the JS bridge, waiting
    for some poor unsuspecting soul to cross, and have you jump on them
    spewing your greatness and chewing them out for not being as smart as you.

    I would just really like to ask questions of the group and have you not
    respond AT ALL but hey its the Internet and if you want to troll I guess
    you will. ...and what is up with the alt pony thing? You are WEIRD!
     
    MC, Jan 30, 2012
    #7
  8. MC

    Scott Sauyet Guest

    MC wrote:
    > Who is the troll? [ ... ]


    Children, children! Play nicely together!

    Mica, stop calling Thomas names. Thomas, stop calling Mica names.

    Now run along and behave!

    -- Scott
     
    Scott Sauyet, Jan 31, 2012
    #8
  9. MC

    MC Guest

    FYI,

    I found it. Chrome apparently complains if an unsecure request is made
    on another page and doesn't really discriminate because its the same
    site...kind of strange I think as almost all sites make use of public
    non-secure and private secure pages.
     
    MC, Feb 2, 2012
    #9
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Trip

    XMLHttpRequest + XMLDOM

    Trip, Oct 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    562
  2. =?Utf-8?B?QnJhdm8=?=

    XMLHTTPRequest with Xpath is not working

    =?Utf-8?B?QnJhdm8=?=, Apr 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    673
    =?Utf-8?B?QnJhdm8=?=
    Apr 1, 2004
  3. Steve

    XMLHttpRequest help

    Steve, Mar 21, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    731
    Steve
    Mar 22, 2005
  4. abcd

    https and relative urls

    abcd, Aug 2, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    594
  5. Axel
    Replies:
    8
    Views:
    2,160
    Adrienne Boswell
    Apr 27, 2009
  6. jotto
    Replies:
    4
    Views:
    753
    jotto
    Oct 2, 2006
  7. Naveen Dhanuka
    Replies:
    1
    Views:
    503
  8. bizt
    Replies:
    2
    Views:
    253
    Thomas 'PointedEars' Lahn
    May 30, 2008
Loading...