How to get this JavaScript working with get_permalink

Probably the best way to do this is as suggested above by using wp_localize_script.

You haven’t mentioned how you’re including the javascript – but I’m going to assume you’re doing it the WordPress way. So, something like this:

add_action( 'wp_enqueue_scripts', 'wwm_enqueue_scripts' );

function wwm_enqueue_scripts()
{

 //see the documentation if you don't understand what's going on here. 
 wp_enqueue_script( 'some-handle', '/path/to/my-custom-js.js', $deps, $version, $in_footer' );
 //now, to define a javascript variable for the script to use
 wp_localize_script( 'some-handle', 'someUniqueName', array( 'myPermalink' => get_permalink(), ) );
}

now, the permalink will be accessible to your javascript via someUniqueName.myPermalink so…

$(function() {
$(".widget-one").middleBoxButton("Read More", someUniqueName.myPermalink);

});

the key bit of this is documented at: http://codex.wordpress.org/Function_Reference/wp_localize_script

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)