window.open ("http://www.baidu.com", "_blank", "width=300, height=200");
Enter Baidu.
<script type= "Text/javascript" >
var content = "abc";
Console.log (Content.replace ("B", "Q"));
</script>
Convert B to Q.
<script type= "Text/javascript" >
var arr = ["Orange", "Mango", "banana", "sugar", "tea"];
Console.log (arr);
Arr.splice (2, 0, "fish");
2 is the second 0 is the deletion of 0
document.write (arr);
document.write ("<br/>");
Results (Orange,mango,fish,banana,sugar,tea)
Arr.splice (5, 1);
5 is the fifth 1 is to delete a
document.write (arr);
Results (Orange,mango,fish,banana,sugar)
</script>
<script type= "Text/javascript" >
var username = "a123456789";
Set to enter only a small number of digits
if (Username.length > 7) {
Alert ("Please enter the correct user name ...");
}
</script>
<script type= "Text/javascript" >
var title = "Attendance at Hangzhou Summit Series of 20 leaders ' events";
document.write (title.substr (0, 10) + "...");
See 1 to 10 words for the rest of the "..." expression.
</script>
<script type= "Text/javascript" >
var result = confirm ("Do you confirm the deletion?") ");
Console.log (result);
if (result) {
Alert ("Deleting ...");
}else{
Alert ("You canceled the delete");
}
</script>
<script type= "Text/javascript" >
var username = "a123456";
Console.log (Username.charat (0));
for (var i = 0; i < username.length; i++) {
document.write (' <span class= ' font ' + i + ' "> ' + username.charat (i) +" </span> ");
}
</script>
JavaScript 71st session