Hello I am trying to call a web service of Twitter using pure html and java script.
so i have tried to use jQuery.
here is my sample code …
where i m mistaking … please help …
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Lookup</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery-1.5.2.min.js"></script>
<script type="text/javascript" charset="utf-8">
function callWebService(){
alert("Hello . . ");
$.ajax({
url:'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=gloriahansen',
dataType: 'json',
data: data,
success:function(data) {
alert(data);
}
});
alert("Hello . . . . . . . . .");
};
</script>
</head>
<body>
<h1 id="ajax">
Put Stuff in Me
</h1>
<Button onclick="callWebService();">Call Web Service</Button>
</body>
</html>
Please don’t reinvent the wheel. 😉
Use this plugin http://code.google.com/p/jquery-twit/