Coldfusion Meetup: "SEO and ColdFusion" - May 27, 2010

"Search Engine Optimization for the ColdFusion Developer"

TOPIC DESCRIPTION: (provided by the speaker) In today's world, the bulk of our traffic to the websites we create comes from search engines. And with the exception of failed business models burning through VC money, more traffic equals more money. But few developers bother to do even basic search engine optimization, which can dramatically improve their websites performance on Google and the like. The good news is that the basics of SEO is relatively easy to do, especially inside of most CFML applications. We'll go over the fundamentals of SEO and how you can easily integrate these principals into your application. We'll also discuss some free programs you can use to track your progress, and some other techniques to keep you in Google's good graces.

MEETING URL: http://experts.acrobat.com/cfmeetup/

DURATION: Approx. 1 hour

SPEAKER: Jeff Gladnick

Jeff Gladnick lives in San Francisco, CA and has been a ColdFusion developer for over 10 years, since version 4.5. He's developed web applications for a variety of companies including the Produce Marketing Association, Dun & Bradstreet, The Gap, and Adobe. He particularly likes Model Glue as a framework, and also owns http://www.greatdentalwebsites.com, a company that allows dentists to create their own website (using a model-glue application).

WHEN: Thurs. May 27, 12:00pm US ET (UTC/GMT-4)

RECORDING: As always, the meeting will be recorded, and the recording URL will be posted after the meeting at http://recordings.coldfusionmeetup.com.

HELP: CFC+jquery+JSON

