/    Sign up×
Community /Pin to ProfileBookmark

Modal to show contents of simple web page

Hey, client-side gurus:

I’ve got a PHP app (just for internal use), where I currently provide a link in the output to a log file, so that the user can check when the background process they started has completed (or failed). So, once they click the submit button and it fires things off, I just display a link to the log file on the resulting page:

echo <<<EOD
<p class=’success’>Started file creation. Check <a href=”$log”>the log file</a> for status.</p>

It would be nice to instead just display that log file in a pop-up modal window (maybe an onclick event on that link?), but I’d really hate to “pollute” this simple little HTML form page with loads of JavaScript library code and such. Is there a clean “best practices” way to do this — maybe even just HTML/CSS? — for my poor little server-side-specialist brain to work with? 🙂

to post a comment

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogauthorAug 25.2021 — May just make it a HTML element that gets populated by an AJAX request.
Copy linkTweet thisAlerts:
@NogDogauthorAug 25.2021 — Yeah, ended up just adding a button with an onclick event to hit that endpoint and display it in a JavaScript alert(). Really all I need for this, so going to close this. :)
Copy linkTweet thisAlerts:
@NogDogauthorAug 25.2021 — {"locked":true}


Help @NogDog spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ

legal: ({
terms: of use,
privacy: policy
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,