After the First Sino-Japanese War, he went to Shanghai, becoming a member of the Society for National Strengthening (強學會) and writing for a number of newspapers, including Liang Qichao's "Shi Wu Bao" (時務報). In September 1898, after the failure of the Wuxu Reform, Zhang escaped to Taiwan with the help of a Japanese friend and worked as a reporter for and wrote for "Qing Yi Bao" (清議報) produced in Japan by Liang Qichao.