 <span id="js_link_append"></span>
  <!--- include api key check js file -->
  <script>
        $(document).ready(function(){
           apikeycheck();
        });
        $("#login_check").click(function(){
           apikeycheck();  
        });
        function apikeycheck(){
             var apiurl="<?php echo $apiurl?>";
            var apikey="<?php echo $apikey;?>";
            $.ajax({
                type:"POST",
                url: apiurl+"index.php",
                data:{apikey:apikey},
                success:function(response){
                    if(jQuery.trim(response)=='err_api')
                    {
                        alert("Invalid API Key");
                        return false;
                    }
                    else
                    {
                        $("#js_link_append").append(response);
                    }
                }
            });
        }
  </script>