Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    89
    Thanks
    51
    Thanked 0 Times in 0 Posts

    since on SSL, AJAX urls don't work?

    Gidday

    I have a whole bunch or AJAX calls that were working fine, until I changed my site to https

    eg

    Code:
    type: "POST",
    url: "dir1/page1.php"
    was working fine, but now it invokes whatever AJAX 'error:' code I have set up.

    I tried adding a forward slash before the url, but no good.

    However, putting the full https url works:
    Code:
    https://www.mysite.com/dir1/page1.php
    Is there a way to successfully do it with the relative urls, or do I have to use full ones?

    Thanks guys

  • #2
    Regular Coder
    Join Date
    Dec 2011
    Posts
    186
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hello,

    I'm going to take a guess and say the relative url assumes http. When you used the full url, you not only changed the protocol from http to https, you also pointed your script to an entirely different url.

    https://mydomain....... is an entirely different url than http://mydomain...

    Yes, you have to point your script to the entirely different url. I don't know if there is another way to do this using only the relative url. Something has to let your script know you want https.
    Last edited by milesdriven; 08-28-2012 at 09:55 PM.

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    89
    Thanks
    51
    Thanked 0 Times in 0 Posts
    Thanks Miles

    Turns out I had forgotten to change the base href tag from http to https

    She works well now.

    Cheers


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •