There are times when you'll want to include a file from your server in a page, but don't have access to server-side code like ASP's include directive. For instance, you may be working in pure HTML, and want to include a navigation menu on every page without duplicating it each time. You may be tempted to use an iframe for that, or render it with a javascript function full of document.write statements. Both are options, and have their uses, but jQuery offers another solution: the .load() method. It is very similar to the .get() function, except that it assumes a few defaults, and has an extra option for only inserting a certain part of the returned content.
"Oh, what a tangled web we weave, when first we practice to deceive". [Sir Walter Scott]
jUntangled is a blog about jQuery, HTML and CSS for beginner and intermediate web developers. The aim is to help untangle the web by clearly explaining how to use jQuery as well as some interesting aspects of HTML and CSS, so we can all write clean, untangled code for easy maintenance and a superior user experience.
Friday, February 1, 2013
Friday, January 25, 2013
Internet Explorer's Developer Tools (F12) Overview
Developing a web page is not always a simple matter of creating code on your computer, uploading it to the server and it works. The interaction of your page, CSS stylesheets, javascript code (sometimes yours, sometimes external) and the framework of other files that may wrap around your code often produce odd results that you need to debug within the browser itself to figure out. Until browser-based developer tools like Microsoft's F12 Developer Tools or Firebug came along, all you could do was view the source of your page and stare until you went cross-eyed. Now that these tools exist, by all means use them! I plan to write a series of posts about developer tools, starting with this overview of Microsoft's F12 Developer Tool.
Friday, January 18, 2013
Mixed security pages: How to avoid error messages
Depending on what browser and what version you use, the dialog box will appear differently. The message is still the same though: You're viewing a secure page (https://...) and a warning pops up that there is some insecure content mixed in, asking you what to do about it. It happens on small sites, corporate sites, even banks, social networking and other very large sites that should have the technical know-how not to scare you like that. (This can be especially scary when you get security messages from your bank's website!)
Thursday, January 17, 2013
Submitting Forms: Don't Forget the NAME Attribute...
Just a quick post on something I stumbled across recently... I was submitting a form with several checkboxes and text fields, but no matter what I did on the receiving page, it wasn't getting any values from either POST or GET data. At first I assumed I was doing something wrong in PHP, since I'm new to the language and have been doing forms for many years. It wasn't until I was thoroughly frustrated and finally searched Google for help that I slapped my forehead and had it solved within seconds. Hopefully, I can give you the same head-slapping moment with less frustration.
Subscribe to:
Posts (Atom)