0 Replies Latest reply on Aug 29, 2009 11:41 AM by Mahen23

    Ajax POST to php

    Mahen23 Level 1

      I have the following code that works with jquery (see kjots.com)

      Here 7773 is a unique id that is found in the database file. Am doing everything as per the examples, but still the code will not work.



          <title>Hello World</title>
          <script src="AIRAliases.js" type="text/javascript"></script>
      <script type="text/javascript">
          function appLoad()
         var variables = new air.URLVariables("sear=7773");
      var request = new air.URLRequest();
      request.url = "http://kjots.com/fred.php";
      request.method = air.URLRequestMethod.POST;
      request.data = variables;
      var loader = new air.URLLoader();
      loader.dataFormat = air.URLLoaderDataFormat.VARIABLES;
      loader.addEventListener(air.Event.COMPLETE, completeHandler);
      catch (error)
          air.trace("Unable to load URL");

      function completeHandler(event)




        <body onLoad="appLoad()">
        <h1>Hello World</h1>