Both solutions has it's assets and drawbacks. Using outputbuffering can be a bit tricky if other plugins use outputbuffering too. JavaScript can be disabled in the visitors browser. Outputbuffering manipulate the DOM before it is send to the browser, JS after it was send to the browser.

Update

Why does the plugin code does not work in my functions.php?

To answer this question, we have to take a closer look at the hooks and have to understand when and what happened while WordPress is loading. At first the working code for the functions.php

Where are the differences to the plugin code? At first it is no longer a plugin and so we can not use plugins_url() to get the uri to the JavaScript. After a search in the Codex, we find the function [get_template_directory_uri()][1] to get the correct path to the JavaScript file.

After simply changing from plugins_url() to get_template_directory_uri() the code does not work. Now we have to start thinking. The code is no longer a plugin code, it is now a 'theme' or 'template' code. Can we use the hook plugins_loaded for a theme code?

It seems that this is not a good idea. To understand why this is not a good idea, we have a look inside the core files (in this case take wp-settings.php). As we read the core files, we find the line with do_action('plugins_loaded');. Until this point, no theme was setup and so get_template_directory_uri() does not know anything about a template directory.
Continue reading the core file, we will find the part where the theme is setup. And we also find a line with do_action('after_setup_theme');. This seems to be a good point to hook up our code. After replacing plugins_loaded with after_setup_theme and test the code, we see the code will work.

If you want to develop plugins and / or themes for WordPress, you need to understand when and what happened while WordPress is loaded! If you get stuck, take a brief minute and start reading the core files.

i create a function:remove_remember_me.php with the 1st part of code in .php and i call this for:require_once('includes/admin/remove_remember_me.php');, also i create a js with the 2nd part of code and i call this to function.php with <?php wp_enqueue_script('disable_me.js', get_template_directory_uri() . 'includes/js/disable_me.js',array('jquery'),'1.0',true);?>, but this is not work. What i am doing wrong?
–
MikeDDec 29 '12 at 14:52

First at all: Do you use PHP5.2 or PHP5.3? Namespaces are available since PHP5.3! Create a plugin, do not put everything in your functions.php (see discussion ). This function is not theme specific. So put it in a plugin. I create a gist which can be downloaded gist.github.com/4408787 This plugin works for me fine at PHP5.3 and PHP5.2 (both versions are included)
–
Ralf912Dec 29 '12 at 19:30

Thanks for help. I used PHP Version 5.4.7. I read the discussion and i will be back.
–
MikeDDec 29 '12 at 22:02

@Ralf912, i read in github the readme.txt, and and I realized that is plugin. But i don't use with plugin method, but only with custom method (php file and js). Αny help on my question? Thanks in advance.
–
MikeDDec 30 '12 at 13:46