function to call all pages. (js)
What is this all about?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
good morning
I have a problem with livewire, i have a main blade call home it has all the css and js and i have a principal div so all my page will load in my principal div, the problem the i have is the my livewire doesn't render any help???
Main blade. (home.blade.php)
<html>
<head>
...
@livewireStyles
</head>
<body>
<div id='content' class="col-12" ></div>
@livewireScripts
</body>
</html>
function to call all pages. (js)
window.User = function () {
$.ajax({
url: "user_blade",
type: "GET",
success: function(data){
$('#content').html(data).fadeIn();
},
beforeSend: function(){
$('#content').empty()
},
});
}
my user blade (user.blade.php)
@livewire('create-casa')
my livewire blade (create-casa.blade.php)
<div style="text-align: center">
<button type="button" wire:click.prevent="sumar()" class="btn btn-primary">Save
changes</button>
<h1>{{ $count }}</h1>
</div>
my livewire Class (CreateCasa.php)
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class CreateCasa extends Component {
public $count = 1;
public function sumar() {
$this->count++;
}
public function render() {
return view('livewire.create-casa');
}
}
this is my code the problem the i have is the livewire doesn't render, but if i put all the code in the main blade it works, any help??
Please or to participate in this conversation.