Bonjour,

Cela fait plusieurs jours que je galère avec ce problème qui concerne IE.

J'ai fait beaucoup de recherche sur Internet, mais aucune n'a solutionné mon problème.

J'utilise un "plugin" javascript pour afficher du texte. Cela fonctionne très bien sur l'ensemble des navigateurs sauf sur IE ( :pirate: ) qui me retourne l'erreur suivante : L’objet ne gère pas la propriété ou la méthode « typewriting_other »

Voici l'appel de ma fonction dans mon fichier partie.php :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
load_txt(histoire_lab,'histoire_bloc');
Ensuite dans mon fichier js je fais appel à la fonction typewriting_other comme suit :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
function load_txt_enigme(content_val,target){
 
	$('.'+target).typewriting(content_val, {
	  // default: 150
	  "typing_interval": 50,
 
	  // default: 0.7s
	  "blink_interval": "1s",
 
	  // default: black
	  "cursor_color": "#00fd55"
	});
}
Et enfin le fichier qui contient la fonction final :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
	$.fn.typewriting_other = function( input_string, options, callback_func ) {
 
		// Get the height of cursor should be
		var cursorHeight = this.height();
		var cursorWidth = parseInt(cursorHeight/3);
		if( cursorHeight == 0 ) {
			this.text('I');
			cursorHeight = this.height();
			cursorWidth = this.width();
		}
 
		// Store setting and function from user
		settings = $.extend({
			typing_interval	: 150,
			blink_interval	: '0.7s',
			cursor_color	: 'black',
			inputString 	: '',
			tw_callback		: function(){},
			task			: 'unready',
		}, options);
 
		// Handle inputString ---required
		if( input_string ) {
			if( typeof input_string == 'string' )
				settings.inputString = input_string;
			else
				throw new Error(`${input_string} is not a string`);
		}
		else
			throw new Error('Missing argument: String');
 
		// Handle callback
		if( callback_func ) {
			if( typeof callback_func == 'function' )
				settings.tw_callback = callback_func;
			else {
				console.error(`${callback_func} is not a function`);
				_cleanCallback();
			}
		} else
			_cleanCallback();
 
		// Add cursor style in HEAD
		$('head').append( `<style type='text/css'>@-webkit-keyframes blink{0%,100%{opacity:1}50%{opacity:0}}@-moz-keyframes blink{0%,100%{opacity:1}50%{opacity:0}}@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}.typingCursor_other::after{content:'';width:${cursorWidth}px;height:${cursorHeight}px;margin-left:5px;display:inline-block;vertical-align:bottom;background-color:${settings.cursor_color};-webkit-animation:blink ${settings.blink_interval} infinite;-moz-animation:blink ${settings.blink_interval} infinite;animation:blink ${settings.blink_interval} infinite}</style>` );
 
		settings.task = 'typing';
		_typingGo( this.addClass('typingCursor_other') );
 
	};
IE me ressort 3 erreurs, 2 qui correspondent à l'erreur "caractères incorrectes" à la ligne 4 du code ci-dessous :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
function load_txt_enigme(content_val,target){
 
	$('.'+target).typewriting(content_val, {
	  // default: 150
	  "typing_interval": 50,
 
	  // default: 0.7s
	  "blink_interval": "1s",
 
	  // default: black
	  "cursor_color": "#00fd55"
	});
}
et la dernière "L’objet ne gère pas la propriété ou la méthode "typewriting_other" : à la ligne 28 du code ci-dessous :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
	$.fn.typewriting_other = function( input_string, options, callback_func ) {
 
		// Get the height of cursor should be
		var cursorHeight = this.height();
		var cursorWidth = parseInt(cursorHeight/3);
		if( cursorHeight == 0 ) {
			this.text('I');
			cursorHeight = this.height();
			cursorWidth = this.width();
		}
 
		// Store setting and function from user
		settings = $.extend({
			typing_interval	: 150,
			blink_interval	: '0.7s',
			cursor_color	: 'black',
			inputString 	: '',
			tw_callback		: function(){},
			task			: 'unready',
		}, options);
 
		// Handle inputString ---required
		if( input_string ) {
			if( typeof input_string == 'string' )
				settings.inputString = input_string;
			else
				throw new Error(`${input_string} is not a string`);
		}
		else
			throw new Error('Missing argument: String');
 
		// Handle callback
		if( callback_func ) {
			if( typeof callback_func == 'function' )
				settings.tw_callback = callback_func;
			else {
				console.error(`${callback_func} is not a function`);
				_cleanCallback();
			}
		} else
			_cleanCallback();
 
		// Add cursor style in HEAD
		$('head').append( `<style type='text/css'>@-webkit-keyframes blink{0%,100%{opacity:1}50%{opacity:0}}@-moz-keyframes blink{0%,100%{opacity:1}50%{opacity:0}}@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}.typingCursor_other::after{content:'';width:${cursorWidth}px;height:${cursorHeight}px;margin-left:5px;display:inline-block;vertical-align:bottom;background-color:${settings.cursor_color};-webkit-animation:blink ${settings.blink_interval} infinite;-moz-animation:blink ${settings.blink_interval} infinite;animation:blink ${settings.blink_interval} infinite}</style>` );
 
		settings.task = 'typing';
		_typingGo( this.addClass('typingCursor_other') );
 
	};
Est-ce que vous auriez une idée comment résoudre ce souci ?

Par avance un grand merci