Inspired by the process of immunoglobulin secretion in biological body, we present a Web Page Malicious Script Detection Method (WPMSD). In this paper, Firstly, the basic definitions of artificial immune items are given. Secondly, according to the spreading range of malicious script, the immunoglobulin number is changed as the detector clone proliferation is stimulated by malicious scripts. Further more, the nonlinear dynamics of antibody number is discussed. Thirdly, we propose a probability approach to trigger alarms to inform that the detected scripts are harmful. Finally, the WPMSD collects the effective immunoglobulin set based on Hidden Markov Model (HMM) to update the detector gene library. Compared with the traditional immune based detection methods, such as Negative Selection Algorithm (NSA), Dynamic Colonel Selection (DynamiCS), and Variable size Detector (Vdetector), the false alarm rate of WPMSD has been reduced by 18.09%, 12.6%, and 7.47% respectively.