Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var typingTimer;
- var doneTypingInterval = 1000; //czas w milisekundach
- //po naciśnięciu przycisku odliczaj
- $('#krs').keyup(function(){
- clearTimeout(typingTimer);
- if ($('#krs').val) {
- typingTimer = setTimeout(function(){
- var v = $("#krs").val();
- $("#frame").attr("src", "http://mrrandom.cba.pl/response.php?krs="+v);
- $('#frame').on("load", function() {
- var z = document.getElementById("frame").contentWindow.location.href;
- var decodedUri = decodeURIComponent(z);
- var res = decodedUri.replace("http://mrrandom.cba.pl/", "");
- substring = "pusto.php";
- if (res.indexOf(substring) !== -1){
- alert("Błędny numer KRS");
- var re = "";
- $('#nazwa').val(re);
- $('#krs').val(re);
- }
- else {
- $('#nazwa').val(res);
- }
- });
- }, doneTypingInterval);
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement