T
T
TechNOIR2018-02-27 13:10:50
JavaScript
TechNOIR, 2018-02-27 13:10:50

js+ajax. How to stop script execution?

Good afternoon.
Please tell me some solution to the problem.. The

following scheme is implemented:
1.HTML form + Ajax script.
2. The value is entered in the form and on the click of the button Ajax requests the PHP file
3. The list of values ​​in the PHP file is in the format "Value => Path to the script"
4. Accordingly:
Enter the value => Ajax requests this value from PHP => the script corresponding to the value is executed php => output the result back to HTML using AJAX.

In the first script (1.php), in addition to php commands, I wrote a test js script:

<script type="text/javascript">
alert(1111);
</script>


And on request for the value, I get a 1111 dialog box and the result of executing php.
This is fine.

BUT. This js script seems to be written into memory, and with further requests for other values ​​(without reloading the page), it continues to climb into both 2.php and 3.php, etc.

How to solve the problem? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Sokolov, 2018-02-27
@jimquery

Disable JavaScript in your browser and it won't pop up

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question