Some questions:
First off thanks for responding, Mamp is running the demo site is fine, nothing happens I am having a problem with the whole set up. I dont understand how to set it up in laravel. I cant find the steps anywhere
Go on YouTube and look at the tutorials on jQuery AJAX by jream. An AJAX post is the same whether you using Laravel, regular PHP Pdo or any framework there's no mysteries there.
Watch those videos.
OK, I didn't understand your reponse, due to a lack of punctuation!
Are you running the Mamp demo site OK, but can't run a separate Laravel site?
@jimgwhit Thats what I thought that its nothing different. But when I tried the treehouse tutorial it didn't work. I have the code posted at the top of this page. here it is
<script>
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (xhr === 4) {
document.getElementById('ajax').innerHTML = xhr.responseText;
}
};
xhr.open('GET', 'welcome');
xhr.send();
</script>
welcome is refers to this
Route::get('welcome', 'WelcomeController@index');
shouldn't it work like this?
I will watch the suggested videos.
and @davestewart everything is set up and working except for the ajax
Forget about some tree house tutorial watch the videos I referenced to you that has very thorough videos.
If you know how to use ajax in html/php, there's no difference when using it on laravel. Good thing is you can use Laravel's route() helper so the url on your ajax will get the correct path.
thank you all for your respnses. I was just thrown off by how it was explained and I have got it to work. Now I'm on to JSON and am wondering how you display it. Would like some info on that.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community