I make a website on NetCat where a Yandex map is needed, but not simple - when clicking on a map, a balun should pop up with a form where information should be entered, among which there should be a line for entering the time in the hh: mm: ss format.

I made the map and the opening balun, since there are examples on the Yandex website, I also put the form in there, but when I decided to connect the jQuery Timepicker Addon 0.5 plug-in, there was a problem - this plug-in does not want to work inside the map script. Although if you just use it on the component page, then everything works. I appeal to you for help.

Here is the code of my card with the form and attempt to connect the plugin:

// Как Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π±ΡƒΠ΄Π΅Ρ‚ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½ API ΠΈ Π³ΠΎΡ‚ΠΎΠ² DOM, выполняСм ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΡŽ ymaps.ready(init); function init () { var myMap = new ymaps.Map('map', { center: [55.790833, 49.114444], // ΠšΡ€Π°ΡΠ½ΠΎΠ΅-Π½Π°-Π’ΠΎΠ»Π³Π΅ zoom: 11 }, { balloonMaxWidth: 250 }); // ΠžΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° события, Π²ΠΎΠ·Π½ΠΈΠΊΠ°ΡŽΡ‰Π΅Π³ΠΎ ΠΏΡ€ΠΈ Ρ‰Π΅Π»Ρ‡ΠΊΠ΅ // Π»Π΅Π²ΠΎΠΉ ΠΊΠ½ΠΎΠΏΠΊΠΎΠΉ ΠΌΡ‹ΡˆΠΈ Π² любой Ρ‚ΠΎΡ‡ΠΊΠ΅ ΠΊΠ°Ρ€Ρ‚Ρ‹. // ΠŸΡ€ΠΈ Π²ΠΎΠ·Π½ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΠΈ Ρ‚Π°ΠΊΠΎΠ³ΠΎ события ΠΎΡ‚ΠΊΡ€ΠΎΠ΅ΠΌ Π±Π°Π»ΡƒΠ½. myMap.events.add('click', function (e) { if (!myMap.balloon.isOpen()) { var coords = e.get('coordPosition'); myMap.balloon.open(coords, { contentHeader: 'Новая ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ Π·ΠΎΠ½Π°', contentBody: '<form id=formadd action=/template/control_zones/outpoint.php method=post target=_self>'+ 'Устройство ΠΊ ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠΌΡƒ Π±ΡƒΠ΄Π΅Ρ‚ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½Π° ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ Π·ΠΎΠ½Π° :'+ ' "; $res_devicesList = mysql_query(" SELECT * FROM `siteonfly_tracker`.`Message113` WHERE `User_ID` = '$current_user[User_ID]' "); $result .='<select name="deviceID" size="1" >'; while($list = mysql_fetch_assoc($res_devicesList)) { $result .= '<option value="'.$list[DeviceID].'">'.$list['Name'].' '.$list[DeviceID].'</option>';//Device_ID } $result .= '</select>'; $res_phone = mysql_query(" SELECT `Phone` FROM `siteonfly_tracker`.`User` WHERE `User_ID` = '$current_user[User_ID]' "); $phone_sel = mysql_fetch_assoc($res_phone); $phone = $phone_sel['Phone']; $result.=" '+ 'НазваниС :<input type=text name=namepoint><br>'+ 'Радиус :<input type=text name=radiuspoint><br>'+ ' "; $result .='<input type="text" name="testTime" style="width: 70px;" id="timepickerTestInMap" value="" />'; //$result .='<script type="text/javascript">'; $result .=' $(document).ready(function() {'; $result .=' $("#timepickerTestInMap").timepicker();'; $result .=' });'; //$result .=' </script>'; $result .=" '+ ' "; $result .= 'ВрСмя Π½Π°Ρ‡Π°Π»Π° контроля (Ρ‡Ρ‡:ΠΌΠΌ:сс) :<input type="text" name="begintime" style="width: 70px;" id="timepickerBegin" value="">'; $result.=" '+ ' "; $result .= '<br>ВрСмя окончания контроля (Ρ‡Ρ‡:ΠΌΠΌ:сс) :<input type="text" name="endtime" style="width: 70px;" id="timepickerEnd" value="">'; $result.=" '+ '<input type=submit name=submit_cz >'+ '<input name=pcoord type=hidden value='+coords[0].toPrecision(6)+';'+coords[1].toPrecision(6)+' />'+ '<input name=phone type=hidden value=$phone />'+ '</form>', contentFooter: '<p>ΠšΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Ρ‹ ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½ΠΎΠΉ Π·ΠΎΠ½Ρ‹: ' + [ coords[0].toPrecision(6), coords[1].toPrecision(6) ].join(', ') + '</p>' }); } else { myMap.balloon.close(); } }); // ΠžΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° события, Π²ΠΎΠ·Π½ΠΈΠΊΠ°ΡŽΡ‰Π΅Π³ΠΎ ΠΏΡ€ΠΈ Ρ‰Π΅Π»Ρ‡ΠΊΠ΅ // ΠΏΡ€Π°Π²ΠΎΠΉ ΠΊΠ½ΠΎΠΏΠΊΠΈ ΠΌΡ‹ΡˆΠΈ Π² любой Ρ‚ΠΎΡ‡ΠΊΠ΅ ΠΊΠ°Ρ€Ρ‚Ρ‹. // ΠŸΡ€ΠΈ Π²ΠΎΠ·Π½ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΠΈ Ρ‚Π°ΠΊΠΎΠ³ΠΎ события ΠΏΠΎΠΊΠ°ΠΆΠ΅ΠΌ Π²ΡΠΏΠ»Ρ‹Π²Π°ΡŽΡ‰ΡƒΡŽ подсказку. myMap.events.add('contextmenu', function (e) { myMap.hint.show(e.get('coordPosition'), 'ΠšΡ‚ΠΎ-Ρ‚ΠΎ Ρ‰Π΅Π»ΠΊΠ½ΡƒΠ» ΠΏΡ€Π°Π²ΠΎΠΉ ΠΊΠ½ΠΎΠΏΠΊΠΎΠΉ'); }); //ΡƒΠΏΡ€Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΊΠ°Ρ€Ρ‚ΠΎΠΉ myMap.behaviors.enable('scrollZoom') // Π”ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ стандартного Π½Π°Π±ΠΎΡ€Π° ΠΊΠ½ΠΎΠΏΠΎΠΊ myMap.controls.add('mapTools') // Π”ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΊΠ½ΠΎΠΏΠΊΠΈ измСнСния ΠΌΠ°ΡΡˆΡ‚Π°Π±Π° .add('zoomControl') // Π”ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ списка Ρ‚ΠΈΠΏΠΎΠ² ΠΊΠ°Ρ€Ρ‚Ρ‹ .add('typeSelector'); } 

as you can see, I first tried to shove the script into the script, but then when meeting the internal </script> external script of the map was closed, so I commented out this place, but now the code for calling the plugin function crawls out of the page.

PS for those who do not know - in NetCat php code is inserted using this construct "; *[php ΠΊΠΎΠ΄]* $result.=" , Where everything

 `echo '';` 

need to be replaced by

>$result.='';

    1 answer 1

      $result .='<script>'; $result .=' $(document).ready(function() {'; $result .=' $("#timepickerTestInMap").timepicker();'; $result .=' });'; $result .=' </script>'; 

    try it without javascript type

    • one
      ugorau =))) - Palmervan
    • @Palmervan you look at his previous answers. There, in one of them, a person did not ask to minus this comrade for his inexperience back in April of that year. It's also fun how to watch video reviews from Misha Taburetkin: D - lampa
    • @lampa yes I am amused only today) - Palmervan
    • did not help ( - bazanski
    • @lampa and I also asked him about the DOM (first) not to be minus :) - Rules