reference errors with Masonry javascript grid layout lib. Any ideas why?

Hello experts,

Please reference code below:

<title>Test: blocks with dynamic heights</title>
<meta charset="ISO-8859-1" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- -->
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
var container = $('#galleryContainer');
columnWidth: 200,
itemSelector: '.item'
.imgContainer{ float:left; padding: 5px; }
.footer{ clear:both; }
<!-- PAGE 1 begins -->
	<div data-role="page" id="gallery" data-theme="a">			
		<!-- CONTENT -->
		<div data-role="main">
			<div id='galleryContainer'>
				<div class='imgContainer'>
				<div><a href='#'><img src="#" style="background-color:blue;width:300px;height:300px"></a></div>
				<div class='imgContainer'>
				<div><a href='#'><img src="#" style="background-color:yellow;width:300px;height:600px"></a></div>
				<div class='imgContainer'>
				<div><a href='#'><img src="#" style="background-color:red;width:300px;height:600px"></a></div>
		<!-- FOOTER -->
		<div data-role="footer" class="footer">
			<div >footer</div>
<!-- PAGE 1 ENDS -->	

Open in new window

I do see the container defined above, I am not sure why I am getting this error:
ReferenceError: $ is not defined
var container = $('#galleryContainer');

Also, I am seeing the error below:
TypeError: a is undefined
...s,document,function(a,b,c){!function(a){{}}(a),function(a,b){function d.

any ideas why I am getting these errors?

Thank you for your help...

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rainer JeschorCommented:
two issues:
1. You miss the script reference to jQuery. jQuery mobile needs additionally jQuery reference, therefore the error as the shortcut for jQuery "$" is not defined.
2. "$container.masonry"  should be just "container.masonry" (that error will come as soon as you add the jQuery reference)

Live sample:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
epifanio67Author Commented:
Thank you Rainer....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.