পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, February 9, 2017

AJAX - Browser Support

All the available browsers cannot support AJAX. Here is a list of major browsers, that support AJAX.
  • Mozilla Firefox 1.0 and above.
  • Netscape version 7.1 and above.
  • Apple Safari 1.2 and above.
  • Microsoft Internet Explorer 5 and above.
  • Konqueror.
  • Opera 7.6 and above.
When you write your next application, do consider the browsers that do not support AJAX.
NOTE: When we say that a browser does not support AJAX, it simply means that the browser does not support creation of Javascript object XMLHttpRequest object.

Writing Browser Specific Code

The Simplest way to make your source code compatible with a browser is to use try...catch blocks in your JavaScript.
<html>
<body>
   <script language="javascript" type="text/javascript">
   <!-- 
   //Browser Support Code
   function ajaxFunction(){
      var ajaxRequest;  // The variable that makes Ajax possible!

      try{
         // Opera 8.0+, Firefox, Safari 
         ajaxRequest = new XMLHttpRequest();
      }catch (e){

         // Internet Explorer Browsers
         try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
         }catch (e) {
            try{
               ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }catch (e){

               // Something went wrong
               alert("Your browser broke!");
               return false;
            }
         }
      }
   }
   //-->
   </script>
   
   <form name='myForm'>
      Name: <input type='text' name='username' /> <br />
      Time: <input type='text' name='time' />
   </form>
   
</body>
</html>
In the above JavaScript code, we try three times to make our XMLHttpRequest object. Our first attempt:
  • ajaxRequest = new XMLHttpRequest();
It is for Opera 8.0+, Firefox, and Safari browsers. If it fails, we try two more times to make the correct object for an Internet Explorer browser with:
  • ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  • ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
If it doesn't work, then we can use a very outdated browser that doesn't support XMLHttpRequest, which also means it doesn't support Ajax.
Most likely though, our variable ajaxRequest will now be set to whatever XMLHttpRequest standard the browser uses and we can start sending data to the server. The step-wise AJAX workflow is explained in the next chapter.

No comments:

Post a Comment