Skip to content

Commit

Permalink
remove dots in scrip name reference
Browse files Browse the repository at this point in the history
  • Loading branch information
bassjobsen committed Jul 2, 2014
1 parent 02d4ca9 commit 7f8b116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wp-defer-loading.php
Expand Up @@ -120,7 +120,7 @@ function print_extra_script( $handle, $echo = true ) {

echo "var element = document.createElement(\"script\");\n";
echo "element.appendChild( document.createTextNode( \"". addslashes(str_replace(array('\r\n','\n','\r'),"",$output)) ."\" ) );";
echo "document.body.appendChild(element);\n";
echo "\ndocument.body.appendChild(element);\n";

return true;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ function adddom ($handle,$src)
global $thescripts;
if(!empty($src))
{
$handlejs=str_replace('-','',$handle);
$handlejs=str_replace(array('-','.'),'',$handle);
echo "var element".$handlejs." = document.createElement(\"script\");\n";

if(!empty($thescripts[$handle]))
Expand Down

0 comments on commit 7f8b116

Please sign in to comment.