0

I'm trying to use the Clipped API (http://www.clipped.me/api.html) to return article summaries when a user submits an article url. When the user submits an appropriate URL, they're redirected to a new page with the JSON result. I'd like to keep the user on the page and parse the JSON string in JavaScript. I'm assuming that the redirect has something to do with the fact that the form action is a link to the script itself, but I'm not sure what to do here. Below is the code.

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Summarize you will!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
</head>

<body>

    <form action="http://clipped.me/algorithm/clippedapi.php?url=[URL]"  method="get">
        <input type="text" name="url"/>
        <input type="submit" value="Submit"/>
    </form>

</body>

<script type="text/javascript">

</script>


</html>
4

1 に答える 1

0

Don't use form submission to call the API . Use AJAX call instead.

于 2013-03-27T06:16:42.047 に答える