How To Run If And Else Block Of Code Alternatively When Page Refresh C# Web App?
I am trying to implement some logics, but for that I have to use logic which I am not getting. How would I run an if condition and else condition alternative time when the page refreshes.
What would开发者_JAVA技巧 be the logic hopes for your suggestions?
my code is below,
var activeColor = '#ff0000';
var inactiveColor = '#0000FF';
var points = [
new GLatLng(24.85229, 67.01703),
new GLatLng(24.914463, 67.0965958),
new GLatLng(24.86588, 67.06089),
new GLatLng(24.9726753, 67.06638),
new GLatLng(24.840023, 67.24285),
new GLatLng(24.85229, 67.01703)
];
var polyline = new GPolyline(points, '#ff0000', 5, 0.7);
GEvent.addListener(polyline, 'click', function() {
var color = inactiveColor;
inactiveColor = activeColor;
activeColor = color;
polyline.setStrokeStyle({ color: activeColor });
});
map.addOverlay(polyline);
}
}
function reFresh() {
location.reload(true)
}
window.setInterval('reFresh()',20000);
How to change poly line color alternatively red and blue when page refresh how can we use if else condition here ??
hopes for your suggestions..
Depending upon your actual usage, either a session variable or a value kept in a control.
精彩评论