Ways to display content alongside an image

Is there a way to verify if an application is running on another server by displaying an image it provides? The challenge is that altering the content of the image is not an option. If the image is not provided, can I show an alt attribute indicating that the app is down?

I am seeking a solution using CSS/HTML, or possibly JS or PHP if necessary.

One idea is to hide the image and display a message saying "the app is up" instead. However, traditional methods of image replacement do not seem to work in this case. Any suggestions on how to achieve this?

Answer №1

If you want to personalize the message shown when an image fails to load, you can achieve it with just HTML and CSS. However, if you're looking to customize the loaded image message, that might be a bit tricky. One workaround is to utilize a JavaScript Ajax request to verify the status header of the requested resource without actually loading the image.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is the input box failing to show up on your screen?

I recently tackled the task of creating a commenting feature for RSS articles Throughout my journey with PHP coding, I encountered an issue where the input box for comments was not displaying. https://i.stack.imgur.com/gJIlu.png Check out the snippet fr ...

jQuery Conditional String Manipulation

I have set up a system where users can input values and make selections from a drop-down menu, which then get integrated into JavaScript code to generate customized sentences based on their inputs. Once the user clicks submit, the sentence is formed. It&ap ...

Enhance your Razor Pages with Bootstrap 5's floating control for input groups featuring buttons and datetime pickers

I don't have expertise in Bootstrap or CSS. I'm attempting to build an input for DateTime with arrows on the sides using Bootstrap 5 and Razor Pages. My initial tries did not yield satisfactory results. I want an ItemGroup that includes a DateTi ...

Developing a feature that allows users to switch between different sets of information

I'm currently exploring a new project and attempting to design a toggle that switches between monthly and annual payments based on the user's selection, much like the functionality found here: . At present, I have implemented two sets of price c ...

Comparing background-color using .css() in jQuery/Js

I've been experimenting with creating angled divs on a webpage, where each basic panel is separated by an angled break. The idea is to have the background-image of one div flow smoothly into the background-color of the next div. Since I couldn't ...

Using more than one class at a time is causing issues

Essentially, I have a div and I want to create an exercise where I apply three different classes using vue.js. I attempted to use v-bind:class, specifically :class, but can I bind a class directly from CSS? This is what I tried: html <div :style="[my ...

The column width in Bootstrap HTML is too excessive

var parentDiv = document.getElementById("cc"); var statementDiv = document.createElement("div"); var statementName = document.createElement("div"); // var removeIconDiv = document.createElement("div"); // removeIconDiv.className = "col w-25"; // ...

Guide to aligning form data with Bootstrap

Struggling to align my form data in the center below. I have attempted various online solutions without success. The use of bootstrap and offset is causing issues with the title for the form and the actual form itself. Any suggestions would be highly appre ...

Passing variables in Redirect() without exposing them in the URL; a methodical approach

After scouring the depths of the internet, I have been on a quest to figure out how to seamlessly redirect to a new page on my site while discreetly passing a variable without exposing it in the URL like so: www.test.com/?variable=dont.want.this.here I a ...

style for a bootstrap form input

Can the form-control from Bootstrap be made inline for input without relying on the grid system like col-md-2? This is the one aspect of Bootstrap that I find particularly frustrating. ...

Modifying the border color of a row may result in unexpected shifting of cells

To enhance the appearance of certain rows in my table, I have customized their styles for highlighting purposes: table.setRowFactory(tv -> new TableRow<TableBean>() { @Override public void updateItem(TableBean item, boolean empty ...

How to preselect a radio button in an Angular radio button group list?

Having an issue with setting a default radio button as checked when the page loads in my Angular 7 and HTML project. I am able to retrieve the value but struggling to mark a radio button as checked during the page load. Any advice on how to resolve this wo ...

Is there a way to customize the dot in a JavaFx RadioButton?

Hello fellow coding enthusiasts, I am looking to find out how I can customize the color of a RadioButton dot. I want to have 3 RadioButtons, each with a different color to represent a state. Do I need to use CSS for this task? If so, could someone please ...

The hyperlink is unclickable because of the menu

The code below contains a menu on the right side with a hover effect and some content with a link. However, the link is not clickable due to the menu. .menubar{position: fixed;right:0;top: 50%;transform: translateY(-50%);-webkit-transform: translateY(-5 ...

Creating a website layout suited for printing using CSS

One of my clients has a website that needs to be converted into a brochure format. When he prints the website, it must be printed on paper with a specific layout. Some sections need to be removed and others modified. I have utilized Bootstrap 4 and create ...

Ways to transfer the entered number to the input field located outside the angular modal

I'm currently working on creating a modal that includes a button and an input field for manually entering a number. Once the number is submitted, it should appear in the input field outside the modal and be available for various functions such as sett ...

My @media queries are causing me some issues

Struggling with my @media queries. Once I upload my website on github, it fails to scale properly. However, when testing it in Webstorm (JetBrains), everything seems to be working fine. Any assistance would be greatly appreciated! Here is the link to my w ...

Is there a more efficient method to display and conceal multiple div elements with jQuery?

I am looking for an alternative method to use jQuery to show and hide divs. This code is specifically for testing purposes and includes a large number of divs that will make the code quite long once all are added. HTML Code <!DOCTYPE html> <html ...

Screen size is incompatible with flash player

I've been using this code to try and make a swf file fit my screen or any screen it's on, but I've run into an issue. When using this code, the player in both Chrome and IE stretches to fit the screen width, but the height remains the same, ...

What could be the reason why my hx-trigger isn't activated when using the "from: <css selector>" option?

I am facing an issue with sending multiple requests to the server when clicking a button. The structure is as follows: <button id="add-item" hx-get="some-url" hx-trigger="click" hx-target="#item-form" hx-swap=&quo ...