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

The Amazon Dams Network

Proud to present the first online version of the Amazon Dams Network. This has been a project Livewire has been working on for several months with the University of Florida and other members from around the world. This has been a very exciting project and we are pleased

Submit A Sitemap … To Bing?

Indeed. For some reason, Bing still exists. And since it does you’ll need to submit your sitemap so your business will show up in the results of a person who searches from the unwanted automatically installed Bing bar on their browser. They’re so lovely, forcing it on you

Leverage Browser Caching

When a webpage loads on your screen there are a lot of little pieces that have come together to create what you’re seeing. Your logo, other images, style sheets, javascript files are among some of the external resources a webpage might use to render itself on your screen.

What’s Worse?

What’s worse than these dang North Florida love bugs? Having a poor website, for one. A website should be like the dream employee . It should never call in sick, treat your customers properly and get them the information and the attention the require each and every time.

Budding Biologist has a new website

A cute website for a really neat childrens’ book series by budding biologist. Their new website is responsive, meaning it is mobile ready and will display correctly across all devices and all browsers. Integrated web store and using the latest in HTML 5 and CSS3 media queries. Cloud

Some Homepage Best Practices

Building an effective website begins with a well-designed home page. Because it’s the first thing people see, the homepage must make a nice impression while also pointing the user in the right direction. If you want your homepage to be successful, you should follow these guidelines. Make sure