Skip to main content

Bug Tracker

Side navigation

Ticket #1890: jquery_test.html
File jquery_test.html, 1.1 KB (added by davidserduke, December 16, 2007 11:57AM UTC)

test case

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>Tester</title>
    <style type="text/css">
      #container { background:yellow; width:200px; }
    </style>
    <script type="text/javascript" src="../jquery.js"></script>
    <script type="text/javascript">
      $(function () {
        $("button:first").click(function () {
              $.ajax({
                      url:"load.xml",
                      success:function (xml) {
                            $("#container").text($("resposta", xml).text());
                          }
                    });
              var s = "from $.ajax()";
              $("#adiv").text(s);
            });
        $("button:last").click(function () {
              $("#container").load("load2.xml");
              var s = "from $().load()";
              $("#adiv").text(s);
            });
      });
    </script>
  </head>
  <body>
    <button>$.ajax()</button>
    <button>$().load()</button>
    <div id="container">
      Hi
    </div>
    <div id="adiv"></div>
  </body>
</html>

Download in other formats:

Original Format