Category : if-statement

I’m trying to find out how to limit the characters on the mobile display using php. I have made the character limit (700 characters) work fine. I want the character limit on the mobile display to be 150 characters. How do I implement it in PHP? PHP (Laravel) @if (strlen($val->getByLang(‘id’)->description) > 700) <div class="section-description desc-more"> ..

Read more

//Code for redirecting a blogger post url to another url. // Already chose Desktop theme for mobile devices. <script type = "text/javascript"> if(window.location.href == ‘https://example.blogspot.com/2021/03/blog-post.html’) { document.location = "https://amazon.com/"; if (screen.width < 699) { document.location = "https://amazon.com/"; } } </script> //It would be very helpful if you provide code for redirecting post url to another ..

Read more

I am looking for a way to make my JS errors handling function dynamic, now i am checking each possible error seperately, the function code looks like this. function handleErrors(errors){ if (errors.nameError){ nameEl.classList.add(‘is-invalid’); nameEl.nextElementSibling.innerHTML = errors.nameError; } if (errors.surnameError){ surNameEl.classList.add(‘is-invalid’); surNameEl.nextElementSibling.innerHTML = errors.surnameError; } if (errors.emailError){ emailEl.classList.add(‘is-invalid’); emailEl.nextElementSibling.innerHTML = errors.emailError; } if (errors.passwordError){ passwordEl.classList.add(‘is-invalid’); passwordEl.nextElementSibling.innerHTML ..

Read more