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

New Partners

We’ve partnered up with PWH Tech Solutions – one of Gainesville’s premier IT companies – to build some great new apps and web programs. We wish we could tell you all about it but things are pretty hush-hush right now. Suffice it to say that these are huge

Gainesville Website Design: Mobile Websites

Mobile sites are a great way to tap into a new resource for many businesses. More and more people are using their phones as their primary device for Internet access. Phones are more computers than they are phones these days. A mobile website is a lightweight version of

Client Spotlight – Veterans Moving Help

Greg came to us needing a boost in his website traffic. He already had his site running but needs people to be able to find it. We are currently working diligently to make that happen for him. We’ve already made significant progress in his search engine rankings and

Warrington Heating and Air Has a New Website

Warrington Heating and Air is a great company and they made a great choice coming to us for their website needs. Previously they had been with a company out of California. They were not happy with the results thus far. Their website was out of date, never worked

How important is color in web design?

Color is an extremely important aspect of web design. It can have a significant impact on the user’s perception of a website, its brand identity, and the overall user experience. Here are some reasons why color is important in web design: Branding: Colors can be used to create

Good one on Sitelinks

Sitelinks also factor into your ad rank, and can influence the position of your ad on search page. Ad Rank previously took into account your max cost-per-click (CPC) and quality score, and now ad extensions and formats are another component of the calculation. Seems like a no-brainer to implement,