Hello! Please tell me if I solve the problem correctly:
There are a couple of fields on the page and the Yandex button. The button is an iframe (this is the case with Yandex). In the src this iframe bunch of parameters. But one of these parameters must be set on the fly , in the process of the user filling in the fields on the page. I initially registered something noticeable in it, and then I changed it for what was needed. The result was such a bulky construction:
$('#frame').attr( 'src', document.getElementById('frame').src.replace('JS-REPLACE-ID', data) ); I do not like that part of the command is written in jQuery , and part - in simple JS . But in another way it does not work. What am I doing wrong?