View Single Post
Old 10-05-2006, 01:12 PM   PM User | #1
mic2100
Regular Coder

 
mic2100's Avatar
 
Join Date: Feb 2006
Location: Scunthorpe
Posts: 562
Thanks: 15
Thanked 28 Times in 27 Posts
mic2100 is on a distinguished road
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.
mic2100 is offline   Reply With Quote