Skip to content

Instantly share code, notes, and snippets.

@3rd-Eden
Created March 25, 2010 16:01
Show Gist options
  • Save 3rd-Eden/343710 to your computer and use it in GitHub Desktop.
Save 3rd-Eden/343710 to your computer and use it in GitHub Desktop.
Export Spry regions out of <script type="text/spry"></script>
(function( doc, rxp ){
var scripts = doc.getElementsByTagName("script"), i = scripts.length, tmp;
while( i-- ){
if( scripts[i].type == "text/spry" && scripts[i].id.match( rxp ) ){
tmp = doc.getElementById( scripts[i].id.replace( rxp, "" ) )
tmp.innerHTML = scripts[i].innerHTML;
Spry.Data.initRegions( tmp );
}
}
}( document, /replace_/))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment