The_Alligator
06-22-2010, 02:02 PM
Here is a JQuery AJAX call from a tutorial
<script type="text/javascript">
$(document).ready(function() {
$("#getWeatherReport").click(function(){
$cityName = document.getElementById("cityName").value;
$.post("WeatherServlet", {cityName:$cityName}, function(xml) {
$("#weatherReport").html( $("report", xml).text() );
});
});
});
</script>
JSP page
<form method="post">
Enter City :
<input id="cityName" name="cityName" size="30" type="text" />
<input id="getWeatherReport" name="getWeatherReport" type="button" value="Get Weather" />
</form>
<div id="weatherReport" class="outputTextArea"></div>
what is report in the above code ?
Is it a JQuery keyword ?
Can I rename it to anything I like ?
Does it have any dependency elsewhere ?
<script type="text/javascript">
$(document).ready(function() {
$("#getWeatherReport").click(function(){
$cityName = document.getElementById("cityName").value;
$.post("WeatherServlet", {cityName:$cityName}, function(xml) {
$("#weatherReport").html( $("report", xml).text() );
});
});
});
</script>
JSP page
<form method="post">
Enter City :
<input id="cityName" name="cityName" size="30" type="text" />
<input id="getWeatherReport" name="getWeatherReport" type="button" value="Get Weather" />
</form>
<div id="weatherReport" class="outputTextArea"></div>
what is report in the above code ?
Is it a JQuery keyword ?
Can I rename it to anything I like ?
Does it have any dependency elsewhere ?