The Ag/g-C3N4 nanocomposites were prepared using urea as the precursor.
The Ag/g-C3N4 nanocomposites were applied in removal of NOx in air.
The Ag nanoparticles enhanced the photocatalytic activity of g-C3N4.
The surface plasmon resonance of Ag played a key role in photocatalysis.