- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi there
I have the following web page trying to do a ajax post to a coldfusion page which inserts data to a file:
dave.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm
<html xmlns="http://www.w3.org/1
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<script type="text/javascript" src="prototype.js">
</script>
<script type="text/javascript" src=
"scriptaculous.js">
</script>
<script type="text/javascript">
//new Ajax.Request('saveportal.c
function displaymessage()
{
var opt = {
// Use POST
method: 'post',
// Send this lovely data
postBody: escape('thisvar=true&thatv
// Handle successful response
onSuccess: function(t) {
alert(t.responseText);
},
// Handle 404
on404: function(t) {
alert('Error 404: location "' + t.statusText + '" was not found.');
},
// Handle other errors
onFailure: function(t) {
alert('Error ' + t.status + ' -- ' + t.statusText);
}
}
new Ajax.Request('http://10.5.
}
</script>
<body>
<input type="button" value="Click me!" onclick="displaymessage()"
</body>
</html>
Coldfusion page saveportal.cfm:
<cffile action="write" addnewline="yes" file="c:\dave.txt" output="Page Hit" fixnewline="yes">
When I run dave.html, there is a slight pause and I get 500 -- Internal Server Error, i.e the failure function. I am new to Ajax and I have no idea what this could be, is the set up incorrect, do I need to do anything special in coldfusion etc etc??
Also if I open the coldfusion page by itself it works fine.
Any help would be much appreciated!
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: SBennettPosted on 2008-03-26 at 23:27:30ID: 21218987
It looks like you have coldfusion 8, so I would use cfjaxproxy and point it to a CFC with a function to write the file. here is an example
Select allOpen in new window