Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

search in this page(поиск на этой странице).

more options

Привет я делаю один проект. И обнаружил следующую проблему: на странице с следующим куском кода: Hi, I'm doing a project. He found the following issue: on a page with the following piece of code:

//-=-=-=-=code start function search_labels(node, class_name){ /** * Ищем лейблы. * Добавляем их в массив. * Возвращем массив. */ console.log("iq_map_label_control.search_labels"); var txt_node_array = [];

for(var i=0; i < node.childNodes.length; i++){ if(node && node.childNodes[i].nodeName != "#text" && node.childNodes[i].nodeName != "#comment"){ var curent_node_a = node.childNodes[i]; for(var y=0; y < curent_node_a.childNodes.length; y++){

var class_flag = class_search(curent_node_a.childNodes[y], class_name); if( curent_node_a && curent_node_a.childNodes[y].nodeName != "#comment" && class_flag == true){ //console.log(curent_node_a.childNodes[y]); txt_node_array.push(curent_node_a.childNodes[y]);

}// if }// for y }// if }// for i

//console.log(txt_node_array); return txt_node_array;

}

//-=-=-=-=-=code end

//-=-=-=-=-=svg start

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 841.9 595.3" style="enable-background:new 0 0 841.9 595.3;" xml:space="preserve"> <g class="map_scene" id="map_scene"> <g id="bildings"> <g class="bld"> <polygon class="f fll-blue" id="b_b21-22_poly" points="339.8,437.4 339.8,435 339.8,434.9 339.8,431.8 334,431.8 334,434.9 317.3,434.9 317.3,431.8 311.7,431.8 311.7,434.9 311.7,435 311.7,440 303.2,440 303.2,438.4 266,438.4 266,450.9 303.2,450.9 311.7,450.9 311.7,450.8 339.8,450.8 339.8,445.4 341.3,445.4 341.3,437.4 "/> <text class="bilding_label zoom_layer_1" id="b_b21-22_txt" x="288.944117647" y="446.35" fill="#ddd">21-22</text> </g> <g class="bld"> <polygon class="f fll-red" id="b_r89_poly" points="362.2,221.9 376,249.4 295.4,285.9 281.3,258.6 "/> <text class="bilding_label zoom_layer_0" id="b_r89_txt" x="322.767647059" y="258.9" fill="#ddd">89</text> </g> <g class="bld"> <polygon class="f fll-yello" id="b_y71_poly" points="598.2,220.3 592.3,254.9 650.9,264.2 660.3,245.5 "/> <text class="bilding_label zoom_layer_0" id="b_y71_txt" x="620.417647059" y="247.25" fill="#ddd">71</text> </g>

</g> </g> <script type="text/javascript" xlink:href="js//lib/vendor/jquery/jquery-2.1.3.min.js"/> <script type="text/javascript" xlink:href="js//lib/utils/DOM_navigation.js"/> <script type="text/javascript" xlink:href="js//lib/utils/class_search.js"/> <script type="text/javascript" xlink:href="js//lib/modules/iq_map_label_control.js"/> <script type="text/javascript" xlink:href="js//app.js"/> </svg>

//-=-=-=-=-=svg end (svg код я сократил по максимуму, оставив лишь главное и естественно сократив это.) Появляется множество окон "поиск на этой странице(см. файл в приложении). Путем последовательного отключения блоков кода, было выявленно что именно этот код вызывает такое поведение. Уточню, что документ полность SVG и манипуляции я произвожу с элементами <Text> в google chrome такой проблемы я не наблюдал.

(svg code I cut to the maximum, leaving only the main course and cut it.) I get a lot of windows' search on this page (see. File attached). By disconnecting the serial code was revealing that this code calls this behavior. Clarify that the document is fully SVG and manipulation I make with elements <Text> in google chrome a problem I have not seen.

С уважением Евгений Лабузов. Eugene Labuzov.

Привет я делаю один проект. И обнаружил следующую проблему: на странице с следующим куском кода: Hi, I'm doing a project. He found the following issue: on a page with the following piece of code: //-=-=-=-=code start function search_labels(node, class_name){ /** * Ищем лейблы. * Добавляем их в массив. * Возвращем массив. */ console.log("iq_map_label_control.search_labels"); var txt_node_array = []; for(var i=0; i < node.childNodes.length; i++){ if(node && node.childNodes[i].nodeName != "#text" && node.childNodes[i].nodeName != "#comment"){ var curent_node_a = node.childNodes[i]; for(var y=0; y < curent_node_a.childNodes.length; y++){ var class_flag = class_search(curent_node_a.childNodes[y], class_name); if( curent_node_a && curent_node_a.childNodes[y].nodeName != "#comment" && class_flag == true){ //console.log(curent_node_a.childNodes[y]); txt_node_array.push(curent_node_a.childNodes[y]); }// if }// for y }// if }// for i //console.log(txt_node_array); return txt_node_array; } //-=-=-=-=-=code end //-=-=-=-=-=svg start <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 841.9 595.3" style="enable-background:new 0 0 841.9 595.3;" xml:space="preserve"><!-- modules/a/header_doc.php --> <g class="map_scene" id="map_scene"> <g id="bildings"> <!-- blue start ++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <g class="bld"> <polygon class="f fll-blue" id="b_b21-22_poly" points="339.8,437.4 339.8,435 339.8,434.9 339.8,431.8 334,431.8 334,434.9 317.3,434.9 317.3,431.8 311.7,431.8 311.7,434.9 311.7,435 311.7,440 303.2,440 303.2,438.4 266,438.4 266,450.9 303.2,450.9 311.7,450.9 311.7,450.8 339.8,450.8 339.8,445.4 341.3,445.4 341.3,437.4 "/> <text class="bilding_label zoom_layer_1" id="b_b21-22_txt" x="288.944117647" y="446.35" fill="#ddd">21-22</text> </g> <!-- blue end ++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- red start ++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <g class="bld"> <polygon class="f fll-red" id="b_r89_poly" points="362.2,221.9 376,249.4 295.4,285.9 281.3,258.6 "/> <text class="bilding_label zoom_layer_0" id="b_r89_txt" x="322.767647059" y="258.9" fill="#ddd">89</text> </g> <!-- red end ++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- yello start ++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <g class="bld"> <polygon class="f fll-yello" id="b_y71_poly" points="598.2,220.3 592.3,254.9 650.9,264.2 660.3,245.5 "/> <text class="bilding_label zoom_layer_0" id="b_y71_txt" x="620.417647059" y="247.25" fill="#ddd">71</text> </g><!-- modules/c/functions/bild_create.php --> <!-- yello end ++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> </g><!-- /#bildings --> </g><!--/.map_scene--> <script type="text/javascript" xlink:href="js//lib/vendor/jquery/jquery-2.1.3.min.js"/> <script type="text/javascript" xlink:href="js//lib/utils/DOM_navigation.js"/> <script type="text/javascript" xlink:href="js//lib/utils/class_search.js"/> <script type="text/javascript" xlink:href="js//lib/modules/iq_map_label_control.js"/> <script type="text/javascript" xlink:href="js//app.js"/> </svg> //-=-=-=-=-=svg end (svg код я сократил по максимуму, оставив лишь главное и естественно сократив это.) Появляется множество окон "поиск на этой странице(см. файл в приложении). Путем последовательного отключения блоков кода, было выявленно что именно этот код вызывает такое поведение. Уточню, что документ полность SVG и манипуляции я произвожу с элементами <Text> в google chrome такой проблемы я не наблюдал. (svg code I cut to the maximum, leaving only the main course and cut it.) I get a lot of windows' search on this page (see. File attached). By disconnecting the serial code was revealing that this code calls this behavior. Clarify that the document is fully SVG and manipulation I make with elements <Text> in google chrome a problem I have not seen. С уважением Евгений Лабузов. Eugene Labuzov.
Attached screenshots

Chosen solution

выяснилась причина. class_search(curent_node_a.childNodes[y], class_name) в функции которой я не привел тут была строчка использующая функцию find для поиска класса. функция корректно работает в chrome. как и ожидалось, тоесть если класс не найден возвращает -1, а если находит отдает позицию в массиве.

while(true){ find(); }

Read this answer in context 👍 0

All Replies (3)

more options
more options

guigs2 said

Where to go for developer support

Так баг это или нет?

more options

Chosen Solution

выяснилась причина. class_search(curent_node_a.childNodes[y], class_name) в функции которой я не привел тут была строчка использующая функцию find для поиска класса. функция корректно работает в chrome. как и ожидалось, тоесть если класс не найден возвращает -1, а если находит отдает позицию в массиве.

while(true){ find(); }