WebPagetest Forums
async javascript - and sprite for pgn fancybox div - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: async javascript - and sprite for pgn fancybox div (/showthread.php?tid=10238)



async javascript - and sprite for pgn fancybox div - Jesse Gersenson - 12-20-2011 03:02 AM

http://www.webpagetest.org/result/111219_MQ_cabe882c2213d7591490774083369db3/1/details/

Any ideas how I can improve this result? Powerreviews.com, the company we use for our reviews, requests several javascripts and makes a number of other requests. Not sure how to address either. Also, liveperson is making an https request - but I can't tell if there's not an easier way to just link to my liveperson popup box.

The page includes both a color-selection dropdown box and a jquery/fancybox pop up div which includes several png files, one for each color swatch. This totals about 20 requests. Not sure if there's a practical way to combine them into a sprite while keeping the layout I'm using.

Thanks in advance for any help.


RE: async javascript - and sprite for pgn fancybox div - pmeenan - 12-20-2011 03:17 AM

Given that the color selector is just using solid color squares, you should be able to do it all without images (though I'm not sure if there is a simple plugin that will do it for you). You should also be able to use a sprite but it seems like a waste when a div with changing background colors would achieve the same result quite easily.

It looks like the liveperson script is async (though inline and relying on browser support) so newer browsers should load it fine without blocking. I'd recommend taking it a step further and using a more bullet-proof async injection since it doesn't have any dependencies (Stoyan has a good write-up here: http://calendar.perfplanet.com/2011/the-art-and-craft-of-the-async-snippet/ )


RE: async javascript - and sprite for pgn fancybox div - Jesse Gersenson - 12-20-2011 04:17 AM

found a simple a href version of the liveperson code.

looks like this - note 12345678 gets replaced with your unique ID

Code:
<!-- BEGIN LivePerson Button Code -->
<a href='http://server.iad.liveperson.net/hc/12345678/?cmd=file&file
=visitorWantsToChat&site=12345678&
byhref=1' target='chat12345678'
onClick="window.open('http://server.iad.liveperson.net/hc/12345678/
?cmd=file&file
=visitorWantsToChat &site=12345678&referrer='+
document.location','chat12345678','width=472,height=320');
return false;">Live chat</a>
<!-END LivePerson Button code -->