"onclick" on TAB = load new url ?

Hey guys

Is there a way to load a new url when i click on a tab?
I tried the following code but did not work.

<body onload="init();" >
	<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
         <div class="dhx_minical_icon" id="dhx_minical_icon" onclick="show_minical()">&nbsp;</div>
         <div class="dhx_cal_tab" name="unit_tab" onclick="window.location.replace('new1.html')" style="right:542px;"></div>
         <div class="dhx_cal_tab" name="map_tab" onclick="window.location.replace('new2.html')" style="right:450px;"></div>
			<div class="dhx_cal_tab" name="day_tab" style="right:316px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:224px;"></div>			
			<div class="dhx_cal_tab" name="month_tab" style="right:132px;"></div>
         <div class="dhx_cal_tab" name="year_tab" style="right:40px;"></div>
		<div class="dhx_cal_header"></div>
		<div class="dhx_cal_data"></div>		

Thank you

You can catch onBeforeViewChange event of scheduler and call any custom code from it.

I’m really new with Javascript.
If i write it like this:

scheduler.attachEvent("onBeforeViewChange", function(old_mode, old_date, new_mode, new_date) {
                scheduler.config.map_start = scheduler.date.month_start(new Date((new_date||old_date).valueOf()));
                scheduler.config.map_end = scheduler.date.add(scheduler.config.map_start, 1, "month");
                return true;

he’s realoading all the time. How can i fix this?

Thank you

scheduler.attachEvent("onBeforeViewChange", function(old_mode, old_date, new_mode, new_date) { if (new_mode == "map") window.location.replace('new1.html'); return true; });

Now it will reload page only when map tab is activated.

Thank you :slight_smile:

This helps a lot