Ok, I've been at this for a couple of hours now. I thought I was on the right track, but it looks like I'm still a bit lost :(

I have a modal login form using jquery and colorbox plugin.

Here is a snippet of my jquery ajax call:


$j.ajax({
url: 'cfc/security.cfc?method=login',
data: datastring,
dataType: 'json',
success: function(data) {
    var response = eval(data);
    console.log(response.MESSAGE);
$j('.ajaxMsg').css({"display":"block"}).html(data);
$j.fn.colorbox.resize();
}
});

When calling this CFC from a URL using the correct parameters, I get this:
{"MESSAGE":"Verified! Logging in...","FNAME":"John","LNAME":"Smith","VALID":true}
This is exactly what I want.

However, when running the ajax call above I get:


<wddxPacket version='1.0'><header/><data><string>{"MESSAGE":"Verified! Logging in....","FNAME":"John","LNAME":"Smith","VALID":true}</string></data></wddxPacket>


And this is screwing me up.

Here is my CFC snippet:


<CFFUNCTION name="login" access="remote" returntype="string" output="false">
<cfargument name="username" type="string" required="Yes">
<cfargument name="password" type="string" required="Yes">
<cfargument name="stayLogged" type="string" required="no" default="no">
    
<CFSET myReturn = {}>
.... sql statements ...
if valid
<cfset myReturn.valid = "true">
<cfset myReturn.fname = #getLogin.fname#>
<cfset myReturn.lname = #getLogin.lname#>
<cfset myReturn.message = "Verified! Logging in....">

if invalid
<cfset myReturn.valid = "false">
<cfset myReturn.fname = "">
<cfset myReturn.lname = "">
<cfset myReturn.message = "Unverified! Please try signing in again.">

<cfset myReturn = serializeJSON(myReturn)>
    
<cfreturn myReturn>
</cffunction>

Ok...what am I doing wrong? :(

Why does IE suck so #$(*# much!? Great error message!



Now if only I can find line #131,265,925 I'd be able to fix it.

I don't have 131k lines of code on this page! How do you diagnose this? None of the available tools out there work well for IE.

Gawd...IE is going to drive me to give up web programming and become a used car salesman.

::: hair pulling :::

Adobe Flex 4 for Coldfusion programmers -- all day training -- Nov. 20 -- San Francisco -- FREE!!

I'm not sure if everyone is aware of the subject of this posting, but if you're not, please visit this url for more information: http://ria.meetup.com/12/calendar/11859336/

If you're in the bay area and want to get your feet wet with Flex this is the place to be.

Hope to see you there!

jquery ajax + xml + IE = hair loss

I've done ajax before with jQuery with good results on all browsers...until

I used an XML return with IE (all IE's that is).

When returning XML from a CFC (or any other server-side script), IE doesn't treat the XML document as, well, XML.

It actually barfs on it unless you tell it to load up the ActiveX control to parse your XML doc. (psst..Thanks Microsoft).

Just look at this:


$.ajax({
type: "POST",
url: "ajaxtest.cfc?method=getallblogs",
data: datastring,
success: function(data) {
var xml;
if ( $.browser.msie ) {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.loadXML(data);
} else {
xml = data;
}
$(xml).find('blog').each(function(){
var id = $(this).attr('id');
var title = $(this).find('name').text();
var url = $(this).find('url').text();
$('<div class="items" id="link_'+id+'"></div>').html('<a href="'+url+'">'+title+'</a>').appendTo('#blogInfo');
});
}
});


See that little blurb in the ajax call for "if ($.browser.msie)"? That's the call you'll need to do to make IE behave like 99% of the other browsers out there.

I've put together a short demo. I know the code is duplicated, but this is for demo purposes. Hope this helps you guys doing XML data returns.

Oh and once again "Thank you Microsoft" for making my web development career such a wild adventure.

XML data return demo

p.s. the data returned is from my blackberry bloggers site. If you're a blackberry fan, check it out (http://www.blackberrybloggers.org). It might look a bit familiar :)

Restaurants + flash website + mobile = FAIL!

When will restaurants realize that full flash websites suck for those of us on the go?


Situation: I'm out with friends wondering where we should go for lunch. Someone says, "Let's try XYZ restaurant". I pull out my blackberry. Other non-descript friends pull out their iPhones and we get to XYZ Restaurant's website. Guess what? It's a FULL FLASH site. None of us can render it and we all groan and go to some other directory like Yelp, CitySearch, menupages..etc.


How do we get the word to web designers/programmers who do restaurant websites that they need to do 2 versions of the website: Mobile and everything else.

SVN/CVS: Any good Commit Comment templates?

We're implementing SVN in our office and well, things are well under way.

However, people are going to start committing their changes in various ways. So reading commits from multiple developers (might) prove to be confusing.

I was playing around with SVN for eclipse and it's got a great feature called, "Commit Templates".

Being new, I created 2 templates for myself and was thinking about making Commit Templates a standard among the developers.

Here's what I made up so far:

=BUG FIX=

Bug Description:

Fix:

Project:


=NEW FEATURE=

Description:

Project:


Again, these are just for me. I was wondering if anyone else has any other templates that you use and like?

Thanks!

jQuery + ajax + logout form

I love jquery! Let me just say that now. I'm a true convert from prototype/scriptaculous. I love prototype for all it's pros. But, I can't deny the support from the jQuery community and the momentum it has in the web world.

With that said, I dove in and started playing around with the jQuery UI plugin (built by the jQuery guys of course). The dialog plug in is simply DOPE!! (is that a youngin' term?)

I was playing around with a logout confirmation dialog and here's what I've come up with. It's a bit verbose for my taste and by NO means the best way to do this. But, I do hope it points people in the right direction if they're looking to do something like this.


$('#logout').click(
        function(e){
        e.preventDefault();
        
$('<div id="confirmLogout" title="Logout?">Are you sure you want to log out?</div>').dialog(
            {
            modal: true,
            height: 100,
            width:350,
            show:"blind",
            hide: "blind",
            buttons:{
                "Yes":function() {
                    $.ajax({
                        url: 'someActionCall.cfm',
                        complete: function() {
                            $('#confirmLogout').html("See you next time!");
                            $('.ui-dialog-buttonpane').css('display','none');
                            var dlg = $("#confirmLogout").parents(".ui-dialog:first");
                            dlg.animate({ width: 200},50);
                            setTimeout(function(){$("#confirmLogout").dialog("close")},3000);
                            setTimeout(function(){location.reload();},1500);    
                            }
                        });
                    },
                "No":function() {
                    $("#confirmLogout").dialog("close");
                    }
            },
            close:function(){
                 $("#confirmLogout").remove();
            }
            });

return false;
    });


The demo can be found here: Logout demo

Internet Explorer 8: Really?..why?

Ok, I just downloaded the latest and greatest Redmond browser. I have to say there are some good things and then of course, there are bad things. It's by far worlds better than IE 6, but it's still....Internet Explorer.

Here's a thought...Why doesn't M$ just stop making IE altogether? Seriously? They've made web development a headache since day one of IE. Tried to gain market share and control how to program for the web. That failed miserably.

Suggestion? Why not have M$ partner with FF to help distribute with their OS? MS won't partner with the other browsers (Safari? ha! Ballmer and Jobs partnering?, Chrome? ha! Didn't Ballmer want to eradicate google from the planet?) Just makes sense to me if M$ and FF partner. We'd be so much better off with web development and "standards" compliance.

Ok..time for me to get off the hookah heheheh

Oh...Bring Down IE6!

Overcoming IE's annoying "click" sounds

I was very intrigued at the new IE 8 so I went and downloaded it and installed it.

After 3mins of using it, I realized, "God this clicking sound with every link click is like a mosquito on your ear while you're trying to sleep". I haven't used IE in MONTHS (if it weren't so damn tied to the WinOS I'd have removed it eons ago), so I've been relieved of it's annoyances.

Then I used the greatest thing since sliced bread, and searched google for "annoying click sounds IE".

Found this: Remove Annoying Clicks IE

Nuff said....

no wait..."DIE IE!!!"

Now...Nuff said..

More Entries

Calendar

NAVIGATION

Recent Entries

Recent Comments

RSS

Search

Subscribe

Tags