Mam taki skrypt:
<script language="javascript" type="text/javascript">
// Global variables.
var numSeconds;
var timerId = null;
var timerInterval = 1000;
var numUpdates = 0;
// Handle OnLoad event.
window.onload = Window_OnLoad;
function Window_OnLoad()
{
StartProcess();
}
// Starts the process for updating the Map.
function StartProcess()
{
// 200 x 3 seconds = 600 seconds = 10 minutes demo.
if ( numUpdates < 72 )
{
// Duration between actual updates to the map in seconds.
numSeconds = 3;
UpdateMap();
numUpdates++;
}
}
// Continues the process of updating the Map.
function UpdateMap()
{
if ( numSeconds == 0 )
{
// Clears the timer.
clearTimeout(timerId);
// Update the Map control.
var mapControl = document.getElementById("MapControl1");
mapControl.doCallback("IncrementSales", "");
// Restart the process.
StartProcess();
}
else
{
// Decrease the value for seconds.
numSeconds = numSeconds - 1;
// Continue the delayed process.
timerId = self.setTimeout("UpdateMap()", timerInterval);
}
}
</script>
Wszystko działa dobrze, jeśli jest on umieszczony na zwykłej samodzielnej stronie. Jeżeli jednak używam MasterPages i ContentPages i wklejam ten sam skrypt na stronke typu ContentPage, to nie działa - dlaczego? I co poprawić żeby zadziałało? Zaznaczam że słabo się orientuję w javascriptach, dlatego wszelka pomoc mile widziana.
Pozdrawiam,
Piote
Pozdrawiam