Let $J$ be $\mathrm{diag}(a_1,...,a_n)$. Let $M_{i_1,...,i_k}$ be the principal submatrix of $M$ with rows and colums number $\{i_1,...,i_k\}$ deleted. Then $\det(J+M)=\det(M+\mathrm{diag}(0,a_2,...,a_n))+a_1\det(J_1+M_1)$ (expand along the first row). Thus $$\det(J+M)=\sum a_{i_1}\cdot\ldots\cdot a_{i_k} \det(M_{i_1,...,i_k}).$$ The sum is taken over all subsets of $\{1,...,n\}$. So if $M$ is fixed, your determinant is some polynomial in $a_1,...,a_n$ whose coefficients are principal minors of $M$. This is of course not difficult, but to continue, I would need to know what information about the determinant you want to get.

**Update.** By the way the same proof of course gives that coefficients of the characteristic polynomial of $M$ are (up to sign) sums of principal minors of $M$. This is a very useful fact, used, for instance, in one of the proofs of the classification of finite dimensional semi-simple Lie algebras (existence of Cartan subalgebras).