[Dojo-interest] XMLHTTPTransport Error: 0, Type: unknown

Thomas Wolf tw at wsf.at
Sat Feb 10 17:11:59 MST 2007


How do you call insert_exists()? I tried to reproduce
your situation and got the same error under certain
circumstances when coding:
<form id="test" onsubmit="insert_exists(this)">
while:
<form id="test" onsubmit="return(insert_exists(this))">
worked reliably.

Thomas


> 
> Thanks
> Spiros
> 
> -----Original Message-----
> From:	dojo-interest-bounces at dojotoolkit.org on behalf of Spiros Papadopoulos
> Sent:	Mon 05/02/2007 17:23
> To:	dojo-interest at dojotoolkit.org
> Cc:	
> Subject: [Dojo-interest] XMLHTTPTransport Error: 0, Type: unknown
> 
> function firstCountryDetails(selected) {
>      var selection = selected.options[selected.selectedIndex].value;
>      var urlstring = "scripts/getcountryFlag.php?country="+selection;
>      if(selection.length > 0) {
>             dojo.require("dojo.io.*");                        
> 
>             var args = {
>                   url: urlstring,
>                   mimetype: "text/plain",
>                   method: "GET",
>                   transport: "XMLHTTPTransport",
>                   error: function(type, error, httpObj) {
>                         alert("Error: "+error.message+", Type:
> "+error.type);
>                   },
>                   load: function(type, data, httpObj) {
>                       alert(data);
>                  }
>            };
>            dojo.io.bind(args);
>      }
> }
> 
> I have the above function which is working fine. 
> I also have the one below which is giving me an error:
> 
> XMLHTTPTransport Error: 0, Type: unknown
> 
> In my opinion the functions are the same, except the url and the way
> it's constructed.
> 
> Is what I am doing valid? shouldn't this work? With the one above I
> don't have any problem at all...!
> 
> function insert_exists(tform) {
>       var urlstr = "scripts/contact_exists.php?";
>       /* get elements from form */
>       var elVal;
>       var elName;
>       for(var x = 0; x < tform.elements.length; x++) {
>             elVal = tform.elements[x].value;
>              if(elVal != "") {
>                   elName = tform.elements[x].name;
>                   if(elName != "") {
>                         urlstr += elName+"="+elVal+"&";
>                   }
>              }
>        }    
> 
>        urlstr = urlstr.substring(0, urlstr.length -1);
> 
>        if(urlstr.length > 0) {
>              dojo.require("dojo.io.*");
> 
>              alert(urlstr); //<-- prints correctly here
> 
>              var args = {
>                  url: urlstr,
>                  mimetype: "text/plain",
>                  method: "GET",
>                  transport: "XMLHTTPTransport",
>                  error: function(type, error, httpObj) {
>                       alert("Error: "+error.message+",Type: "+error.type);
>                  },
>                  load: function(type, data, httpObj) {
>                       alert(data);
>                  }
>             };
>             dojo.io.bind(args); 
>       }
> }
> 
> Thanks in advance
> Spiros
> 
> 
> 
> 
> Note:__________________________________________________________________
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission.
> If you receive this message in error, please immediately delete it and
> all copies of it from your system, destroy any hard copies of it and
> notify the sender. You must not, directly or indirectly, use, disclose,
> distribute, print, or copy any part of this message if you are not the
> intended recipient. Jaguar Freight Services and any of its subsidiaries
> each reserve the right to monitor all e-mail communications through its
> networks.
> Any views expressed in this message are those of the individual sender,
> except where the message states otherwise and the sender is authorized
> to state them to be the views of any such entity.
> ________________________________________________________________________
> This e-mail has been scanned for all known viruses.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest



More information about the Dojo-interest mailing list