Going through the lightning visualforce report i ran accross some JS i needed to replace. Here's my problem, my googlfoo is failing me when it comes to replacing window.onload. Here's one code snippet. What would i do in an instance such as this one.", "answerCount": 1, "upvoteCount": 0, "datePublished": "2018-10-16T22:02:33.000Z", "author": { "@type": "Person", "name": "A R", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000E1TF5QAN", "affiliation": { "@type": "Organization", "name": "--" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "You have to either this options ..  1 . Init handler with doInit  as shown below          2.Or ltng:required  ", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T42GWSAZ", "datePublished": "2018-10-17T03:21:17.000Z", "author": { "@type": "Person", "name": "Rajamohan Vakati", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000Cx9R2QAJ", "affiliation": { "@type": "Organization", "name": "Amazon" } } } ] } }
Skip to main content

<script>

window.onload=function()

{

document.getElementById('{!$Component.theForm.themes.addThemes.gtTable.tcRows}').focus();

};

</script>

</apex:outputPanel-->

Going through the lightning visualforce report i ran accross some JS i needed to replace. Here's my problem, my googlfoo is failing me when it comes to replacing window.onload. Here's one code snippet.

What would i do in an instance such as this one.
1 answer
  1. Oct 17, 2018, 3:21 AM
    You have to either this options .. 

    1 . Init handler with doInit  as shown below

    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

             2.Or ltng:required

    <ltng:require scripts="{!$Resource.resourceName}" afterScriptsLoaded="{!c.afterScriptsLoaded}" />

     
0/9000