Snap.com: How to refresh snapshots for links with AJAX

Those of you who use snap.com for showing thumbnails of links on their website might have the same prob I had:

When loading parts of the website (using AJAX) which include a link the snap-function doesn’t recognize these links and doesn’t offer a snapshot since the website has already been loaded.

Originally, you only had to integrate the following function at the end of your JS-function and the links of the AJAX-parts have been recognized also:


SNAP_COM.shot_main_js();

BUT snap.com changed their code and now it won’t work any longer.

If you now want to refresh the page to even recognize the AJAX-driven links simply add the following line (bold) to your existing code:


SNAP_COM.shot_main_js_called = false;

SNAP_COM.shot_main_js();

This should solve the issue and all links added via AJAX on your website should now be recognized by snap.com also. ;)

Hope I could somehow and best wishes,
Eric

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.