Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-26-2012, 05:26 PM   PM User | #1
shaunthomson
New Coder

 
Join Date: May 2012
Posts: 89
Thanks: 51
Thanked 0 Times in 0 Posts
shaunthomson is an unknown quantity at this point
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
shaunthomson is offline   Reply With Quote
Old 08-28-2012, 09:50 PM   PM User | #2
milesdriven
Regular Coder

 
Join Date: Dec 2011
Posts: 186
Thanks: 0
Thanked 1 Time in 1 Post
milesdriven is an unknown quantity at this point
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..
milesdriven is offline   Reply With Quote
Old 08-29-2012, 01:00 AM   PM User | #3
shaunthomson
New Coder

 
Join Date: May 2012
Posts: 89
Thanks: 51
Thanked 0 Times in 0 Posts
shaunthomson is an unknown quantity at this point
Thanks Miles

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

She works well now.

Cheers
shaunthomson is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:03 AM.


Advertisement
Log in to turn off these ads.