Use button
< Link ID = M REL = Stylesheet href = " Docedit.css " Type = " Text/CSS " >
< Input onclick = " Document. All. M. href = 'HTTP: // lucky.myrice.com/cssforv6/index.css' " Value = " Change " Type = Button >
Select
Code
< Select Onchange = "Document.stylesheets%0%.href%this.options%this.selectedindex%.value%'.css '" ID = Select1 Name = Select1 >
< Option Value = "Style/new" > Default Style </ Option >
< Option Value = "Style/red" > Pink Style </ Option >
< Option Value = "Style/blue" > Blue Harbor </ Option >
< Option Value = "Style/Black" > Gloomy and melancholy </ Option >
</ Select >
Code
Anyone who has used Java can only import the required Java classes to Java as needed.
In JavaScript, we can also implement similar functions to reduce the amount of JS files introduced and reduce network transmission.
The method is: Document. Write ('<ScriptSRC= "Apppath/JS/My. js">');
If there are many JS files, we can import them in a way similar to Java.
First write an import function
Function importj (fpath ){
Fpath = fpath. Replace (/\./g, ' \ / ');
Document. Write ( ' <SCRIPT src =" ' + Basepath + Fpath + ' . Js "> </SCRIPT> ' );
}
You can use the followingCode:
Importj ('Apppath. js. My'):