Javascript called by PHP

Interesting little snippet.

What is going on here? Livewire gives you the low down.

 

 if($num_rowvs == 0){
 echo '<script>// <![CDATA[
alert("This is an alert message. I'm alerting you that you are totally awesome!");
// ]]></script>'; }

 

First, we’re creating a simple if statement in PHP.  Not entirely necessary, but prbobably the most common setup. Next we’re simply echoing the javascript alert – make sure to get your apostrophes and commas straight.

And that is it. Close out the tags and you have successfully called a javascript alert from inside PHP. Congrats.

More Web Design Blog Content

What the Heck! The Boutique Guide?!

Yes, it’s the roll out of our newest fandangled BOUTIQUE GUIDE! This is a really, truly excellent experiment in cooperative advertising. We’ve built The Boutique Guide to get small boutiques – generally just a one or two person operation – a leg up on their (lass capitally challenged)

New apps coming down the pipe

We have 6 new apps coming out over the next few months. Very excited to roll these out – unfortunately we can’t give you too many details but we have a couple apps geared toward attorneys and the legal industry, one that deals with product shipping and another

Woocommerce Products Per Page

Interestingly Woocommerce does not seem to have a default setting for ‘products per page’. Unsurprisingly, there’s a simple workaround. Add to your functions.php Replace “28” with whatever number you want. add_filter( ‘loop_shop_per_page’, create_function( ‘$cols’, ‘return 28;’ ), 20 );

Five Frequent SEO Mistakes and How to Fix Them.

Five Frequent SEO Mistakes and How to Fix Them. A few simple missteps can derail all the hours of toil, not to mention money, put into your SEO efforts. Here are five common SEO mistakes and how to rectify them.  Keywords Should Match Content. Google wants its customers

Ethics honesty and integrity words on signpost

Honesty & Integrity in Business: The Foundation of Long-Term Success

In today’s fast-paced digital world, businesses are constantly competing for attention, customers, and growth. Some companies take shortcuts, making promises they can’t keep, or worse, engaging in dishonest behavior that prioritizes profit over integrity. At Livewire, we believe that honesty, transparency, and strong core values are the key