Warning: Declaration of Bootstrap_Walker::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = NULL) in /home/itport/public_html/wp-content/themes/itport-v5.0/functions/bootstrap-walker.php on line 25

Warning: Declaration of Bootstrap_Walker::end_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = NULL) in /home/itport/public_html/wp-content/themes/itport-v5.0/functions/bootstrap-walker.php on line 42

Warning: Declaration of Bootstrap_Walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $data_object, $depth = 0, $args = NULL, $current_object_id = 0) in /home/itport/public_html/wp-content/themes/itport-v5.0/functions/bootstrap-walker.php on line 57

Warning: Declaration of Bootstrap_Walker::end_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::end_el(&$output, $data_object, $depth = 0, $args = NULL) in /home/itport/public_html/wp-content/themes/itport-v5.0/functions/bootstrap-walker.php on line 108
آی تی پورت | بکار بردن جاوا اسکریپت در وب
Warning: Use of undefined constant url - assumed 'url' (this will throw an Error in a future version of PHP) in /home/itport/public_html/wp-content/themes/itport-v5.0/header.php on line 56

Warning: Use of undefined constant title - assumed 'title' (this will throw an Error in a future version of PHP) in /home/itport/public_html/wp-content/themes/itport-v5.0/header.php on line 57
تجارت الکترونیکطراحی وب

بکار بردن جاوا اسکریپت در وب

طراحی وب

با سلام

آموزش جاوا اسکریپت هم شروع شد. امیدوارم این سری آموزش ها براتون مفید باشه.

برای شروع به آموزش درج کد جاوا اسکریپت در وب میپردازیم

برای درج کد جاوا اسکریپت در وب دو راه وجود داره

* در راه اول کد ها رو توی خود صفحه قرار میدیم که باید به این صورت نوشته بشه:

<script>

درج کدهای جاوا اسکریپت

</script>

* در راه دوم کد ها رو از یه فایل میخونیم به این صورت:

<script src="myScript.js"></script>

نمونه درج کد جاوا اسکریپت در وب:

<html>

<head>

<script>

function displayDate()

{

document.getElementById("demo").innerHTML=Date();

}

</script>

</head>

<body>



<h1>My First JavaScript</h1>

<p id="demo">This is a paragraph.</p>



<button type="button" onclick="displayDate()">Display Date</button>



</body>

</html>

نمونه بارگذاری فایل جاوا اسکریپت:

<html>

<body>

<script src="myScript.js"></script>

</body>

</html>

منتظر نظرات و سوالاتتون هستیم.

گفتگو ها
    reza

    سلام، خیلی خوبه. من که حتما تا بتونم سعی می کنم آموزشهای جاوا اسکریپتتون و Jqueryتون رو دنبال کنم.