You recently started programming ? What does the script do ? Though I don't know how client side script would make a difference I'd like to point out a few "avoid-doing-that" in your script.
var balance_btc = 0.4345, balance_usd = 0;
var min_diff = 1;
var last_bid_price = parseFloat($('#max_price').html());
var last_ask_price = null;
var is_selling = false;
Globals! Avoid them!
Do you use ECMA Script 6 ? Don't assign fixed values to "var",use constant instead.Also "use strict".
sell(last_bid_price,balance_btc);
Use Jquery to call your global or wrap them with the ending "();" braces to make them IIEF (Immediately Involked Self Executing Functions)