ajax-01

前端之家收集整理的这篇文章主要介绍了ajax-01前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. <!DOCTYPEhtml>
  2. <html>
  3. <head>
  4. <title></title>
  5. <Metacharset="utf-8"/>
  6. <scripttype="text/javascript">
  7. functiontest(){
  8. vara=100;
  9. this.b=200;
  10. //私有方法
  11. functiongetMax(){
  12. alert(1);
  13. }
  14. //公有方法
  15. this.getMin=function(){
  16. alert(2);
  17. }
  18. }
  19. varobj=newtest;
  20.  
  21. obj.b;
  22. obj.getMin();//公有方法可以调出,值为2
  23. //obj.getMax();//私有方法调不出
  24. </script>
  25. </head>
  26. <body>
  27.  
  28. </body>
  29. </html>

猜你在找的Ajax相关文章