কম্পিউটার টিউটোরিয়াল

জাভাস্ক্রিপ্টে ফাংশন এক্সিকিউশন বন্ধ করার পদ্ধতি কী?

জাভাস্ক্রিপ্টে ফাংশন এক্সিকিউশন বন্ধ করতে clearTimeout() মেথড ব্যবহার করা হয়। এই ফাংশন কল setTimeout() ফাংশনগুলো দ্বারা সেট করা যেকোনো টাইমার ক্লিয়ার করে দেয়।

উদাহরণ

<html>    <head>       <title>জাভাস্ক্রিপ্ট clearTimeout() মেথড</title>       <script>          <!--             var imgObj = null;             var animate ;                         function init(){                imgObj = document.getElementById('myImage');                imgObj.style.position= 'relative';                imgObj.style.left = '0px';             }             function moveRight(){                imgObj.style.left = parseInt(imgObj.style.left) + 10 + 'px';                animate = setTimeout(moveRight,20);    // call moveRight in 20msec             }             function stop(){                clearTimeout(animate);                imgObj.style.left = '0px';             }             window.onload = init;          //-->       </script>    </head>    <body>       <form>          <img id = "myImage" src = "/images/html.gif" />          <p>Click the buttons below to handle animation</p>          <input type = "button" value = "Start" onclick = "moveRight();" />          <input type = "button" value = "Stop" onclick = "stop();" />       </form>    </body> </html>
  1. জাভাস্ক্রিপ্ট ব্যবহার করে ক্যানভাসে ড্র করার পদ্ধতি

  2. জাভাস্ক্রিপ্ট দিয়ে টেক্সট ক্লিপবোর্ডে কপি কীভাবে করবেন?

  3. জাভাস্ক্রিপ্টে ফাংশন এক্সিকিউশন 중간에 বন্ধ করার পদ্ধতি

  4. জাভাস্ক্রিপ্টে রিডিউস এবং রেঞ্জ ব্যবহার করে ফ্যাক্টোরিয়াল ফাংশন লেখা