You may encounter a situation where you are supposed to inject a javascript on visualforce page conditionally. Let suppose a case where you detect device of landing page and inject javascript conditionally after finding device I am sharing a piece of snippet which actually allow you to inject Javascript dynamically. This can also be achieve using jQuery as well
This is fairly simple, the one method I designed here check if the device is mobile (isMobile()) which in return be used later on as condition to inject the script. If device is mobile then I inject the script
This is fairly simple, the one method I designed here check if the device is mobile (isMobile()) which in return be used later on as condition to inject the script. If device is mobile then I inject the script
0 comments:
Post a Comment