I send the input value to another file, get the answer back and slip it into the div
chrome does not show errors, the alert shows that the variable has the value #window but nothing comes to the div ((
Surely some kind of stupid inaccuracy, I can not understand!
I have several requests, I wanted to make a function, at the same time to practice, but this construction does not work for me. well, the construction itself works ...
I don’t want to give me this JS, tell me how to make it work? I understand with the help of return; I need to translate this business into a global one, but I can’t redeem it in any way, I need to get the result back in the div ...
- I study, I did not want to ask stupid questions, but I had to -
$(document).ready(function() { var i_dir = 'window'; var id_dir = '#' + i_dir; //alert(id_dir); function my_dir(i_dir) { $.post( 'sys/' + i_dir + '.php', function(msg) { $(id_dir).html(msg); } ); }; }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="window"></div>
my_dirfunction? - mix