Created Ask Dev Osan framework

master
BuildTools 6 years ago
parent 8d4b1fe06f
commit 3c70252351
  1. 4
      index.html
  2. 23
      sig-ask-devOsan.js
  3. 4
      sig-ask-devosan/index.php
  4. 3
      sig-ask-devosan/popularquestions.php

@ -199,6 +199,9 @@
<div class="answer"> <div class="answer">
Absolutely not, just a desire to hang out with software developers. Absolutely not, just a desire to hang out with software developers.
</div> </div>
<div class="sig-ask-devosan">
</div>
</div> </div>
</div> </div>
</div> </div>
@ -239,5 +242,6 @@
crossorigin="anonymous" crossorigin="anonymous"
></script> ></script>
<script src="additionalScripts.js"></script> <script src="additionalScripts.js"></script>
<script src="sig-ask-devOsan.js"></script>
</body> </body>
</html> </html>

@ -0,0 +1,23 @@
window.onload=init();
function init() {
document.getElementsByClassName("sig-ask-devosan")[0].innerHTML=`
<h1>Ask {dev}Osan.</h1>
<form name="ask-devosan" method="POST" action="http://45.33.13.215/projects/dev-osan/dev-osan.github.io/sig-ask-devosan/index.php">
<input type="text" style="width:85%" name="question" value="What would you like to know?"><input type="submit">
</form>
<div class="sig-ask-devosan-popular">Fetching data...</div>`;
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (this.readyState==4 && this.status==200) {
document.getElementsByClassName("sig-ask-devosan-popular")[0].innerHTML=this.responseText;
}
}
req.open("POST","http://45.33.13.215/projects/dev-osan/dev-osan.github.io/sig-ask-devosan/popularquestions.php")
req.send();
document.getElementsByClassName("sig-ask-devosan-popular")[0].innerHTML=`
Fetch data...
`;
}

@ -0,0 +1,4 @@
<?php
echo "Posted Question: <b>".$_POST['question']."</b>";
?>

@ -0,0 +1,3 @@
<?php
echo "ping!";
?>
Loading…
Cancel
Save