Last active
August 29, 2015 14:05
-
-
Save wpscholar/4748003ff7224d560277 to your computer and use it in GitHub Desktop.
Escape JS example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var name = '<?php echo esc_js( $_POST['name'] ); ?>'; | |
</script> | |
<a href="<?php echo esc_url( home_url( '/blog/' ) ); ?>" | |
onclick="<?php echo esc_js( 'alert("Welcome " + name);' ); ?>"> | |
<?php _e( 'Blog', 'textdomain' ) ?> | |
</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment