Web Analytics Made Easy -
StatCounter ajax https problem - CodingForum

Announcement

Collapse
No announcement yet.

ajax https problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ajax https problem

    i have made a page that allows personal details to be viewed, updates and deletes information using AJAX. While testing this i had it working a normal server but now it is nearly finished i am testing on the secured server for the final stage. But i am having a problem now and it is not doing any of the above.

    Are there any reasons why this should no longer work as it should do, now it is on the https???

    here is the code that i have done perhaps there are some other things i need to do before it will work.

    Code:
    var http = getHTTPObject(); // We create the HTTP Object
    
    //with this function you must pass it the
    //ID = id of form element this must also be the field name in the db
    //URL = the page where the data will be processed
    //pkid = name of the primary key in the db
    //table = the table where the record you are changing exists
    function ajaxGet(id, url, pkid, table, type)
    {
    	
    	//types include
    	// 1 = date
    	// 2 = checkbox
    	// 3 = 1st letter upper case
    	// 4 = all upper case
    	// 5 = same as entered
    	
    	var field = document.getElementById(id).id
    	var value //= document.getElementById(id).value
    	var section
    	
    	if(document.getElementById(id).type == "checkbox")
    	{
    		
    		if(document.getElementById(id).checked == true)
    		{
    			
    			value = 1
    		
    		}
    		else
    		{
    			
    			value = 0
    		
    		}
    	
    	}
    	else if(type == 1)
    	{
    		
    		fieldvalue = document.getElementById(id).value
    		
    		value_array = fieldvalue.split("-")
    		
    		value = value_array[2] + "-" + value_array[1] + "-" + value_array[0]
    		
    	}
    	else
    	{
    		
    		value = document.getElementById(id).value
    	
    	}	
    	
    	var modurl = url + "?field=" + field + "&value=" + value + "&table=" + table + "&pkid=" + pkid + "&type=" + type
    	
     	http.open("GET", modurl, true);
    
      	http.send(null);
    
    	
    }
    
    function getHTTPObject() 
    {
    
    	var xmlhttp;
    
    	if (window.XMLHttpRequest)
      	{
    	
      		xmlhttp=new XMLHttpRequest()
    		
      	}
    	else if (window.ActiveXObject)
      	{
    	
      		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
    		
      	}
    
    
      	return xmlhttp;
    
    }
    i also have other AJAX code that works fine on the https server. So..... i am lost for ideas on what could be causing this.

  • #2
    where is http.onreadystatechange ?

    can't find it in your code.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

    Comment

    Working...
    X