-
Notifications
You must be signed in to change notification settings - Fork 49
Asynchronous External Content
JP Barbosa edited this page Mar 22, 2021
·
5 revisions
nano resources/views/shared/nav.blade.php
...
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
...
<ul class="nav navbar-nav navbar-right">
<li id="weather" class="navbar-text">Loading weather...</li>
</ul>
</div>
...
nano resources/assets/js/weatherApi.js
function loadWeather() {
var url = 'https://api.openweathermap.org/data/2.5/weather?q=Sao%20Paulo,br&units=metric&APPID=YOUR_APPID'
$.getJSON(url, function(data) {
$('#weather').html('Sao Paulo: ' + data.main.temp + ' Celsius');
});
}
nano resources/assets/js/loadRemoteContent.js
...
$(function() {
loadWeather();
});
gulp
php artisan serve
open http://localhost:8000
git add .
git commit -m "Add asynchronous external content"
Next step: Cached External Content
- Setup
- Basic CRUD
- Validation
- Views
- Association
- Association Controller
- Association Views
- Basic Template
- Bootstrap
- Bootstrap CRUD
- Alerts
- Welcome Page
- Ajax CRUD
- Send Email
- Send Email Views
- Jobs Queue
- Captcha
- Async External Content
- Cached External Content
- Tests Setup
- Functional Tests
- Acceptance Tests
- Continuous Integration
- Deploy with Heroku
- Deploy with Forge
- Update README