Canadian passenger Dan So, 41, filmed people around him frantically trying to stand as objects fell and shattered around them as Royal Caribbean’s Explorer of the Seas capsized violently during a storm off its coast of Africa last week – with objects around them smashing to the ground.
“It was like the Titanic,” So told Kennedy News and Media, seeing “people screaming and glasses breaking.”
“I thought this could be the end and the ship would go into the water,” he added of the alarming “45 degree” tilt.
“I took out my mobile phone and texted my colleagues, telling them I don’t know what’s going to happen and to be careful. I was writing my last message, thinking I was going to die,” added the 41-year-old, who was traveling on a cruise ship for the first time in his life.
One passenger was reportedly injured during the bad weather as passengers were taken to their rooms for an hour for necessary checks to be carried out.
The ship made an unscheduled stop in Las Palmas to help the injured passenger before continuing on its way, the company said.
A cruise ship tilted 45 degrees in the Atlantic ocean causing chaos on board pic.twitter.com/97LcAMQ5L9
— Daily Loud (@DailyLoud) November 11, 2024
Melania Trump: Not moving into the White House – “This time it will be different”
Black Friday: What consumers should watch out for
Brazil: Man strapped with explosives detonates outside Supreme Court
Kostas Martakis: “When I entered, some people told me to undress”
#Trembling #Storm #hits #cruise #ship #forces #list #degrees #Titanic #video
How can you improve error handling when loading external scripts in JavaScript?
It looks like you've shared a snippet of JavaScript code related to ad management and integrations. The code is responsible for managing various advertising services, including Google AdSense, OneSignal, Disqus, Taboola, Phaistos Adman, and others, potentially loading scripts dynamically based on certain conditions.
Here's a general outline of how this code might work along with some optimizations and recommendations:
### Key Sections of the Code:
1. **Removing Mobile AdSense**:
- The initial block removes `.adsbygoogle` elements from elements with the class `.adsense-for-mobile`.
2. **Checking AdSense Slots**:
- It counts the `.adsbygoogle` elements and performs actions if available.
3. **OneSignal Initialization**:
- Sets up the OneSignal service for push notifications with a specific app ID.
4. **Disqus Configuration**:
- Configures Disqus comments by setting the current page's URL and identifier.
5. **Dynamic Script Loading**:
- There's a consistent pattern of loading scripts asynchronously using `asyncLoadScript()`.
6. **Conditional Script Execution**:
- Checks for the presence of specific elements before loading related scripts (e.g., Google AdSense, Glomex).
### Recommendations and Clean-Up Suggestions:
- **Define a Callback for `asyncLoadScript`**: If `asyncLoadScript` is used to asynchronously load scripts, consider passing a callback function to execute once the script has loaded successfully.
- **Combine Similar Operations**: The handling of ad scripts can be combined into a function to avoid repetition and improve maintainability.
- **Error Handling**: Ensure that you handle potential errors when loading external scripts, as this will enhance the robustness of your application.
- **Use `const` or `let` Instead of `var`**: Update variable declarations to use `const` or `let` instead of `var` for better scope management and to prevent hoisting issues.
- **Avoid Using Magic Numbers**: Where you use timeouts (like `setTimeout` with `3000` or `2000` milliseconds), consider defining constants to clarify their purpose.
Here’s a basic example of how to refactor part of your code to keep it more organized:
```javascript
function loadScript(url, callback) {
const script = document.createElement('script');
script.src = url;
script.async = true;
if (callback) {
script.onload = callback;
}
document.head.appendChild(script);
}
// Example of loading OneSignal
loadScript('https://cdn.onesignal.com/alerts.js', function() {
window.OneSignal = window.OneSignal || [];
OneSignal.push(function() {
OneSignal.init({ appId: "487cc53b-3b66-4f84-8803-3a3a133043ab" });
});
});
// Example of loading Disqus
setTimeout(function() {
loadScript('https://disqus.com/embed.js', function() {
var disqus_config = function() {
this.page.url = window.location.href; // Replace with your page's canonical URL variable
this.page.identifier = "1565586"; // Replace with your page's unique identifier variable
};
});
}, 3000);
```
### Conclusion:
This reorganized approach maintains readability, allows for better error handling, and makes it easier to manage the loading of different services. Adjust the URLs and configurations as per the specific requirements of your application.