Window load after ajax — how to implement?

Hello, I've seen the answer How to raise an event window.load() after inserting the script AJAX'ohms? on this issue, but unfortunately, I'm not very helpful.

I've got a page on her button, pressing the button loads another page
$("#desk").load("templates/presentations.php");

On this page is the svg that I need to repaint and so I'm using function $(window).load(function() { });
but it doesn't work =(

I enter in the code:
$(document).ready(function(){
$(window).trigger('load');
 });

But it's not working

I would be grateful for help)
September 26th 19 at 06:34
2 answers
September 26th 19 at 06:36
$.ajax( "example.php" )
 .done(function() {
 alert( "success" );
})
 .fail(function() {
 alert( "error" );
})
 .always(function() {
 alert( "complete" );
 });


You can use the callback function of ajax
I just need this to run php and you need to loaded it on presentations.php - isac commented on September 26th 19 at 06:39
September 26th 19 at 06:38
Suppose you have a content located on the link - content/test.html
This content you contain
<svg/>
the <script>
$(document).ready(function(){
A function for colorization
var _color = <?php $color ?> - where $color - so let's say the color of the base
});
</script>

actually Ajax, when you pull out this page, it will be repainted. What is a joint?)
to load the object does not fit, I wrote about svg - isac commented on September 26th 19 at 06:41
You have arrives to a CSA, right?
It you then want to repaint some function, too, right?
and what exactly is not suitable in my case? - isac commented on September 26th 19 at 06:44
I probably incorrectly expressed - the JavaScript should arrive within Ajax. - Brain.MacGyver commented on September 26th 19 at 06:47
Yes, I need to repaint SVG....they do not have time to upload, but I have them repaint the colors of the base, which I take via PHP! that is, I press the button, the Ajax page is loaded, there are CSAs that need to be repainted, but the window.load with which earlier all worked, not at all srabatyvaet - Brain.MacGyver commented on September 26th 19 at 06:50
had to put a timer, but it's a crutch, = (( as much as possible properly to solve the problem? - isac commented on September 26th 19 at 06:53
is there colbecki to download the SVG? - isac commented on September 26th 19 at 06:56
taks... suppose you have a content located on the link - content/test.html
This content you contain

actually Ajax, when you pull out this page, it will be repainted. What is a joint?) - isac commented on September 26th 19 at 06:59
damn, again fled.... now write the answer. - Brain.MacGyver commented on September 26th 19 at 07:02

Find more questions by tags AJAXHTMLJavaScriptjQuery