WAML - Web Application Markup Language

WAML - Web Application Markup Language

Posts 1-1 of 1
  • Evgenios Skitsanos
    Evgenios Skitsanos    Group moderator
    The company name is only visible to registered members.
    Working with Waml.Http
    In Waml 1.5 i moved out HTTP part away from Waml.Utils and allocated in within Waml.Http. The reason i did this is because these days Backbase guy, Sergey Ilinksy (http://www.ilinsky.com/) released his nice XmlHttpRequest wrapper that i consider as better implementation of HTTP handling, then Adoeb Spry ones that i was using earlier. I really recommend to look into Sergey's post at: http://www.ilinsky.com/articles/XMLHttpRequest/

    Ok, now little sample of how to open HTTP connection on certain URL and post there some data:

    //Post data to the url and return reply from server into text container
    Waml.Http.open("POST", "/waml/rpc.aspx", true, function(req){$("FrontPage").innerHTML = req.responseText;}, function(req){ $("FrontPage").innerHTML = req.responseText;}, {postData: "xx=111&bbb=222"});


    Waml.Http.open(method, url, async, result, fault, options), where:
    * method - HTTP method, like POST, GET, HEAD, PUT....
    * url - location of the resource
    * result - callback function for positive results (200 OK)
    * fault - callback function for negative results (404, 500)
    * options - array of options, for the moment "postData" is the only option

    cheers,
    Evi.