NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Ajax

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-25-2006, 09:22 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
cvxdes's Avatar
Join Date: Oct 2005
Location: Milford MA
Posts: 692
cvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud of
 



Awful Ajax - Will pay


This ajax is giving me hell. It's suposed to use posting of data and XML Trees.
Im working on my site, Not like i can get it to post anyways, but the php backend already works. Depending on the $_POST['id'], it'll return a tree like this:
<id>1</id>
<title>Title</title>
<links>Links</links>
<cont>Cont</cont>
<banner>0</banner>

Alright, so how to i get all these values into strings, so i can use the functions that i already wrote for them.

So, in short...

How to get ajax to post, and how do i get it to get the reply from the file that it posted to?
????: NamePros.com http://www.namepros.com/programming/180591-ajax.html

If you think you might be able to do this, MSN me at admin@cvxdes.com, i'll pay.
Last edited by cvxes; 03-25-2006 at 09:31 PM.
cvxdes is offline  
Old 04-02-2006, 07:21 AM   #2 (permalink)
First Time Poster!
Join Date: Apr 2006
Posts: 1
green_ryu is an unknown quantity at this point
 



Talking have been resolved?


cvxes, I'd have same problem.. have u figure yet the trick to resolve thats?
green_ryu is offline  
Old 04-02-2006, 12:14 PM   #3 (permalink)
NamePros Member
Join Date: Mar 2006
Posts: 62
123finder.com is an unknown quantity at this point
 



This AJAX code we use can do both POST/GET. Also, there are available AJAX libraries you can use to simplify the job.
Code:
function createRequestObject() {
    var $vObj;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		$vObj = new XMLHttpRequest();
		if ($vObj.overrideMimeType) {
			$vObj.overrideMimeType('text/xml');
		} // fi
	} else if (window.ActiveXObject) { // IE
		try {
			$vObj = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				$vObj = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		} // fi

		if (!$vObj) { // failed, cannot create
            return false;
        } // fi
	} // fi
    return $vObj;
}

var $vAJAX = createRequestObject();
var $globAJAXBusy = false;

function checkAJAX() {
	if ($globAJAXBusy) {
		$vAJAX.onreadystatechange = function () {}
		$vAJAX.abort();
	} // fi
}

function requestPage($pURL) {
	checkAJAX();
    $vAJAX.open('GET',$pURL,true);
	$globAJAXBusy = true;
    $vAJAX.onreadystatechange = handleResponse;
    $vAJAX.send(null);
}

function postPage($pURL,$pParams) {
	checkAJAX();
	$vAJAX.open('POST',$pURL,true);
	$globAJAXBusy = true;
	$vAJAX.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	$vAJAX.setRequestHeader("Content-length",$pParams.length);
	$vAJAX.setRequestHeader("Connection","close");
	$vAJAX.send($pParams);
	$vAJAX.onreadystatechange = handleResponse;
}

function handleResponse() {
    if(typeof($vAJAX)=='undefined' || $vAJAX.readyState!=4){
		return false;
	} // fi
	
	try {
		if ($vAJAX.status!=200) { // error page
			return false;
		} // fi
	} catch(e) {
		return false;
	} 

	$globAJAXBusy = false;
	var $vResult = $vAJAX.responseXML;
        ..... // do something
}
__________________
123finder.com - Browse dictionary domains & 4-9 letter domains
123finder.com is offline  
Old 04-04-2006, 04:46 PM   #4 (permalink)
NamePros Regular
Join Date: Mar 2006
Location: Connecticut, USA
Posts: 281
Darkneoboi is an unknown quantity at this point
 



If you have AJAX code and you don't want people to use the back button, is there a way to disable the backbutton the the Browser or the Mouse if they have one there?
__________________
DarkNeoNetwork
Darkneoboi is offline  
Old 04-17-2006, 01:11 AM   #5 (permalink)
Professional Monkey
 
Amnezia's Avatar
Join Date: Jul 2005
Location: Escaped from the zoo
Posts: 907
Amnezia has a spectacular aura aboutAmnezia has a spectacular aura about
 


Cancer Survivorship Save a Life
have you tried the xajax framework? it makes it 10 times easier to creat calls and returns between php and the client side javascript.
__________________
Webmaster Words
Amnezia is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:39 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger