In the code, the data type of the return value must be clearly known to perform correct calculations, or the type of a variable is required. Here is an introduction to how to detect the data type of the return value. The code example is as follows:
<style type="text/css"> div { width:200px; height:100px; background-color:#660; } </style>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script> <script type="text/javascript"> $(document).ready(function(){ var width=$("div").css("width"); alert(jQuery.type(width)); }) </script>
<div></div>
As you can see from the above code, jQuery.type() can detect data types.
The above is the entire content of this article, I hope you all like it.