The learning methods and skills of JS

Source: Internet
Author: User

There are times when you are proficient in a language, but it turns out that you're dealing with other languages all day, and maybe you think it's trivial and won't affect your development, but it's the things that you don't value that will waste you a lot of time, and I always thought I was proficient in JavaScript a few years ago, until now , I grew to think that JavaScript was far more complex and powerful than I had imagined, and I began to adore it,
Take advantage of the holidays and put together the methods and techniques for JavaScript so that everyone who is bothered by JavaScript understands that JavaScript is the way it is. And hope that JavaScript can also become your friend, let you suddenly enlightened, in the project better application ~

Fit to read: Know nothing about JavaScript ~ one step away from mastery
Basics: HTML


That's what JavaScript is about. 1: basic knowledge

1 Creating script blocks < scripts language = "JavaScript" >
JavaScript Code goes here
</script >

2 Hide Script code

1: < SCRIPT language = "JavaScript" >
2: <!--
3:document.write ("Hello");
4://-->
5: </script >


Do not execute related code in browsers that do not support JavaScript

3 Browser does not support the display 1: < noscript >
2:hello to the Non-javascript browser.
3: </noscript >

4 link External script file 1: < script language = "JavaScript" src = "/" Filename.js "" ></script >


5 Note Script 1://This is a comment
2:document.write ("Hello"); This is a comment
3:/*
4:all of this
5:is a Comment
6: */

6 Output to Browser 1:document.write ("< strong > Hello </strong >");

7 define variable 1:var myvariable = "some value";

8 string addition 1:var myString = "String1" + "String2";

9 String Search 1: < script language = "JavaScript" >
2: <!--
3:var myvariable = "Hello There";
4:var thereplace = Myvariable.search ("there");
5:document.write (Thereplace);
6://-->
7: </script >

10 String Replacement 1:thisvar.replace ("Monday", "Friday");


11 formatted string 1: < SCRIPT language = "JavaScript" >
2: <!--
3:var myvariable = "Hello There";
4:document.write (Myvariable.big () + "< br/>");
5:document.write (Myvariable.blink () + "< br/>");
6:document.write (Myvariable.bold () + "< br/>");
7:document.write (myvariable.fixed () + "< br/>");
8:document.write (Myvariable.fontcolor ("red") + "< br/>");
9:document.write (Myvariable.fontsize ("18pt") + "< br/>");
10:document.write (Myvariable.italics () + "< br/>");
11:document.write (Myvariable.small () + "< br/>");
12:document.write (Myvariable.strike () + "< br/>");
13:document.write (Myvariable.sub () + "< br/>");
14:document.write (Myvariable.sup () + "< br/>");
15:document.write (Myvariable.tolowercase () + "< br/>");
16:document.write (Myvariable.touppercase () + "< br/>");
17:
18:var firststring = "My String";
19:var finalstring = Firststring.bold (). toLowerCase (). FontColor ("Red");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.