How can I run a script right at the end of a particular page loading. I'm aware of the "document.getElementById" but when I run it inside <script> tags nothing happens. Is there somewhere else I need to be putting this or is there another way to get this to run?
Comments
So if you want some Javascript to only be run when the Reader views a particular passage you would do something like the following.
note: The passage this code is looking for is titled "Inventory" and my postrender function is named logging. You need to change both of these to whatever you need them to be.
There's a bunch more things I want to do in there, but I thought I'd start simple with just changing what something says.
The console will show the following:
What I'm trying to do is load the page elements (the name div and the progress bars I mentioned) with the updated/correct values for each current fighter. Is there any advice you can offer to help me get this working? I'm a bit stumped at the moment...
eg. Because if they are siblings then their contents should exist but if they are part of the passage contents then you will need to use setTimeout to delay the running of your update javascript until the passage has been rendered.
For example:
This is why I was asking @Eaturbrainz about his DOM structure.
There are three basic possibilities for what's going on here:
Hey this worked for me. Thanks for your help guys. I'll report back here again if I run into any other issues.