{"id":27156,"date":"2021-05-12T23:10:06","date_gmt":"2021-05-13T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/javascript-miscellaneous-code-programming-code-examples-java-j2ee-j2me-ajax\/"},"modified":"2021-05-12T23:10:06","modified_gmt":"2021-05-13T03:10:06","slug":"javascript-miscellaneous-code-programming-code-examples-java-j2ee-j2me-ajax","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=27156","title":{"rendered":"Javascript : Miscellaneous Code #Programming Code Examples #Java\/J2EE\/J2ME #Ajax"},"content":{"rendered":"<pre style='font-size:12px;padding:10px'>\n                var browser=navigator.appName;\n                var b_version=navigator.appVersion;\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\n\n\n&lt;a href=&quot;http:\/\/www.justetc.net&quot; target=&quot;_blank&quot;&gt;\n&lt;img border=&quot;0&quot; alt=&quot;hello&quot; src=&quot;b_pink.gif&quot; id=&quot;b1&quot; width=&quot;26&quot; height=&quot;26&quot; onmouseover=&quot;mouseOver()&quot; onmouseout=&quot;mouseOut()&quot; \/&gt;\n\n<br \/>\nPlace the following code under script tag\/in a javascript file\n\nfunction mouseOver()\n{\n   document.getElementById(&quot;b1&quot;).src =&quot;b_blue.gif&quot;;\n}\n\nfunction mouseOut()\n{\n   document.getElementById(&quot;b1&quot;).src =&quot;b_pink.gif&quot;;\n}\n\n\n\n\n\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\n\n&lt;map name=&quot;planetmap&quot;&gt;\n\n&lt;area shape =&quot;rect&quot; coords =&quot;0,0,82,126&quot;\nonMouseOver=&quot;writeText('You are over the target area')&quot;\nhref =&quot;target.htm&quot; target =&quot;_blank&quot; alt=&quot;target&quot; \/&gt;\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\nvar t1=setTimeout(&quot;document.getElementById('id1').value='2 seconds!'&quot;,2000);\nvar t2=setTimeout(&quot;document.getElementById('id1').value='4 seconds!'&quot;,4000);\nvar t3=setTimeout(&quot;document.getElementById('id1').value='6 seconds!'&quot;,6000);\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\nDirect Instance: \n\npObj=new Object();\npObj.firstname=&quot;John&quot;;\npObj.lastname=&quot;Doe&quot;;\npObj.age=50;\npObj.eyecolor=&quot;blue&quot;;\n\ndocument.write(pObj.firstname + &quot; is &quot; + pObj.age + &quot; years \n\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\nfunction car(brand,make,model)\n{\nthis.brand=brand;\nthis.make=make;\nthis.model=model;\n}\nvar myCar=new car(&quot;Honda&quot;,&quot;2009&quot;,&quot;Accord&quot;);\ndocument.write(myCar.brand +  myCar.make + myCar.model );\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\ntry\n{\n}\ncatch(err)\n{\n}\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\n\nUnder script tag\/javascript file:\n\nonerror=handleErr;\nvar alertTxt = &quot;&quot; \n\nfunction handleErr(msg, url, l)\n{\n   alertTxt = &quot;Error Information:.nn&quot;;\n   alertTxt += msg + &quot;n&quot;;\n   alertTxt += url + &quot;n&quot;;\n   alertTxt += l + &quot;nn&quot;;\n   alertTxt += &quot;Click OK to continue.nn&quot;;\n   alert(alertTxt);\n   return true;\n}\n\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\n\nvar x;\nvar myFriends= new Array();\nmyFriends[0] = &quot;Shafiq&quot;;\nmyFriends[1] = &quot;Rafiq&quot;;\nmyFriends[2] = &quot;Abba&quot;;\nmyFriends[3] = &quot;Amma&quot;;\n\nfor (x in myFriends)\n{\n   document.write(myFriends[x] + &quot;<br \/>&quot;);\n}\n\n\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\nvar d = new Date();\ntheDay=d.getDay();\nswitch (theDay)\n{\ncase 5:\n  document.write(&quot;<b>Friday<\/b>&quot;);\n  break;\ncase 6:\n  document.write(&quot;<b>Saturday<\/b>&quot;);\n  break;\ncase 0:\n  document.write(&quot;<b>Sunday<\/b>&quot;);\n  break;\n}\n<\/pre>\n<pre style='font-size:12px;padding:10px'>\n   var pattern = new RegExp(&quot;e&quot;,&quot;g&quot;);\n   do\n   {\n     result=pattern .exec(&quot;This is the line where the regular expression will be searched on&quot;);\n     document.write(result);\n   }\n   while (result!=null) \n<\/pre>\n<p>Note: Brought from our old site: http:\/\/www.salearningschool.com\/example_codes\/ on Jan 2nd, 2017 From: http:\/\/sitestree.com\/?p=10181<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, Ajax<br \/>Tags:Java\/J2EE\/J2MEAjax<br \/> Post Data:2017-01-02 16:04:23<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>var browser=navigator.appName; var b_version=navigator.appVersion; &lt;a href=&quot;http:\/\/www.justetc.net&quot; target=&quot;_blank&quot;&gt; &lt;img border=&quot;0&quot; alt=&quot;hello&quot; src=&quot;b_pink.gif&quot; id=&quot;b1&quot; width=&quot;26&quot; height=&quot;26&quot; onmouseover=&quot;mouseOver()&quot; onmouseout=&quot;mouseOut()&quot; \/&gt; Place the following code under script tag\/in a javascript file function mouseOver() { document.getElementById(&quot;b1&quot;).src =&quot;b_blue.gif&quot;; } function mouseOut() { document.getElementById(&quot;b1&quot;).src =&quot;b_pink.gif&quot;; } &lt;map name=&quot;planetmap&quot;&gt; &lt;area shape =&quot;rect&quot; coords =&quot;0,0,82,126&quot; onMouseOver=&quot;writeText(&#8216;You are over the target area&#8217;)&quot; href =&quot;target.htm&quot; target &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=27156\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-27156","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10564,"url":"http:\/\/bangla.sitestree.com\/?p=10564","url_meta":{"origin":27156,"position":0},"title":"JavaScript Code","author":"","date":"August 29, 2015","format":false,"excerpt":"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var browser=navigator.appName; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var b_version=navigator.appVersion; <a href=\"http:\/\/www.justetc.net\" target=\"_blank\"> <img border=\"0\" alt=\"hello\" src=\"b_pink.gif\" id=\"b1\" width=\"26\" height=\"26\" onmouseover=\"mouseOver()\" onmouseout=\"mouseOut()\" \/> Place the following code under script tag\/in a javascript file function mouseOver() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_blue.gif\"; } function mouseOut() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_pink.gif\"; } <map name=\"planetmap\"> <area shape =\"rect\" coords =\"0,0,82,126\"\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10548,"url":"http:\/\/bangla.sitestree.com\/?p=10548","url_meta":{"origin":27156,"position":1},"title":"Javascript : Miscellaneous Code","author":"","date":"August 29, 2015","format":false,"excerpt":"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var browser=navigator.appName; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var b_version=navigator.appVersion; <a href=\"http:\/\/www.justetc.net\" target=\"_blank\"> <img border=\"0\" alt=\"hello\" src=\"b_pink.gif\" id=\"b1\" width=\"26\" height=\"26\" onmouseover=\"mouseOver()\" onmouseout=\"mouseOut()\" \/> Place the following code under script tag\/in a javascript file function mouseOver() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_blue.gif\"; } function mouseOut() { \u00a0\u00a0 document.getElementById(\"b1\").src =\"b_pink.gif\"; } <map name=\"planetmap\"> <area shape =\"rect\" coords =\"0,0,82,126\"\u2026","rel":"","context":"In &quot;Ajax&quot;","block_context":{"text":"Ajax","link":"http:\/\/bangla.sitestree.com\/?cat=1418"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26499,"url":"http:\/\/bangla.sitestree.com\/?p=26499","url_meta":{"origin":27156,"position":2},"title":"JavaScript Code #Programming Code Examples #Javascript #JavaScript","author":"Author-Check- Article-or-Video","date":"April 26, 2021","format":false,"excerpt":"var browser=navigator.appName; var b_version=navigator.appVersion; <a href=\"http:\/\/www.justetc.net\" target=\"_blank\"> <img border=\"0\" alt=\"hello\" src=\"b_pink.gif\" id=\"b1\" width=\"26\" height=\"26\" onmouseover=\"mouseOver()\" onmouseout=\"mouseOut()\" \/> Place the following code under script tag\/in a javascript file function mouseOver() { document.getElementById(\"b1\").src =\"b_blue.gif\"; } function mouseOut() { document.getElementById(\"b1\").src =\"b_pink.gif\"; } <map name=\"planetmap\"> <area shape =\"rect\" coords =\"0,0,82,126\" onMouseOver=\"writeText('You are over the\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70149,"url":"http:\/\/bangla.sitestree.com\/?p=70149","url_meta":{"origin":27156,"position":3},"title":"JavaScript Miscellaneous Topics #13","author":"Author-Check- Article-or-Video","date":"August 27, 2021","format":false,"excerpt":"JavaScript Miscellaneous Topics. Please check below. Detect browser name and version: var browser=navigator.appName; var b_version=navigator.appVersion; Other browser related: navigator.appCodeName, navigator.platform, navigator.platform , navigator.cookieEnabled , navigator.userAgent, navigator.appMinorVersion, navigator.cpuClass, navigator.onLine, navigator.browserLanguage, navigator.systemLanguage, navigator.userLanguage It's a good idea to use escape function for setting cookie values (if more than one word). Also, use\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"hello","src":"b_pink.gif","width":350,"height":200},"classes":[]},{"id":10857,"url":"http:\/\/bangla.sitestree.com\/?p=10857","url_meta":{"origin":27156,"position":4},"title":"\u09b8\u09bf\u098f\u09b8\u098f\u09b8 \u0987\u09ae\u09c7\u099c \u0997\u09cd\u09af\u09be\u09b2\u09be\u09b0\u09c0 (CSS Image Gallery)","author":"Rafiqul Islam","date":"September 7, 2015","format":false,"excerpt":"\u09b8\u09bf \u098f\u09b8 \u098f\u09b8 \u098f \u09a4\u09c8\u09b0\u09bf \u0987\u09ae\u09c7\u099c \u0997\u09cd\u09af\u09be\u09b2\u09be\u09b0\u09c0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u0989\u09a6\u09be\u09b9\u09b0\u09a3\u0983 <head> <style> div.img { \u00a0\u00a0\u00a0 margin: 5px; \u00a0\u00a0\u00a0 padding: 5px; \u00a0\u00a0\u00a0 border: 1px solid #0000ff; \u00a0\u00a0\u00a0 height: auto; \u00a0\u00a0\u00a0 width: auto; \u00a0\u00a0\u00a0 float: left; \u00a0\u00a0\u00a0 text-align: center; } div.img img { \u00a0\u00a0\u00a0 display: inline; \u00a0\u00a0\u00a0\u2026","rel":"","context":"In &quot;\u09b8\u09bf \u098f\u09b8 \u098f\u09b8 \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 (css tutorial)&quot;","block_context":{"text":"\u09b8\u09bf \u098f\u09b8 \u098f\u09b8 \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 (css tutorial)","link":"http:\/\/bangla.sitestree.com\/?cat=174"},"img":{"alt_text":"Klematis","src":"https:\/\/i0.wp.com\/www.w3schools.com\/css\/klematis_small.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":70099,"url":"http:\/\/bangla.sitestree.com\/?p=70099","url_meta":{"origin":27156,"position":5},"title":"Code Example: Utilizing Web Services in PHP #16","author":"Author-Check- Article-or-Video","date":"August 25, 2021","format":false,"excerpt":"PHP code to grab the best provincial mortgage rate:function find_mortgaze_rate($url){ \/\/ create a new cURL resource $ch = curl_init(); \/\/ set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, \"username:password\"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \/\/ grab URL and pass it to the browser $result = curl_exec($ch);\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27156"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27156\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27156"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}