How can server, browser or we can recognise what kind of script at an HTML document? We use some block scripting to open and end it up.
For PHP we use
?>
we can also use this:
For Javascript we use
For CSS we use
</style>
This blog is dedicated for computer technology. I'd like to share with you about computer and programming too. Share with me about your experience in Web Design and Programming, Visual Basic (VB), Database etc
How can server, browser or we can recognise what kind of script at an HTML document? We use some block scripting to open and end it up.
For PHP we use
posting by Michael at 10:47 AM 0 comment
Labels: CSS, Javascript, PHP
Here is some basic rule for some C or C# style language like PHP, Java, Javascript, etc.
PHP also have a variable to store temporary data. Just like Javascript variable, PHP variable can store anykind of data in 1 variable. For example, you can store 234 (number) in a variable and then change it to "Hello" (string) later.
PHP have some rule if you want to declare a variable:
Comment is very important for programmer. Every languages have a comment. This is a comment of some language:
As any other language, javascript is also has variables. Javascript is case sensitive, so the variable name is case sensitive too. So y variable is different with Y. Javascript variable name must begin with letter or underscore.
This is how you declare javascript variable:
Local Variable:
Has to be declare inside a function. Example:
<script type="text/javascript">
function print_hello()
{
var somewordempty;
document.write("empty " + somewordempty + "<br/>");
somewordempty="assign value to empty";
document.write(somewordempty + "<br/>");
var somewordassign ="assigned variable";
document.write(somewordassign + "<br/>");
}
print_hello();
</script>
Global Variable:
Has to be declare outside functions. I hope this example can make you understand. Example:
<script type="text/javascript">
var globalvar=" <br/>should be global";
document.write(globalvar);
function print_hello()
{
var globalvar="<br/>should be local, because although it have the same name but it declares under a function";
document.write(globalvar);
}
print_hello();
document.write(globalvar + " because it outside the function");
</script>
Let's try to call it again and you will get the same value as above. Because global variable is destroy when we close this page.
<script type="text/javascript">
document.write(globalvar);
</script>
posting by Michael at 11:55 AM 0 comment
Labels: Javascript
XML stand for eXtention Markup Language. XML has make a big different on the web programming and application. By learning XML we can communicate with a lot of different application language, web or desktop programming language. If you want to learn ajax, XSL, DOM, XHTML, web service, RSS, etc, than you need to learn or know about XML. XML can help us to separate display and data. The different betweenjavascript:void(0) XML and HTML is HTML is for display and XML is for the data. XML store and transfer the data.
Now lets start learning. This is the example of XML document:
<?xml version = "1.0" encoding = "utf-8"?>
<computer>
<PC>
<mainboard>
<processor>
<manufacture>Intel</manufacture>
<type>Core 2 duo</type>
</processor>
<memory type="DDR3">
<manufacture>VGEN</manufacture>
<capacity>2G</capacity>
</memory>
</mainboard>
<sound_card type="onboard" />
<vga_card type="onboard" />
</PC>
<PC>
<mainboard>
<processor>
<manufacture>AMD</manufacture>
<type>Turion</type>
</processor>
<memory type="DDR3">
<manufacture>VGEN</manufacture>
<capacity>2G</capacity>
</memory>
</mainboard>
<sound_card type="PCI Express" />
<vga_card type="PCI Express" />
</PC>
</computer>
Well this data is just an example. But it show us how to make it.
This is the rule to make an XML document:
This is some basic HTML elements:
Heading:
<h1>This is heading 1</h1>
Website now is the part of our life. To make a website the first thing we have to know is HTML. HTML is so simple, it can be write and make only using a simple editor like notepad or wordpad. You can also make HTML document using an expert editor like macromedia dreamweaver or microsoft frontpage. HTML document have a file extensions .htm or .html.
HTML document is also very simple, it contain:
Javascript was designed by Brendan Eich at Netscape (with Navigator 2.0) and was used on all browser on 1996. Javascript is an implementation of the ECMAScript language standard and ECMA-262 is the official JavaScript standard. If PHP is a server side programming language, Javascript is a client side programming language. It has the same function like VBscript.
Javascript is different with java, although they have a lot of same function and syntax. What is the different between javascript, HTML and PHP? You know if you use HTML you cannot make a dynamic page. If you use PHP, you have to refresh the page if you want to update the page. If you use javascript than you can update the page without press the refresh button.
This is our first javascript program:
Hello World
posting by Michael at 8:58 AM 0 comment
Labels: Javascript