Giter Club home page Giter Club logo

learn-feng's People

Contributors

642495539 avatar gutenye avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

learn-feng's Issues

class选择器

 #class1 div{

    background-color:red;
}

 div#class1{

    background-color:red;
}

//教材上说是第一种语法正确,但是在chrome中第二种可以,第一种不行,why

Transfer ownership

Transfer this repository to my account, for better management :) , here are steps:

Settings -> Transfer -> type learn-feng and gutenye -> I understand, transfer this repository.

s

<!DOCTYPE html>
<html >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title></title>
<link rel="stylesheet" href="style.css">
</head>


<body >

<div id=main>


</div>


</body>

<script>

var name=sessionStorage.name;
alert(name);
alert(!undefined);
alert(!name);



</script>

</html>

学Javascript, 没有遇到问题吗?

原来JavaScript这么简单呀.

document.querySelector("button").addEventListener("click", e => {
  console.log("You just clicked a button")
})

这个看的懂的吧.

js调试

编写好html+js文件后我用chrome试验效果,有没有好的调试工具?

thorny

//html

<div id=id3>
<div id=id4></div>
<div id=id5></div>
</div>


//style.css
#id3{
width:800px;
height:200px;
    position:relative;
    background-color:#699;

}
#id4{
    width:50px;
    height:50px;
    background-color:red;
position:absolute;
left:0px;
top:0px;
}
#id5{
    width:50px;
    height:50px;
    background-color:green;
    position:absolute;
    left:0px;
    top:150px;

}

//js
alert(document.getElementById("id4").style.left);           //null
document.getElementById("id4").style.left="0px";
alert(document.getElementById("id4").style.left);          //0px

//
在外部css文件中已经定义了left的值了,为什么输出null?(从网页输出布局来看position  left  top等值都已经起到作用了)


js

...javascript
var a={
name:"fcy",
fun:function()
{
alert(this.name);
}
}
...

this问题

<!DOCTYPE html>
<html>
<head>
<title>fcy</title>
<link rel="stylesheet" href="style.css">
</head>



<script>
/*
function fun1(node){
document.getElementById("placeholder").setAttribute("src",node.getAttribute("href"));
document.getElementById("caption").childNodes[0].nodeValue=node.getAttribute("title")
}


*/


function fun1(){
alert(this.id);
}

function fun2(){}
function fun3(){}

</script>



<body >

<div id=id1 style="width:50px;height:50px;border:1px solid red;"onclick="fun1()"></div>
<div id=id2 style="width:50px;height:50px;border:1px solid blue;" onclick="fun2()"></div>
<div id=id3 onclick="fun3()">
</div>

<!--
<div style="height:100px;background-color:transparent">
<ul style="list-style-type:none">

<li>
<a href="./pic/1.jpg" onclick="fun1(this); return false;" title=11> one</a>
</li>
<li>
<a href="./pic/2.jpg" onclick="fun1(this); return false;" title=22>  two</a>
</li>
<li>
<a href="./pic/3.jpg" onclick="fun1(this); return false;" title=33>  three</a>
</li>
<li>
<a href="./pic/4.jpg" onclick="fun1(this); return false;" title=44>  four</a>
</li>


</div>
<div style="width:800px;height:800px;">
<img id="placeholder" alt="beauty" style="height:800px;width:800px;"></img>
<p id=caption>pic</p>
</div>

-->


</body>



</html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.