R
R
Rishat Sultanov2017-02-23 18:58:31
JavaScript
Rishat Sultanov, 2017-02-23 18:58:31

How to load HTML code from database?

Good evening gentlemen.

At the moment I have the HTML code in the database.
How to display it on href click?
The person advised doing this: plnkr.co/edit/KLhb0d6zTqIODUfmNUdG?p=preview

But there we load data from the file, I have data in the database.

<!-- Menu -->
    <section id="about" class="about">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 text-center">
                    <div id="Navigation">
                    <ul class="Navigation">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">My Portfolio</a></li>
                        <li><a href="#">Services</a></li>
                        <li><a href="#">Contact</a></li>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                    </ul>
                </div>            
                </div>
            </div>
            <!-- /.row -->
        </div>
        <!-- /.container -->


@foreach($dropmenu as $dropone)

{!! $dropone->action !!}

@endforeach

Here I have a list and content loading of HTML code at the Laravel level. I would like to click on the href defined , the code was loaded at the Laravel level ^)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sklyarov, 2017-02-23
@0example

Use php functionhtmlspecialchars_decode();

P
Pavel Omelchenko, 2017-02-23
@pOmelchenko

by clicking on the button, we send the parameters for the request to the database by post. After that, the method collects data from the database and forms the answer in the form you need, which you substitute in the right place.
api.jquery.com/jquery.ajax

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question