I've been trying to make an option show and hide(possibly toggle) in my browser action popup without success. The code below is the body of my popup
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="popup.js"></script>
<div class="show">
<a href="#" class="showcontent">Show</a>
<a href="#" class="hidecontent">Hide</a>
<div class="somecontent">
<p>some content<br />
<a href="#">Link</a><br />
</p>
</div>
</div>
The popup.js file contains, among other things:
$(document).ready(function(){
$(".somecontent").hide();
$(".showcontent").click(function(){
$(".somecontent").show();
});
$(".hidecontent").click(function(){
$(".somecontent").hide();
});
});
I believe the problem is that the Chrome API is having problems with my popup.js file. The body appears in my popup but the Show and Hide actions do not work. Any ideas how to make this work and if not, another way to get the same result (ie: toggle on click)?
EDIT: From the javascript Console, the error I'm getting this error:
Uncaught TypeError: Cannot call method 'ready' of null
Which points to the line of the above code using the ready function.