Uncaught ReferenceError: myFunction is not defined code example

Example 1: Uncaught ReferenceError: bookmarkBar is not defined

Delete the parentId parameter since it does not exist while creating a new folder. The id is generated after folder creation.

Use console.log("Folder id is" +newFolder.id); to get the id. You will be able to view the created folder in Bookmark Manager ->Other Bookmarks.

Example 2: Uncaught ReferenceError: $ is not defined

<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="path-para-seu-script"></script>

Example 3: register:48 Uncaught ReferenceError: $ is not defined

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

Example 4: Uncaught ReferenceError: commonL10n is not defined

add_action( 'admin_footer', function () {
	?>
	<script>
		if ( typeof commonL10n === 'undefined' ) {
			var commonL10n = { dismiss : 'Dismiss' };
		}
	</script>
	<?php
}, 100 );

Tags:

Misc Example