nfreear / nfreear-blog

My (re-developed) personal blog. A work-in-progress! —
https://nick.freear.org.uk
MIT License
0 stars 1 forks source link

Javascript: `#!_FRAME_ME`, move JS config to `data-*` attributes etc. #5

Closed nfreear closed 9 years ago

nfreear commented 9 years ago

Markdown:

  [Example](http://example.org/embed/page#!_FRAME_ME_)

Javascript:

  jQuery("a[ href *= _FRAME_ME_ ]").each(function () {

    var $link = $(this)
      , url = $link.attr("href").replace(/\#\!.+/, "");

    $link.replaceWith('<iframe src="' + url + '"></iframe>');
  });