All links should consist of the full URL because:
a) It's related to security;
b) there is basically no easy way to recognize relative links correctly;
c) it's better for search engines to provide full links.
It's not quite related to the JavaScript code, it's internal miniBB parsing routine from bb_codes.php.
If you move forums to another domain, you just need to replace all older domain links in posts by the simple SQL command like this:
update minibbtable_posts set post_text=REPLACE(post_text,'http://www.olddomain.com','http://www.newdomain.com') where POSITION('http://www.olddomain.com' IN post_text)>0;
That way we have also replaced all internal links on our own forums when we have moved miniBB project from minibb.net to minibb.com.