Handling JavaScript Rendering Across Different Devices and Screen Sizes