Top 5 Scripts you need to Know before Dealing with Visualforce Pages.
1.) Is it Lightning experience OR classic view ?
Have you ever faced a problem of identifying in which experience user is opening your page (VFP)? Is it lightning or classic.
Well, here is the solution to it. There are two ways :
# Using Apex:
# Using JS on Visualforce Page:
You can use two parameters to check this 'sfdcIFrameOrigin' and 'istdp'. Now you can easily identify in which experience the user is via your code.
_________________________________________________________________________________
2.) OutputPanel Refresh using jquery
You can try to use a dummy apex:actionFunction to reRender any component on the page.
_________________________________________________________________________________
3.) Reload Page after an action using using Javascript.
_________________________________________________________________________________
4.) Remove Enter Functionality from InputFields in a Visualforce Page.
_________________________________________________________________________________
5.) URL Navigation in Salesforce Classic vs Lightning from single Button.
Suppose you have a Home Button which redirects you to the HomePage of your Salesforce Org.Now the URL which you will specify will be different for Classic & for Lightning.You need to write something like this :
_________________________________________________________________________________
“The city is flying, we're fighting an army of robots, and I've got a bow. Nothing is making sense! Except a Good Script".