This guide will help you upgrade from jAlert 4.x to jAlert 5.0.0.
jAlert 5.0.0 maintains 100% backward compatibility with all existing APIs. Your existing code will work without any modifications.
# If you're using npm
npm install jalert@5.0.0
# If you're using yarn
yarn add jalert@5.0.0- Download the latest release from GitHub
- Replace your existing
jAlert.min.jsandjAlert.min.cssfiles - Update your HTML references if needed
jAlert/
├── src/
│ ├── jAlert.js
│ ├── jAlert.min.js
│ ├── jAlert.css
│ └── jAlert.min.css
jAlert/
├── src/ # Source files (development)
├── dist/ # Distribution files (production)
│ ├── jAlert.min.js
│ ├── jAlert.min.css
│ └── jAlert-functions.min.js
If you're using the standard file structure, you may need to update your script references:
<!-- Old (4.x) -->
<script src="src/jAlert.min.js"></script>
<link rel="stylesheet" href="src/jAlert.min.css">
<!-- New (5.0.0) -->
<script src="dist/jAlert.min.js"></script>
<link rel="stylesheet" href="dist/jAlert.min.css">Ensure you're using jQuery 3.7.0 or later:
<!-- Update jQuery if needed -->
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>Add this to your existing code to create image slideshows:
$.jAlert({
slideshow: [
'path/to/image1.jpg',
'path/to/image2.jpg',
'path/to/image3.jpg'
],
slideshowOptions: {
autoAdvance: true,
showArrows: true,
showCounter: 'dots'
}
});All existing options work the same, but you now have additional slideshow options:
$.jAlert({
// Your existing options work exactly the same
title: 'My Alert',
content: 'My content',
theme: 'green',
size: 'md',
// New slideshow feature
slideshow: ['image1.jpg', 'image2.jpg'],
slideshowOptions: {
autoAdvance: true,
autoAdvanceInterval: 3000,
showArrows: true,
showCounter: 'dots', // or 'numbers'
keyboardNav: true,
loop: true,
pauseOnHover: true,
resizeMode: 'fitLargest' // or 'fitCurrent'
}
});- IE11+ (new ES5 compatibility)
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
The plugin is now transpiled to ES5, providing better compatibility with older browsers.
- Smaller bundle size due to optimized builds
- Faster loading with modern build tools
- Better caching with optimized assets
// Test basic alert (should work exactly the same)
$.jAlert({
title: 'Upgrade Test',
content: 'If you see this, the upgrade worked!',
theme: 'green'
});Run through your existing jAlert implementations to ensure they work as expected.
Try the new slideshow feature:
$.jAlert({
slideshow: ['https://picsum.photos/800/600?random=1', 'https://picsum.photos/800/600?random=2'],
slideshowOptions: {
showArrows: true,
showCounter: 'numbers'
}
});-
"jQuery is not defined"
- Ensure jQuery 3.7.0+ is loaded before jAlert
- Check script loading order
-
"jAlert is not defined"
- Verify the script path is correct
- Check that the file was downloaded completely
-
Styles not loading
- Ensure the CSS file is properly linked
- Check the file path
- Check the documentation
- Review the changelog
- Open an issue on GitHub
- Download jAlert 5.0.0
- Update file references in HTML
- Ensure jQuery 3.7.0+ is loaded
- Test existing functionality
- Test new slideshow feature (optional)
- Update documentation references
- Deploy to staging environment
- Test in production
After upgrading, you can:
- Explore the new slideshow feature for image galleries
- Review the enhanced documentation for new options
- Consider using npm for easier future updates
- Contribute to the project with the new development workflow
If you encounter any issues during the upgrade:
- Check this guide first
- Review the changelog
- Test with a minimal example
- Open an issue on GitHub with details
Happy upgrading! 🚀