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 is in a name? SEO strategies for Facebook

Establishing Connections. Social media represents a critical marketing opportunity for small business in creating connections with potential clients through shares and referrals. There are certain marketing and SEO strategies that standout in creating value for your business. We all have that friend that excusably shares information just to

Best Seagate Barracuda Internal Hard Drive 4TB SATA

An Internal Hard Drive With Endless Storage and Impressive Speed. If you require vast data storage while not sacrificing speed, look no further than the Seagate’s Barracuda Internal Hard Drive Model ST4000DM004! With 4 terabytes of reliable storage you can store business documents, videos, pictures, games and movies

New Projects

We’re excited to have new projects coming in on a regular basis. On the menu for the next few weeks are some great opportunities to expand our portfolio and our reach. Lake Butler is electing a new Sheriff soon and we’ll be creating one of the candidate’s websites.

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

WordPress Custom Post Type Category Images : Solved

If you’re a WordPress developer, you’ve probably been here. You want to use images for your categories, but they are custom taxonomies. Here’s how to solve that issue. We’re using a plugin called “Category Images” by Muhammad Said El Zahlan. Download, install and activate the plugin. Now you can

Don’t Think Page Load Times Matter? Think Again.

A recent study by Google really hit home for online retailers or anyone looking to make a sale/conversion online. As Forbes points out: “53% of mobile site visitors will leave a page that takes longer than three seconds to load.” Google’s recommendations usually hover around one to one