<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Untitled Document</title></Head><Body> <imgsrc=".. /image/desktop/1.jpg "width= "$"Height= "+"name= "AAA"/> <imgsrc=".. /image/desktop/2.jpg "width= "$"Height= "+"name= "BBB"/> <imgsrc=".. /image/desktop/3.jpg "width= "$"Height= "+"name= "CCC"/> <inputtype= ' button 'value= "Chagne"onclick= "Changeimage ()"/> <Script> functionChangeimage () {varImg_name=Prompt ("Please enter your image name:",""); varImg_str= "window.document."+Img_name; varImg_obj=eval (IMG_STR); if(img_obj) img_obj.src= ".. /image/desktop/"+parseint (Math.random ()* -+1)+". jpg"; } </Script></Body></HTML>
var json = ' {' response ': ' Success ', ' Level ': ' OK '} '; // result = eval (JSON);//eval will treat {} as a block of statements, not an object result = eval (' (' +json+ ') '); alert (result);
result = (new Function ("", "Return" +json)) ();
alert (result);
eval function Application