Tag: web development

Confluence: create structure to help new wiki users get started

Once you’ve created a shared online space for your coworkers, you may discover with some frustration that it doesn’t receive the level of interest you are hoping for. One reason for this reluctance to contribute may be lack of structure. Wikis don’t make a lot of assumptions about how you want to structure or navigate through your data, and this lack of structure can be confusing and somewhat intimidating to users, particularly if they aren’t sure where to put their information. This confusion is not limited to non-technical people: I’ve seen IT community sites and wikis lose members largely because of poor planning and navigational cues.

Although theoretically, the ability to add labels or tags to wiki pages eliminates the need to put them in any particular location within the site structure, people still like to know “where they are” within a site because the relationships between documents carries a lot of information about the significance of the document itself. Users need clues as to what else might be there and what to expect when they click to other pages.

Continue reading

Associative Arrays

If you’ve used javascript much, you are probably familiar with arrays. Typically arrays are used to manage lists of items. I frequently use arrays for maintaining information about the state of pages and quiz questions in learning modules, storing a series of properties for each item.

But, there is a problem. To find the particular item you want to use, you must loop through the whole array. Sometimes you can get yourself into a situation requiring multiple loops to get one item of information and performance will suffer.

I recently got to wondering if there weren’t a way to jump straight to the desired item, if the ID of the item were known. Yes there is!

Enter “associative arrays“. Associative arrays allow you to index items by any string key, not just the usual arbitrary index numbers. So you can go straight to the exact item by name without testing for property matches while looping through the array.

Continue reading

Cleaning up and Preventing HTTP Injection Attacks

I recently had the (undesired) opportunity to learn about HTTP and SQL injection attacks. It took a great deal of effort to diagnose and clean up, but hopefully what I learned from the experience may help you prevent these attacks on your own site or clean up after such an attack.

I first found out my site had been compromised because one of the subdomains started displaying “403” errors (permission denied) and one of the users notified me that the site could no longer be reached. At this time, the rest of the site seemed fine, so I had not noticed anything was wrong with it myself.

On examining the subdomain files, it turned out that the .htaccess file had some new directives written into it, which had the effect of blocking all access to the site. When I further examined the file, it appeared that the actual intent had been to redirect only the users that arrived at the site through a search engine, while allowing direct visitors to see the site as usual.

Continue reading

Timing Issues and Javascript

Sometimes, when you use javascript to make a change to some element on a page, you will get a Javascript error along the lines of: “element ‘n’ has no properties.” You check your page, and yes, the element is definitely there, and it is definitely named correctly, and your syntax is definitely correct. So where is the problem?

Well, it may be a timing issue. If your script executes before the element targeted by the script has been rendered, it will not find the element. This can particularly be a problem with frames or iframes. The solution is to move the function call to the bottom of the page, after the element has loaded.

Continue reading

When colspan property doesn’t appear to work in Firefox or Safari

When building web applications I often use display styles to show or hide divs or table rows as needed. On one project, I found that the “colspan” property did not seem to work in Firefox or Safari. This was because I had incorrectly used display:block to style the TR element, instead of display:table-row. A demo is below, and the code follows.

Continue reading