dojo: Send Data to the Server using Get (Query String)

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”
    “http://www.w3.org/TR/html4/strict.dtd”>
<html>
    <head>
        <title>Dojo</title>   
    <!– load the dojo toolkit base –>
    <script type=”text/javascript” src= “dojo/dojo/dojo.js”
        djConfig=”parseOnLoad:true, isDebug:true”></script>
    <script type=”text/javascript”>
       // Load Dojo’s code relating to the Button widget
       dojo.require(“dijit.form.Button”);
    </script>

<script>
       function helloCallback(data,ioArgs) {
          alert(data);
       }      
       function helloError(data, ioArgs) {
          alert(‘Error when retrieving data from the server!’);
       }
</script>

<button dojoType=”dijit.form.Button” id=”helloButton”>
        Click here to read data from the server!!
      <script type=”dojo/method” event=”onClick”>
        dojo.xhrGet({
           url: ‘ReadDojoGetResponse.aspx’,
           load: helloCallback,
           error: helloError,
           content: {name: dojo.byId(‘name’).value }
        });
        </script>
    </button>
    <br>
name: <input type=”text” id=”name”>

    <style type=”text/css”>
    /* CSS  */ 
    .testClass {
    background-color:red;
}
    </style>   
    </head>
    <body>
        <h1 id=”testHeading”>Dojo Click Button – Widgets</h1>       
        <div id=”contentNode”>
        <p></p>
    </div>
    </body>
</html>

///NOTE: Create a simple jsp page to read Query String parameter : Name.
///something like: <%= request.getParameter(“name”) %>

Advertisements

2 Responses

  1. Have you ever considered about adding a little bit more than just your articles?
    I mean, what you say is valuable and everything.

    However think of if you added some great
    images or video clips to give your posts more, “pop”!
    Your content is excellent but with pics and videos, this blog could definitely be one of the most
    beneficial in its niche. Amazing blog!

  2. Just want to say your article is as astounding. The clearness in your
    post is just spectacular and i could assume you’re an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the rewarding work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: