function square(num){ var total = num*num;//局部变量 return total;}var total = 50;//全局变量var number = square(20);alert(total);//结果为50 function square(num){ total = num*num;//全局变量 return total;}var total = 50;//全局变量var number = square(20);alert
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <ti
一.设置属性的值: {{data中的数据}} window.onload = function () { var c = new Vue({ el : '#box', data : { url : 'https://img6.bdstatic.com/img/image/smallpic/weijupaishefensetu.jpg' } }); } <div id="box"> <img src="{{url}}" alt=""