Use this script to display a custom message when a property Details page no longer exists or cannot be found.
This customization replaces the default missing property message shown on IDX Broker Details pages.
Overview
This example:
- Detects when a Details page is showing a missing property alert
- Replaces the default alert content with custom HTML
- Allows you to add:
- custom text
- images
- branding
- calls-to-action
- links
The script uses the built-in jQuery instance included with IDX Broker through the idx variable.
Where to Add the Code
Add the code to:
- Designs
- Website
- Subheaders
- Pages
- Details
Then:
- Turn the WYSIWYG editor off
- Paste the code into the raw HTML editor
Example Code
<!-- Custom 404 details message -->
<div id="custom-detailsMissingPropertyAlert" style="display:none;">
Custom message for <b>missing property</b>. <br>
<img src="https://i.imgur.com/p6ijps6.jpg" height="200" width="200">
</div>
<!-- Custom 404 details script -->
<script type="text/javascript">
idx(document).ready(function() {
if (idx('#IDX-detailsMissingPropertyAlert').length > 0) {
idx('#IDX-detailsMissingPropertyAlert').html(
idx("#custom-detailsMissingPropertyAlert").html()
);
}
});
</script>
What This Script Does
The script:
- Waits for the page to load
- Checks whether the default missing property alert exists
- Replaces the default alert content with your custom HTML
Customization Ideas
You can customize the message with:
- branded images
- agent contact information
- property search links
- featured listings
- lead capture forms
- buttons
- alternative property suggestions
Example Enhancement
<div id="custom-detailsMissingPropertyAlert" style="display:none;"> <h2>Property No Longer Available</h2> <p> The property you are looking for may have been sold or removed from the MLS. </p> <p> <a href="/homes-for-sale/">Browse Available Listings</a> </p> </div>
Important Notes
IDX Uses jQuery via idx
IDX Broker already includes jQuery using the idx variable.
Use:
idx(document).ready(function() {
});
instead of:
$(document).ready(function() {
});
to avoid potential conflicts.
Use HTTPS Images
Always use HTTPS image URLs when possible.
Example:
https://example.com/image.jpg
instead of:
http://example.com/image.jpg
to avoid mixed-content browser warnings.
Best Practices
Keep the Message Helpful
Good custom 404 messages should:
- explain what happened
- offer next steps
- guide users back into the site
Add Navigation Options
Consider including:
- search links
- homepage links
- contact information
- featured properties
to reduce visitor drop-off.
Test the Details Page
After adding the script:
- Open a missing property Details page
- Confirm the custom message appears correctly
- Test on desktop and mobile devices
Common Use Cases
This customization is commonly used for:
- branded missing property pages
- lead recovery
- SEO-friendly error handling
- improved user experience
- redirecting users back into search flows