Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Exercise 2</title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
- </head>
- <body>
- <h1>Exercise 2</h1>
- <!-- Place HTML markup here-->
- <!-- <form action="" id="contactForm" onsubmit="submitForm()"> -->
- Contact ID: <input type="text" name="contact" value="" id="contactID"/><br />
- <button type = "button" onclick="submitForm()">click me</button>
- <input type="submit" name="submit" value="Submit" /><br />
- <!-- </form> -->
- <div id="output"></div>
- </body>
- <script type="text/javascript" src="static/js/entries/exercise2.js"></script>
- <script type="text/javascript">
- function submitForm(){
- var id = $('#contactID').val();
- var urlString = "/api/index.php/contact/" + id + ""
- console.log(urlString);
- $.ajax({
- url: urlString,
- type: "GET",
- }).done( function(data){
- $("#output").html(data);
- });
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement