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

Date for our next Seminar is 4/8

Livewire Seminars are the perfect way to collect everything you need to know to do your own website optimization. We have what it takes to put your site on page 1 and we’ll teach you all of the not-so-secret info. Where to go, what to do, and how

The Importance of a Professional Website for Gainesville Businesses

Gainesville is a vibrant community known for its strong local economy, driven by a mix of education, healthcare, and a growing number of small businesses. As a business owner in this dynamic environment, establishing a solid online presence is no longer optional—it’s essential. One of the most critical

contractor website design

Why Contractors Need Professional Website Design to Stay Competitive

In today’s digital-first world, a contractor’s website is more than just an online presence—it’s a powerful tool to attract, engage, and convert potential clients. Whether you’re a general contractor, plumber, electrician, or specialize in any other trade, having a well-designed website can set you apart from competitors and

Why is WordPress our Go-To CMS?

Easy. It’s easy. Easy to use, operate and teach. We have dealt with virtually every blogging and Content Management Software out there, in existence, forever. Seen them all. Virtually all of them have their individual issues, yes, even WordPress. But few are as intuitive and easy to learn.

Even More Internet Marketing Success

We’ve been working with attorneys all over town. None more than Fisher, Butts, Sechrest and Warner. They’re great folks located over in Haile. They have a successful law firm and are enjoying much success online. When we met, they were basically nowhere online … maybe somewhere back on

Choosing The Right Domain

Finding the right domain can be a arduous process. That is, unless of course you are lucky enough to find your business name in the exact form you desire. More often than not, obtaining a great domain takes a lot f time, mental energy and cautious anxiety. Will