popup when click link little like stackoverflow inbox in css

If i understand your post, you can try something like this: $(function(){ var prv=$([]); $(“.top-bar>.m-link”).click(function(){ var dst=$(this).children(); if(dst.html(“<div style=”width: 50px; height: 10px”>Loading…</div>”).toggle().click(function(ev){ev.stopPropagation();}).is(“:visible”)){ dst.load(“https://api.github.com”); } if(prv[0]!=dst[0]) prv.hide(); prv=dst; }); }); body{ position: relative; margin: 0; padding: 0; width: 100%; background-color: #f7f7f7; box-sizing: border-box; } .top-bar{ position: fixed; top:0; width:100%; height: 22px; background-color: #444; box-sizing: border-box; } … Read more

AJAX – form submit, same page, PHP

You need to prevent the JS from submitting the form, and you’re using the wrong form ID. Also, judging by the comments, you need to include jquery. In the head of your HTML file, between <head> and </head> or just before the closing </body> tag, you can use the following: <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”></script> The following code … Read more

I need to restrict age for below 18 years age from the current date in Php

Try this.. <script> function getAge() { var dateString = document.getElementById(“date”).value; if(dateString !=””) { var today = new Date(); var birthDate = new Date(dateString); var age = today.getFullYear() – birthDate.getFullYear(); var m = today.getMonth() – birthDate.getMonth(); var da = today.getDate() – birthDate.getDate(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age–; … Read more

How to return the response from an asynchronous call

→ For a more general explanation of asynchronous behaviour with different examples, see Why is my variable unaltered after I modify it inside of a function? – Asynchronous code reference → If you already understand the problem, skip to the possible solutions below. The problem The A in Ajax stands for asynchronous. That means sending … Read more