CSS JavaScript php的书写规则

1. 标签<>内的多个属性之间,只要空一隔,不需要 逗号

   <a href="brand_me.html" target="browser_page">

2. CSS :选择器内的属性的多个值,也不要用符号隔开,只要空一隔
   background: #ccc url(pattern.fif) repeat-x;

3. JavaScript语句的写法,下面是一些例子:
    ◇ window.open("some_url","window_name", "location=no,status=no");
    ◇ var width= prompt("How wide do you want the grid?(1-10 is good)","10");
    ◇ <a href="#" onMouseOver="temp=image1;image1=image2;image2=image3;image3=temp;
window.document.the_image.src=image1;"

onclick="parent.control_frame.document.brandme_img.src=image1;"><img src="..."></a>
   ◇ <a href="#" onclick="var change=prompt('Change which image (0 or 1)?','');
window.document.images[change].src='image_change_files/three.jpg';">Change</a>


4. 对图片链接,表达是否一样:
   CSS:          background: #ccc url(pattern.fif) repeat-x;
   HTML、JS:
  <img src="image/monkey.gif" name="brandme_img">

 

5. 对字符串进行合并:
   JS:    alert("The index is:"+ window.document.the_select.select_one.selectedIndex);
   php:  echo $names[0]." and ".$names[1]." are ".$names[2]."'s neighbors."."<br>";

6. 对变量的定义和引用:
   JS:    对大小写敏感,所以定义数组必需 写成 new Arrary而不是new arrary
            var yourName="toGrace";                                         //定义
            document.writeln(yourName);                                  //引用
   php: 对大小写不敏感
            $yourName="toGrace";                                            //定义
            echo "Your name is: " . $yourName . "<br />";          //引用

7. 关于数组:
    JS:   var colors = new Arrary("red","blue","green");
    PHP:
$names=array("Mike","Marry","Tom");

posted @ 2008-10-04 00:43  尚远  阅读(192)  评论(0编辑  收藏  举报