Solved

Above article was working since I had SSL sertificate. I now use https instead of http, I think that's why it's not working.

Posted on 2016-09-26
7
70 Views
Last Modified: 2016-09-27
I had this question after viewing Using a drop down box to populate a second drop down box.

Above article was working since I had SSL sertificate. I now use https instead of http, I think that's why it's not working.
what should I do?
should I modify the code?
0
Comment
Question by:Braveheartli
  • 3
  • 3
7 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 41817301
The mode of connection is likely not the issue, double check the action on the form to make sure it corresponds to the way data is accessed.
I.e if your setup requires secure access (https://) make sure your <form action= points to https as the destination mode of data submission.
0
 
LVL 1

Author Comment

by:Braveheartli
ID: 41817345
it doesn't work on the server,

updateData(this) is not working
0
 
LVL 77

Expert Comment

by:arnold
ID: 41817820
Saying something is not working provides no insight.
You are using jquery, can you double check whether all your jquery calls use the https:// connection back to your servers
Check the site's log for the call to see if it came in over https or http

Double check the directory https config points to has the ... As exists in the prior.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 1

Author Comment

by:Braveheartli
ID: 41817921
thank you
I use this <script src="http://code.jquery.com/jquery-latest.js"></script> j query

Should I save the jquery-latest.js file and change all http to https?
0
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 41818042
Since you added the certificate, did you reconfigure your system to no longer answer requests on http://
Often when a secure page has mixed data sources (secure/insecure) it notifies the user and the user may choose not to load the insecure data at which point your javascript source will not be seen by the browser.

Yes, secure pages should reference all their content through the secure channel to avoid alerts to user that some content is other and whether they wish to only load secure or all content..
0
 
LVL 1

Author Closing Comment

by:Braveheartli
ID: 41818112
thank you very much
0
 
LVL 33

Expert Comment

by:Slick812
ID: 41818137
greetings Braveheartli, , I looked at this article -
       https://www.experts-exchange.com/articles/18556/Using-a-drop-down-box-to-populate-a-second-drop-down-box.html

which seems to be the base for this question? ?
You do NOT have any jquery AJAX error catching code in that, so you do NOT get any info about the javascript that causes the code to fail. You can place the jquery -
       $(document).ajaxError( )
method in your code to get the jquery variety of error parameters to show what happened for the failure, the jquery API for that ajaxError method is here -
       http://www.w3schools.com/jquery/ajax_ajaxerror.asp

and can be coded i this fashion -
$(document).ajaxError(function( event, request, settings, exc ) {
if (request.status==404) alert("ERROR from Ajax as '404 status' the "+settings.url+" page was NOT on Server, \nCan NOT recover from this ERROR, This operation is NOT available!"); 
else {
alert("ERROR from Ajax POST= Server-Status: "+request.status+", post-URL: "+settings.url+", post-Data: "+settings.data+", error because: "+exc);
if (request.responseText) {
  $('#debug1').html(request.responseText); 
  }else $('#debug1').html("ajaxError responseText is empty");
}
});

Open in new window

I use a development <div> ID debug1  to show the returned server TEXT, but you can change it to the development console log.

another way is to use the jquery AJAX done and fail methods something like -
<script>
var count = 1;

function doAjax(ele){
var postRe = $.post( "eepostaj.php", {n: $("#in1").val, c: count } );

postRe.done(function( received ) {
$( "#ajReturn" ).append( "<br/>"+received );
});


postRe.fail(function(xhr, error1, err) {// the Status IS NOT a Number, but the Type of jquery ERROR
  if (xhr.status==404) alert("ERROR from Ajax as '404 status' the "+ajxSend.url+" page was NOT on Server, \nCan NOT recover from this ERROR, This operation is NOT available!");
  else {
  alert("Ajax ERROR = \""+error1+"\", with server Status: "+xhr.status+", \nerror because: "+err);
  if (aj.responseText) {
    console.log("AJAX ERROR TEXT: "+aj.responseText); 
    }else console.log("AJAX ERROR TEXT: Ajax Received Text is empty");
  }
  });

count++;
}
</script>

Open in new window


the use of the -
     http://code.jquery.com/jquery-latest.js
is Out Of Date , and should not be used any more, due to the ever continuing development and changes to the jquery build, the LATEST could NOT be maintained, so a developer now has to load the Jquery version appropriate to there code write, I would recommend using the jquery new 2 version at -
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

also, you should try the FULL php web addy in the post( ) method maybe like -
jQuery.post("https://domain.com/ajax/getResult.php","type="+value,updateNumber);

to be sure that the SSL connection of "https" is used for the ajax address
1

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question