$("<%= escape_javascript(render(:partial=>'each_note',:locals=>{:note=>@note})) %>").prependTo("#all-notes").hide().fadeIn(1000);
$("#tags").html("<%= escape_javascript(render(:partial=>'tags',:locals=>{:tags=>@tags})) %>");
var all_notes = document.querySelector('#all-notes');
var first_note = all_notes.children[0];
loadContentColors([first_note]);

//insert error messages accordingly
<% if !flash[:notice].blank? %>
    $("#flash").html("<div class='notice'><%= escape_javascript(flash[:notice]) %></div>");
    <%= flash[:notice] = nil %>
<% elsif !flash[:alert].blank? %>
    $("#flash").html("<div class='error'><%= escape_javascript(flash[:alert]) %></div>");
    <%= flash[:alert]=nil %>
<% elsif !flash[:warning].blank? %>
    $("#flash").html("<div class='warning'><%= escape_javascript(flash[:warning]) %></div>");
    <%= flash[:warning] = nil %>
<% end %>
$("<%= escape_javascript(render(:partial=>'each_note',:locals=>{:note=>@note})) %>").prependTo("#all-notes").hide().fadeIn(1000);
$("#tags").html("<%= escape_javascript(render(:partial=>'tags',:locals=>{:tags=>@tags})) %>");
var all_notes = document.querySelector('#all-notes');
var first_note = all_notes.children[0];
loadContentColors([first_note]);

//empty the textbox after creation
var textBox = document.getElementById('new-note');

textBox.value='';
//insert error messages accordingly
<% if !flash[:notice].blank? %>
    $("#flash").html("<div class='notice'><%= escape_javascript(flash[:notice]) %></div>");
    <%= flash[:notice] = nil %>
<% elsif !flash[:alert].blank? %>
    $("#flash").html("<div class='error'><%= escape_javascript(flash[:alert]) %></div>");
    <%= flash[:alert]=nil %>
<% elsif !flash[:warning].blank? %>
    $("#flash").html("<div class='warning'><%= escape_javascript(flash[:warning]) %></div>");
    <%= flash[:warning] = nil %>
<% end %>
Fix Empty the textbox after note creation
Fix Empty the textbox after note creation
