How to test for an empty javascript object

Hi everybody! I’ve just had a discussion of how to test for an emtpy javascript object. As a result, I have several code snippets and I want to share them with You.

Problem

alert({}==null); // false
alert({}=={}); // false
alert({}=={}); // false
alert({}==0); // false
alert({}==""); // false
alert({}==[]); // false
// etc :)

So, none of the expressions above can check for an empty javascript object.

Read the rest of this entry »

Centering horizontal CSS menu

It’s a real headache to center a fluid block element horizontally with help of CSS. Some time ago I figured out how to center CodeCharge Studio’s CSS Menu because it doesn’t provide this functionality. In general, any block element without the fixed width can be centered with help of this method.

By the way, if You have a fixed width block then You have to set its left and right margins to auto and You get the block centered.

In this article I’m going to explain the method I use to center a fluid block element. Here is the Demo.

Read the rest of this entry »

Setting HTML for WebBrowser in C#

Today I tryed to insert HTML for WebBorwser in C#. I thought it’s a simple task. But when I tryed to use DocumentText property I got “<HTML></HTML>”. Then I tryed Document.Write("...") and I got that Document is null. After these tries I started to find out the easiest way to fill the WebBrowser with HTML without writing to disk and navigating the written file. Here is my code:

WebBrowser browser = new WebBrowser();
 
browser.Navigate("about:blank");
browser.Document.Write("<html><body>...</body></html>");

When the WebBrowser has been made, the Document object is null. So, we should call Navigate() method to get Document available.

If You have Your way to fill the WebBrowser with HTML I’m expecting for Your comments :)

Creating dialog in CodeCharge Studio

first-ccs-dialogThis article provides CodeCharge Studio developers with a truly easy way to create a custom IDE dialog for different purposes. Here You will learn how to extend CodeCharge Studio with Your own dialog. I am going to explain how to create a custom dialog through an example. We will create together a dialog for embedding a Flash movie into the page. See online example to understand what You will be able to do with help of the dialog. Also, here You can download a source code of the dialog and extend Your CodeCharge Studio with it. In addition to downloading a source code You can download a test project that has a page where a Flash Movie embeded by this dialog. So, let’s start!

Read the rest of this entry »

Inline YUI AutoComplete layout

Inline YUI AutoComplete layout Recently, i had a problem with YUI AutoComplete layout. I wanted it being inline, fixed width and working with different browsers like IE6/7/8, Opera, FF etc. There were some problems that i solved primarily in CSS. More precisely, i needed an inline YUI AutoComplete layout in such a way that i can place autocomplete <input> next to the <label> without a line break. I just set my styles in CSS and override some existing styles and it works ok!

So, problems i had to solve for my needs:

  • an outer container is a DIV so INPUT always goes on the next line
  • inline-block for DIV doesn’t work in IE6/7
  • an outer container has width of 100%
  • INPUT is absolutely positioned so an outer DIV is collapsed
  • width of 100% makes INPUT 6px larger then outer DIV in IE6
  • using inline-block, INPUT aligns vertically on the bottom in IE6

Read the rest of this entry »

Welcome to my web development blog!

So, my blog has arrived! Here I’m going to publish some articles about web development, to share my experience and thoughts with others. I hope that it will be the place where You always are able to find something new, useful and helpful. Also, I’m glad to contact with everybody by email if You have some questions or wishes.

Several words about how I create this blog :) After I decided to create an own blog I started to find how I can do it. As I’m familiar with WordPress and it’s very popular and flexible, I chose it. The second question, what theme to use. I wanted something special and unique so I decided to create theme with help of Artisteer. By the way, Artisteer can create themes not only for WordPress but for Blogger, Joomla, Drupal, DotNetNuke and just HTML templates. So, it’s cool!

A good idea + Artisteer = great result!

A couple of hours and theme’s done. And without any coding of XHTML, CSS and PHP. Of course, after generating a theme with help of Artisteer there’s a probability to modify a CSS to satisfy with requirements that couldn’t be done with Artisteer, but as usual it’s few lines of code. Well, i’m not going to stop with this design, but to improve it time to time.

Search
Categories
Other:
Artisteer - CMS Template Generator