Avada Forums Community Forum Can't fire script – body onload() automatically parses out in html code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • twofus
    Participant
    Post count: 2

    I need to fire a script – I put <body onload=”loaded()”> at the top of my page but Avada strips it out. How do I fire the script? Using didn’t work. Nor did either of the two scripts below. Any ideas?

    <script type=”text/javascript”>
    window.onload = loaded() {
    init();
    }</script>

    <script type=”text/javascript”>
    window.onload = loaded;
    </script>

    Michael C
    Keymaster
    Post count: 549

    Where are you attempting to add your JS? For scripts, you can add them to Theme Options > Advanced – Code Fields. There is no reason to edit the HTML, the body onLoad is a standard event. You can also use jQuery for that since it is already loaded.

    For example – http://learn.jquery.com/using-jquery-core/document-ready/
    Documentation – https://api.jquery.com/load-event/ and https://api.jquery.com/ready/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.