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 Low Down on Net Neutrality

What they heck is it? Most people don’t know it past the slogan .. and that’s what it is, a slogan. Net neutrality does not mean ‘left alone”, there’s nothing laissez faire about it. It does mean oversight, more oversight of the Internet than currently exists. The advocating

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

Northwest Seafood has a new website!

Thanks to our killer Gainesville Web Design another Gainesville company has joined the livewire family with a brand new website! It’s wordpress so we can’t take credit for the design in it’s entirety but the layout is great and they’re very happy with the finished product. Their original

WP: Adding a HTML5 Search Form

A simple script from your local Gainesville Web Designer. [code scroll=”false” language=”htmml”] <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( ‘/’ ); ?>”> <label> <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’ ) ?></span> <input type=”search” class=”search-field” placeholder=”<?php echo esc_attr_x( ‘Search …’, ‘placeholder’ ) ?>” value=”<?php echo get_search_query() ?>” name=”s” title=”<?php echo esc_attr_x( ‘Search

gainesville website SEO company

✈️ New Website Launch: University Air Center Soars to New Heights Online

We’re proud to announce the launch of the new and improved website for University Air Center — Gainesville’s premier full-service FBO, flight training, and aircraft maintenance hub. With a sleek new design and streamlined navigation, the new uac.aero offers pilots, students, and aviation professionals a faster, more user-friendly

TNA The Facial Pain Association has a new website

Glad to have them on board! The Facial Pain Association does some really great work on helping people with debilitating condition known as TNA. Facial pain is a serious condition and options are often limited for sufferers. Fortunately they do have the association there to assist them in