I am attempting to keep all my code on one page (I know, not usual) as a challenge. I am attempting to keep everything within the <style>
tags.
I was able to $('body').prepend('<p>Text</p>')
, however I am attempting to add a navigation bar the same way with jQuery and I get errors.
EDIT: Here is the block of code with the navbar in place of the Text from above. Error I get is "Unexpected Token, ILLIGAL" for the 3rd line.
$(document).ready(function(){
$('body').css({'background-color':'#C0DEED'});
$('body').prepend('<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
</ul>
</div>
</nav>
</div>')
$('body').append('<div class="footer row span12"><p>Footer</p></div>');
});
*I am using the Navbar documentation from materialize which is correctly referenced to in file. *Also, the appends fine, which is why I am wondering what I'm running into? Do I need ; or , after all the lines?