View Full Version : reload only part of page
gtriant
07-11-2007, 10:45 AM
Hi!
I am trying to embed to the menu of my site a script that shows the weather in one place (from weather.com). What i want to do is give the ability to the user to pass into this script a parameter (coming from a drop down menu), in order to be able to see the weather in various places.
The problem is that i want to reload only the script each time the user changes the place from the menu and not the whole page.
Can this be done with js??? Frames is not an option....
RysChwith
07-11-2007, 12:26 PM
You'll want to look into AJAX for this (a Google search should turn up a ton of hits).
Rys
gtriant
07-12-2007, 06:18 AM
I've been trying with ajax. Specifically with a taglist for ajax-jsp that i found, but I just can't get there...
Bellow i describe the problem a bit better, hoping for an answer. I'd be most thankful for your answers since i am on a deadline...
There's this script that i want to include into the menu of my website that produces a box, which displays the weather forecast in a certain place. (which menu is included in every page).
The script is actually an address :
<script src="voap.weather.com........ /param_place/ ...."></script>
With the "param_place" you set the place for which some weather data are shown. What i want to do, is to give the ability to the user with a select menu to be able to change this place. Mind that the places that populate the list is data that comes from the database. The problem is that reloading the whole page each time the user selects another place from the drop-down list, is not an option for some other reasons.
So i only want to reload the certain part of my code. My code, before realizing that i have to avoid reloading the whole page, looked something like this:
<sql query>select places....</sql query>
<form action="code for producing the exact same URL of the current page">
<select var="places" onChange="form.submit()">
<c:forEach place...>
<option>....</option>
</c:ForEach>
<form>
<script src="...."></script>
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.