Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    unable to modify the parent container element before the child element is closed

    Salve ragazzi, ho il problema descritto nel titolo, ho trovato su internet questo escamotage:
    codice:
    //defer="defer"
    <script defer="defer" type="text/javascript">   
    var newElem = document.createElement('foo');      
    document.body.appendChild(newElem);      
    </script>
    ma purtroppo non funziona, o quantomeno non so farla funzionare io.
    Vi posto tutta la pagina dove ho gli script, cosi magari sapere come risolvere.
    codice:
    	<link rel="stylesheet" href="calendarioDHTML/css/demos.css" media="screen" type="text/css">
    	<link rel="stylesheet" href="calendarioDHTML/css/calendar.css" media="screen" type="text/css">
    	<style type="text/css">
    	/* CSS for the demo. CSS needed for the scripts are loaded dynamically by the scripts */
    
    	
    	#mainContainer{
    		width:600px;
    		margin:0 auto;
    		margin-top:10px;
    		border:1px double #000;
    		padding:3px;
    
    	}
    	#calendarDiv,#calendarDiv2{
    		width:240px;
    		height:240px;
    		float:left;
    	}
    	.clear{
    		clear:both;
    	}
    	</style>	
    	<script type="text/javascript" src="calendarioDHTML/js/dhtmlSuite-common.js"></script>
    	<script type="text/javascript" src="calendarioDHTML/js/dhtmlSuite-calendar.js"></script>
    	<script type="text/javascript">
    	DHTMLSuite.include("calendar");
    	function calendarMonthChange(inputArray)
    	{
    		var calendarRef = inputArray.calendarRef;
    		
    		var month = inputArray.month;
    		var year = inputArray.year;
    		month++;
    		if(month>12){
    			month=1;
    			year++;
    		}
    		
    		var objectToChange = false;
    		switch(calendarRef.id)
    		{
    			case "calendar1":
    				objectToChange = myCalendar2;
    				break;
    			case "calendar2":	
    				objectToChange = myCalendar3;
    				break;
    			case "calendar3":
    				month-=3;
    				if(month<1){
    					month=12 + month;
    					year--;	
    				}
    				objectToChange = myCalendar;
    				break;
    		}
    		objectToChange.setDisplayedMonth(month);
    		objectToChange.setDisplayedYear(year);
    	}
    	</script>
    </head>
    <body>
    	<!--p>This calendar widget can be used by either including dhtml-suite-for-applications.js or by including only dhtmlSuite-common.js and by using the
    	DHTMLSuite.include() function, i.e. DHTMLSuite.include("calendar")</p-->
    	
    	<div id="calendarDiv"></div>
    	<div id="calendarDiv2"></div>
    	<div id="calendarDiv3"></div>
    	
    	<script defer="defer" type="text/javascript">
    	
    	var myCalendarModel = new DHTMLSuite.calendarModel({ initialYear:2009,initialMonth:11,initialDay:20 });
    	myCalendarModel.setLanguageCode('it');
    	var myCalendar = new DHTMLSuite.calendar({ id:'calendar1', callbackFunctionOnMonthChange:'calendarMonthChange',displayCloseButton:false,numberOfRowsInYearDropDown:12 } );
    	myCalendar.setCalendarModelReference(myCalendarModel);
    	myCalendar.setTargetReference('calendarDiv');
    	myCalendar.display()
    	
    	
    	var myCalendarModel2 = new DHTMLSuite.calendarModel({ initialYear:2009,initialMonth:11,initialDay:20 });
    	myCalendarModel2.setWeekStartsOnMonday(false);
    	myCalendarModel2.setLanguageCode('it');
    	var myCalendar2 = new DHTMLSuite.calendar({ id:'calendar2', callbackFunctionOnMonthChange:'calendarMonthChange',displayCloseButton:false });
    	myCalendar2.setCalendarModelReference(myCalendarModel2);
    	myCalendar2.setTargetReference('calendarDiv2');
    	myCalendar2.display();
    	
    	var myCalendarModel3 = new DHTMLSuite.calendarModel({ initialYear:2009,initialMonth:11,initialDay:20 });
    	myCalendarModel3.setLanguageCode('it');
    	var myCalendar3 = new DHTMLSuite.calendar({ id:'calendar3', callbackFunctionOnMonthChange:'calendarMonthChange',displayCloseButton:false });
    	myCalendar3.setCalendarModelReference(myCalendarModel3);
    	myCalendar3.setTargetReference('calendarDiv3');
    	myCalendar3.display();
    	
    	</script>
    	
    	<div class="clear"></div>
    	
    	
    	<h2>A date picker for form</h2>
    	<script defer="defer" type="text/javascript">
    	var calendarObjForForm = new DHTMLSuite.calendar({minuteDropDownInterval:10,numberOfRowsInHourDropDown:5,callbackFunctionOnDayClick:'getDateFromCalendar',isDragable:true,displayTimeBar:true}); 
    	calendarObjForForm.setCallbackFunctionOnClose('myOtherFunction');
    	
    	function myOtherFunction()
    	{
    		
    		
    	}
    	function pickDate(buttonObj,inputObject)
    	{
    		calendarObjForForm.setCalendarPositionByHTMLElement(inputObject,0,inputObject.offsetHeight+2);	// Position the calendar right below the form input
    		calendarObjForForm.setInitialDateFromInput(inputObject,'yyyy-mm-dd hh:ii');	// Specify that the calendar should set it's initial date from the value of the input field.
    		calendarObjForForm.addHtmlElementReference('myDate',inputObject);	// Adding a reference to this element so that I can pick it up in the getDateFromCalendar below(myInput is a unique key)
    		if(calendarObjForForm.isVisible()){
    			calendarObjForForm.hide();
    		}else{
    			calendarObjForForm.resetViewDisplayedMonth();	// This line resets the view back to the inital display, i.e. it displays the inital month and not the month it displayed the last time it was open.
    			calendarObjForForm.display();
    		}		
    	}	
    	/* inputArray is an associative array with the properties
    	year
    	month
    	day
    	hour
    	minute
    	calendarRef - Reference to the DHTMLSuite.calendar object.
    	*/
    	function getDateFromCalendar(inputArray)
    	{
    		var references = calendarObjForForm.getHtmlElementReferences(); // Get back reference to form field.
    		references.myDate.value = inputArray.year + '-' + inputArray.month + '-' + inputArray.day + ' ' + inputArray.hour + ':' + inputArray.minute;
    		calendarObjForForm.hide();	
    		
    	}	
    	</script>
    	<div id="calendarForForm">
    		<form name="myForm">
    		<table>
    			<tr>
    				<td>Select a date:</td>
    				<td><input type="text" name="myDate" value="2004-12-24 12:00" onclick=""></td>
    				<td><input type="button" value="Pick date" onclick="pickDate(this,document.forms[0].myDate);"></td>
    			</tr>
    			<tr>
    				<td>Select a date:</td>
    				<td><input type="text" name="myDate2" value="2004-12-24 12:00" onclick=""></td>
    				<td><input type="button" value="Pick date" onclick="pickDate(this,document.forms[0].myDate2);"></td>
    			</tr>
    			<tr>
    				<td colspan="3"><select style="width:300px"><option value="">This calendar covers select boxes</option><option value="">This calendar covers select boxes</option></select>
    			</td>
    		</table>
    		</form>
    	</div>
    	
    	<h2>A calendar where you only can select dates in 2004</h2>
    	<div id="calendarDiv4"></div>
    	
    
    This is done by adding invalid date ranges: </p>
    	<pre>
    	myCalendarModel5.addInvalidDateRange(false,{year: 2003,month:12,day:31});
    	myCalendarModel5.addInvalidDateRange({year: 2005,month:1,day:1},false);
    	</pre>
    	<script defer="defer" type="text/javascript">
    	
    	var myCalendarModel5 = new DHTMLSuite.calendarModel({ initialYear:2009,initialMonth:11,initialDay:20 });
    	myCalendarModel5.addInvalidDateRange(false,{year: 2009,month:11,day:20});
    	myCalendarModel5.addInvalidDateRange({year: 2005,month:1,day:1},false);
    	myCalendarModel5.setLanguageCode('en');
    	var myCalendar5 = new DHTMLSuite.calendar({ id:'calendar4',displayCloseButton:false,numberOfRowsInYearDropDown:12 } );
    	myCalendar5.setCalendarModelReference(myCalendarModel5);
    	myCalendar5.setTargetReference('calendarDiv4');
    	myCalendar5.display();
    	</script>
    		
    
    	<script defer="defer" type="text/javascript">
        var infolink_pid = 8714;
    	 var infolink_wsid = 0; 	
        var infolink_link_color = '009900';
        var infolink_title_color = '252667';
        var infolink_text_color = '000000';
        var infolink_ad_link_color = '24951E';
        var infolink_ad_effect_type = 0;
        var infolink_cat = 'software development';
    </script>
    <script type="text/javascript" src="http://resources.infolinks.com/js/infolinks_main.js"></script>
    Grazie mille e buona giornata.

  2. #2
    ho dimenticato di segnalarvi il relativo codice di errore(KB927917)

  3. #3
    questa dovrebbe essere la stringa dello script che mi va in errore, ma purtroppo non so come risolvere:
    codice:
    this.__positionDropDownMinutes()},__createMainHtmlEls:function(){this.divElement=document.createElement('DIV');this.divElement.className='DHTMLSuite_calendar';this.divElContent=document.createElement('DIV');this.divElement.appendChild(this.divElContent);this.divElContent.className='DHTMLSuite_calendarContent';if(this.targetReference)this.targetReference.appendChild(this.divElement);else document.body.appendChild(this.divElement);if(this.isDragable){try{this.referenceToDragDropObject=new DHTMLSuite.dragDropSimple({elementReference: this.divElement })}catch(e){alert('Include DHTMLSuite-dragDropSimple.js for the drag feature')}}
    grazie mille....

  4. #4
    questo è l'errore:this.target Reference.appendChild is not a function
    e precisamente è qui:

    codice:
    if(this.targetReference)this.targetReference.appendChild(this.divElement);
    else document.body.appendChild(this.divElement);
    come faccio per risolvere?grazie ancora

  5. #5
    nessuno ha avuto lo stesso problema?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.