I have a slide component assembled on my render() method in my web part, it is displayed fine but the Javascript action "ShowSlide()" necessary to activate the slide is not being fired inside the $().ready()
I've placed the call inside the
public render(): void {
this.domElement.innerHTML = `
<!-- build the slide here -->
<div>
<ul>
.....
..... shortened for brevity
.....
</ul>
</div>
<!-- CALL THE SLIDE using $().ready() - it doesn't work -->
<script type="text/javascript">
$(document).ready( function()
ShowSlide();
});
</script>
`;
}
I've ran out of ideas, I don't know what is preventing the function to be fired, I've added a little button to call this function manually and it works when it is called from pressing the button but not on the expected $().ready()
public render(): void {
this.domElement.innerHTML = `
<!-- manual call for ShowSlide() -- it works when clicked! -->
<input type="button" value="Start Slide" onClick="ShowSlide()" />
<!-- build the slide here -->
<div>
<ul>
.....
..... shortened for brevity
.....
</ul>
</div>
<!-- CALL THE SLIDE using $().ready() - it doesn't work -->
<script type="text/javascript">
$(document).ready( function()
ShowSlide();
});
</script>
`;
}