Created
January 17, 2019 19:43
-
-
Save alanef/332509155618e5c0b6bbb0b18cd5d612 to your computer and use it in GitHub Desktop.
Html to get latest post link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title></title> | |
| <meta content=""> | |
| <style></style> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
| <script> | |
| (function( $ ) { | |
| 'use strict'; | |
| $.ajax({ | |
| url: "https://whatwasthatlike.com/wp-json/wp/v2/posts?per_page=1" | |
| }).then(function(data) { | |
| console.log(data); | |
| $(".link").append(data[0].link); | |
| }); | |
| })( jQuery ); | |
| </script> | |
| </head> | |
| <body> | |
| <div class='link'></div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment