SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 28th, 2003, 11:15 AM
Kaklz Kaklz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Latvia
Posts: 3 Kaklz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Saving form data in XUL ?

I've been searching all over the net for the past couple of hours for examples .. but the ones I've found are not working.

So, I hope somebody will be able to help me.

The problem is about building some backend for a site using XUL as interface language .. as all of us know, there is no such thing as form submit in XUL, so we have to use JavaScript in order to handle this.

The problem I'm experiencing is with sending data using XMLHttpRequest object.

I found some example like this
var url="http:///xul/saver.php";
var xrequest=new XMLHttpRequest();
xrequest.open("POST",url,false);
xrequest.send(null);
var result=xrequest.responseText;


The saver.php file looks like this:
<?php
echo $_SERVER['REQUEST_URI'];
print_r($_REQUEST);
?>

So as far as I understand, I have to put the data I wish to send into the send method of the XMLHttpRequest. Whenever I do that .. nothing actually happens ..

I mean, no request variables appear.

I do the request like this:

var url="http:///xul/saver.php";
var xrequest=new XMLHttpRequest();
xrequest.open("POST",url,false);
xrequest.send("id=1");
var result=xrequest.responseText;

By the way, maybe there are some examples about this that I've missed?

If anybody is able to help, thanks in advance.

Reply With Quote
  #2  
Old October 28th, 2003, 12:51 PM
Kaklz Kaklz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Latvia
Posts: 3 Kaklz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hmm .. probably the problem was with headers .. but this one is working.

<script>

var objHTTP, strResult;
objHTTP = new XMLHttpRequest();
objHTTP.open("POST","index.php",false);
objHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

objHTTP.send("id=1&kaka=some other string");

strResult=objHTTP.responseText;
alert(strResult);
</script>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Saving form data in XUL ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway