My first, working, piece of jQuery
This is the first piece of jQuery that I wrote, for production use, that works exactly as I'd like it to. Some code has been changed.
try {
$(document).ready(function(){
$('div#headerLogin')
.prepend($(document.createElement('div'))
.addClass('headerLoggedIn')
.append('Logged in as: <span><cfoutput>#query.displayName#</cfoutput></span> <span><a href="https://words.strivinglife.com/logout/">logout</a></span>')
);
$('div.headerLoggedIn')
.after('<span>Hello<cfif IsDefined("query.first_name") AND Trim(query.first_name) NEQ "">, <cfoutput>#query.first_name#</cfoutput></cfif></span>');
});
} catch (ex) {}
It's for a site that runs ColdFusion, hence the CF tags.
Basically it finds the div with an id of headerLogin and adds to that a new div, with a class and some text. Then additional text is added to that new div.
Pretty simple, but ...
Search
Links of Note
Support This Site
If my blog was helpful to you, then please consider visiting my Amazon Wishlist.