A nonsulfur probe based on a 1,8-naphthalimide and alkyne conjugate for the ratiometric fluorescent sensing for Hg(2+) and Au(3+) through the tuning of pH in different aqueous solutions is described. This work provides a novel reaction-based approach for selective recognition of these two ions with significant change of fluorescence color and constitutes the first ratiometric case for Au(3+).