Bonjour,
Je crée un objet que va comprendre un objet du dom "Range".
Pour l'initialiser une fois intancié j'écrit var x.range = new Range; (x.range est défini = {}; // not yet determined object, ce qui plante IE11 (erreur445 (non documentée) mais avec le texte : "Cet objet ne gère pas cette action" , pendant que chrome et FireFox exécutent sans problème.
J'attends de retrouver dans x.range les éléments d'un range non constitué et de disposer de toutes les fonctions de l'objet.
Voici l'extrait de code (le script a plus de 3000 lignes, ce sont presque les premières, la définition des objets :
Ce bout code n'est pas accepté (il l'est par chrome (PC et Mobile, Firefox (PC et mobile), IE11 crashed with console message :
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 var aSelection = function (selName) { this.id = ''; this.Name = selName; this.type = ''; this.Text =''; this.Comment =''; this.selectedRange = {}; // getRange of selection select one only range into multiple selection this.Range = {}; // new Range ;Will get the range when the selection is fixed (supports only one range this.Start = {};// in the node but attributes are adapted .todo simplify management this.End = {}; // in the node but attributes are adapted .todo simplify management this.autoupd = false; this.Node = {}; // Defined after treatment of the Range and add if necessary off an element, by default the Valid HTML which envelops the Range this.Node.element = {}; // The Node is the element which is the closest envelop of the range after analyse this.Node.start = {}; // The element which is closest the element before the beginning of the range can be a copy of AnchorNode of Range this.Node.end = {}; // The element which is the closest element after the end of the range can be a copy of BaseNode of Range this.Header = {}; this.Header.id = ''; this.Header.xname = ''; // enocoded text of header this.Header.JQelement={}; // JQuery selection objet with length = 1 this.Header.Text=''; this.Header.level =''; this.Layer = {}; this.Layer.JQelement={}; // JQuery selection object with length = 1 for Layer element this.url = ""; // Contains the fragment defined this.init = false; // Init is ended validated this.locked = false; // The selection is ready for data to be stored and must not be modified (locked) has been frozen this.generated={}; this.generated.selectionchange = false; // Function to check and set coherency }; /** * These vars can be used only to compare data with values not for inherited objects * @type {aSelection} */ var curSelection = new aSelection('current'); curSelection.Range=new Range; // IE js don't accepts inherit objets !!! in ...### as this.Range = new Range should be ??? var prevSelection = new aSelection('previous'); prevSelection.Range=new Range; var curBkmRange = new Range; // The range associated to a frozen selection to current Bkm creation
Le lien "SCRIP445" aboutit à une page 404 !!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 SCRIPT445: Cet objet ne gère pas cette action Fichier : functions.js, ligne : 352, colonne : 1 : curSelection.Range=new Range;
Je ne comprend vraiment pas pourquoi avec IE (11) il semble impossible de créer un objet ayant la structure du objet du DOM (il n'a pas besoin de protypage), ici un Range, ceci en utilisant une instanciation
Code : Sélectionner tout - Visualiser dans une fenêtre à part myobject = new Range;
Cette erreur majeure stoppe le script et le rend donc totalement inutilisable ainsi que tout l'application.
D'autre part cette manière de créer des objets est utilisée de nombreuses fois (l'exemple est le premier cas) dans la suite
Si vous avez un idée, merci d'avance
Trebly
Partager