Irradiation inside some transparent materials such as fused silica can induce nanograting structures at the focal area. Here, we investigate experimentally how the nanograting formation can be influenced by tuning the ionization property of the transparent material, which is achieved by irradiation inside a porous glass immersed in water doped with NaCl at variable concentrations. Our results show that the doping of NaCl not only reduces the threshold fluence of optical breakdown, but also leads to nanograting structures with shorter periods. These effects may be attributed to the enhanced photoionization in water doped with NaCl.