[Jslib] http.js module problems

Pete Collins pete at mozdevgroup.com
Thu Dec 2 08:49:32 EST 2004


The http module is a contributed module and still needs review.

I am not sure I am happy w/ the http API as it is. It is a module "In 
Flux" and untested.

I will file a bug and get on this issues ASAP.

Thanks

--pete

Ryan wrote:

> Does anyone have a working example of the http.js module?  I have a 
> moz app that needs to post a file to a web page via javascript instead 
> of having a user manually post via a html form with a file input box.  
> Here is the js code in the moz app, this is all based on the example 
> code in the http.js module documentation on the jslib website:
>
>      try{var oXMLFile = new 
> File("C:\\Data\\someJournal.xml");}catch(e){alert(e);} //Currently 
> Active Doc File Path
>      alert("file size is: " + oXMLFile.size);
>      try{var req = new 
> FilePostRequest("http://localhost/Journals/index.php");}catch(e){alert(e);} 
>
>      
> try{req.setFile("someJournal.xml",oXMLFile,"text/xml");}catch(e){alert(e);} 
>
>      try{var oHTTP = new HTTP();}catch(e){alert(e);}
>      alert('HTTP object created');
>      try{var bResponse = oHTTP.doOperation(req);}catch(e){alert(e);}  
> // ------ application freezes when this line executes
>      alert('done publishing file');
>
>
> I'm not catching any errors but the application freezes when the 
> .doOperation method on the second to last line executes.  I don't 
> really know how to debug from here - the documentation on the http 
> module seems scant.  Does anyone have a working example of posting a 
> file to a web page?
>
> Thanks.  mawrya
> _______________________________________________
> Jslib mailing list
> Jslib at mozdev.org
> http://mozdev.org/mailman/listinfo/jslib
>
>

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions 




More information about the Jslib mailing list