A
A
Artdomhouse2020-05-03 02:59:19
JavaScript
Artdomhouse, 2020-05-03 02:59:19

How to configure the transfer of information in value from page A to page B?

Hello!
There is a working code, but not quite suitable:

On the page where to transfer information (B) we insert:

<script type="text/javascript">  $.get('/index/8-7', function (data) {   $('#por1').html( $('#zanr', data).html() ) });  </script>
<span id="por1"></span>


On the page from where we take the information (A) we insert:
<div style="display:none;"><div id="zanr">Жанры, стили: Классика</div></div>


I needed the same thing, only I need to insert the info from the "id = zanr" block not into but into "value" I'll ask for help!

<span id="por1"></span>


<input type="text" value="" id="por1">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2020-05-03
Matytsyn @ArsenyMatytsyn

If at least something is told to you by GET \ POST \ API, then use them, do not fool yourself. If you do not know, then I recommend filling this gap. Since this problem will be closed behind him.
For the rest, I also recommend mastering the basic principles of interacting with the DOM, because:

...
$('#por1').value = $('#zanr', data).html();
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question