to get the url of a document item using javascript ( by passing id of the document item to javascript function)
<pre><code>    function retrieveListItemsInclude(param) {
      //  debugger;
      //var id = param;
        var clientContext = new SP.ClientContext.get_current();
        var oList = clientContext.get_web().get_lists().getByTitle('GEN2ESW_Content_To_Do_Queue');

        var camlQuery = new SP.CamlQuery();
        camlQuery.set_viewXml('&lt;View&gt;&lt;RowLimit&gt;100&lt;/RowLimit&gt;&lt;/View&gt;');
        this.collListItem = oList.getItems(camlQuery);

        clientContext.load(collListItem, 'Include(Id, DisplayName, HasUniqueRoleAssignments)');

        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    }

    function onQuerySucceeded(sender, args) {

        var listItemInfo = '';
        var listItemEnumerator = collListItem.getEnumerator();

        while (listItemEnumerator.moveNext()) {
            //if (oListItem.get_id() == param) 
            {
            //SPListItem item = list.GetItemById(1); //Suppose you want to retrieve the 1st item from the custom list.
            // string URL = item[“URL”].ToString(); //Trying to retrive the value of URL which is of type Hyperlink or Picture
                var oListItem = listItemEnumerator.get_current();
                listItemInfo += '\nID: ' + oListItem.get_id() +oListItem.get_path()+
        '\nDisplay name: ' + oListItem.get_displayName() +
        '\nUnique role assignments: ' + oListItem.get_hasUniqueRoleAssignments();// + oListItem['URL'].ToString();  //+ '\n URL = ' + oListItem.get_url(); 
            }
        }

        alert(listItemInfo.toString());
    }

    function onQueryFailed(sender, args) {

        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    }
</code></pre>
