ওভারভিউ
HTML DOM Location reload() মেথড বর্তমান ডকুমেন্টকে পুনরায় রেন্ডার করতে ব্যবহৃত হয়। এটি ব্রাউজারের রিলোড বাটনের মতো কাজ করে।
সিনট্যাক্স
location.reload(forceGetParameter)
প্যারামিটারস
| forceGetParameter | বিবরণ |
|---|---|
| true | বর্তমান ডকুমেন্ট সার্ভার থেকে রিলোড হবে। |
| false | বর্তমান ডকুমেন্ট ব্রাউজার ক্যাশ থেকে রিলোড হবে। |
উদাহরণ
Location reload() মেথডের উদাহরণ:
<!DOCTYPE html> <html> <head> <title>Location reload()</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } </style> </head> <body> <form> <fieldset> <legend>Location-reload( )</legend> <label for="urlSelect">Email: </label> <input type="email" id="emailSelect"><br> <label for="urlSelect">Password: </label> <input type="password" id="passSelect"><br> <input type="button" onclick="doReload()" value="Reload"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var emailSelect = document.getElementById("emailSelect"); var passSelect = document.getElementById("passSelect"); divDisplay.textContent = 'Do not reload, all the details will be lost'; function doReload(){ alert('Page reloaded, all the details are lost'); location.reload(); } </script> </body> </html>
আউটপুট
'Reload' বাটনে ক্লিক করার আগে:

ডিটেইলস পূরণ করে 'Reload' বাটনে ক্লিক করার পর:
