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

CSS Evolution

Cascading Style Sheets, or CSS revolutionized the way the web was/is written. The next evolution has been the roll out of CSS3. With all kinds of new tricks, CSS3 promises to take web programming to the next level … and beyond. We generally hand code all of our

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

Review: Google Chrome – StayFocusd ★★★★★

We. Love. This. Chrome extension. Warning: It’s brutal. Stayfocusd is essentially a task manager, not as in manage what task is next, but keeps you focused on your tasks at hand. It blocks websites that waste your time and keep you distracted through a time limit feature. You

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%.

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

Digital Worlds

Just finished up a long term project with Digital Worlds at the University of Florida in Gainesville. This web design project intends to reach young audiences with compelling content. It is a place for them to upload videos, share, collaborate and get insights into problems and issues that