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 Flour Pot Bakery has a new website.

NEW!! Sally is one of a kind and so is her business. She really takes the time to put out a quality product and we wanted to give her that same high quality standard with her website that she is used to. FPB has some fantastic bread –

Moving Day

Moving day, er, week, here at Livewire. New offices located at 2606 NW 6th Street are being filled in with all of our useful junk. Very exciting to be in a premium location with large signage and great new neighbors. Livewire has teamed up with Gnosys Networks to

New apps coming down the pipe

We have 6 new apps coming out over the next few months. Very excited to roll these out – unfortunately we can’t give you too many details but we have a couple apps geared toward attorneys and the legal industry, one that deals with product shipping and another

Howe Development Has a New Website

Website is complete on Howe Development. Now for phase 2 – integrating a simply, custom CMS so they can update content on parts of the site. No need for wordpress – we can easily do a custom solution for those cases where a client only needs to control

TradePMR has a new website

A really great client – TradePMR – just launched their new super awesome, totally spectacular, mobile responsive website! We worked with their staff for the last 8 weeks to put together an entirely new online experience for their customers. Livewire will be conducting conversion optimization audits over the

Facebook Dings Developers

In the ever growing app community, Facebook is putting the screws to developers looking to use their vast resources to build their apps. Really, they’re just looking for a little “reciprocity”. But come on, how much do you need? You already own and operate the largest website in