Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

emilpapelas4@gmail.com's avatar

How to load content without refresh the page.

I have my website that load content by it's id. I use an parameter that was added to url that get the current id.

End url parameter will get the url that associated with the id passed in url

@foreach walls as wall
                    <a href="?wall={{$wall->id}}" class="lg:border-b lg:flex lg:items-center lg:justify-center lg:bg-gray-100 md:inline-block md:h-auto md:mr-1 md:bg-gray-300 md:rounded md:mt-1 sm:inline-block sm:h-auto sm:mr-1 sm:bg-gray-300 sm:rounded sm:mt-1">
                        <img src="{{$wall->image}}" class="lg:w-24 lg:h-auto lg:p-1 md:flex md:items-center md:justify-center md:w-24 md:h-9 md:p-1 sm:flex sm:items-center sm:justify-center sm:w-24 sm:h-9 sm:p-1">
                    </a>
                   @endforeach

<div class="wall flex-1" style="height: 60vh;">
                <iframe src="{{$endurl}}" frameborder="0" width="100%" height="100%" ></iframe>            
            
          </div>
0 likes
10 replies
emilpapelas4@gmail.com's avatar

@Snapey Not work also not sure if u understand my question. I have an img below to see how my site look. https://imgur.com/zGKhkaA

On left side will have the walls with every time will click on one of them will get the current url of the wall by it's id and show but i dont want to refresh the page every time when change betweem them.

Snapey's avatar

@emilpapelas4@gmail.com I perfectly understood your question, but the solution is probably beyond your current skillset.

Noone can help you with "not work" I'm afraid

A simpler option, you could load ALL the content and treat it like tabbed content, only showing the relevant tab when you click the left button. It depends how much content there is.

emilpapelas4@gmail.com's avatar

@Snapey ya tabbed content looks good but issue is that every content have their ID and by this I'd will show the iframe url

Please or to participate in this conversation.