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

How Your Company Can Benefit from SEO Analysis.

You know that it is essential to your business that it has a high ranking with search engines such as Google and Bing, but how do you achieve it? SEO analysis is the device, you need to know how well your strategy is working, and if it is

Livewire SEO

The most common question we receive following a website launch is, “How can I increase traffic to my website without spending a fortune or buying ads?” Every website we develop for a customer includes what we refer to as “Basic SEO”; this simply means that we will fill

Sullivan Welding Has A New Website

Sullivan welding does excellent custom welding and fabrication. Willum is the owner and manages a crew of expert custom welders. He came to Livewire looking for the best in Gainesville Web Design and we were able to set him up in a great new website in just a

Another Mouse Burned

This makes my 7th mouse in less than 18 months. incessant clicking has it’s consequences … and costs …..

Maintaining The Correct Keyword Density

Keyword density, by definition, is the number of times, expressed in a percentage, that a particular keyphrase or keyword appears in a body of text. So if your keyword appears 4 times and the number of words on the page is 200 then your keyword density is 2%.