405 - HTTP verb used to access this page is not allowed

Yesterday, I've encountered this error "server error:405 - HTTP verb used to access this page is not allowed" when I call "http://www.ppshein.net/test.html" HTTP GET from my android program. I'm confused why I got this error even I've tried following url in my desktop browser is fine. Thus I was googling and find how to solve it. After few minutes, I've found answer how to solve this problem. It's quite simple that change file extension to ".cfm" instead of ".html". It's because of web server doesn't let any request containing POST/GET method to any static page called ".html, .htm", will return such following error called "405".

Thanks god that I've got new experience.

One of my favourite changelogs in Firefox

I cannot say what I found in Firefox 4 aren't cool enough but they're awesome. Because of those, I cannot write that much coding for my projects when I push my clients to use Firefox 4 as our project default browser. Don't look at those new changelogs first. Just look GUI of Firefox4. I can feel it's cool because they can screw the layout of menu toolbar and the obvious button for previous browsing history. Another one is saving password. I can obviously see the message box after I typing password into my blog, email or etc.

Ok, here is one of my changelogs of Firefox4 for me.

  • Javascript Alert Box
  • Javascript Prompt Box
  • Javascript Confirm Box

[More]

To save data into localStorage when Offline

Today I've found how to save the information of your data when offline (when your internet connection is disconnect). That's same as when Google email work. It's very useful to use because our submitted data is sometimes lost when our connection is disconnect or offline. Using this feature in HTML5 can prevent these bad situation. The important part is we need to check whether our browser can support "localStorage" or not. If not support, cannot develop anymore. If support, let's go.

First of all, we need to create manifest file for "localStorage". It's the main part to let browser know our application will be using "localStorage". So, we need to add all of files name we will be using into this manifest file as follow. Current my simple application, I've used 2 files called index.html and lc.js. So, I need to add as follow

view plain print about
1CACHE MANIFEST
2index.html
3lc.js

Now I need to let our clients know he/she is now online or office with following javascript.

view plain print about
1navigator.onLine ? "online" :"offline"

After that, I need to create index.html file. As HTML5 standard, I need to follow the rule of HTML5.

view plain print about
1<!DOCTYPE HTML>
2<html manifest="/loc.manifest">

[More]

Change default submit action with Javascript

We have one issue to solve the bugs come back by clients yesterday. The problem is when our client change quantity in input box of the item and press enter, this item is oddly disappeared from the main screen. So, I need to troubleshoot this issue and read through this code again. Obviously, I found that there are two submit buttons in this found.

If there are two submit buttons in a form, do you know which submit button will work when we press enter?

view plain print about
1<form name="frmDoubleSubmit" method="post" action="index.cfm">
2    <input type="Text" name="txtName"><br>
3    <input type="Submit" name="btnDelete" value="Delete">
4    <input type="Submit" name="btnSave" value="Save">    
5</form>

[More]

DOCTYPE Declaration for CSS

Before time, I didn't notice doctype declaration at the top of every pages and I don't either know how does it work. Yesterday, I created a new style sheet about change button style when mouse-over. As you know, it's very simple to do for developers and don't need to create much coding for it. After creating and then I tested, it doesn't work. I bet all are correct in my style. Here is stylesheet.

view plain print about
1/* button style */
2    .button
3    {
4        color: #feeef5;
5        border: solid 1px #d2729e;
6        background: #f895c2;
7        font: 14px/100% Arial, Helvetica, sans-serif;
8        padding: .5em 2em .55em;
9    }
10    
11    .button:hover
12    {
13        background: #f90442;
14        text-decoration: none;
15    }
16    .button:active
17    {
18     color: #f3c3d9;
19    }

[More]

Create gradient button with CSS

It's great that we can create gradient button with only CSS. We don't need any background image for creating gradient button anymore.

view plain print about
1/* it's just to create gradient button */
2
3.button {
4 display: inline-block;
5 outline: none;
6 cursor: pointer;
7 text-align: center;
8 text-decoration: none;
9 font: 14px/100% Arial, Helvetica, sans-serif;
10 padding: .5em 2em .55em;
11 text-shadow: 0 1px 1px rgba(0,0,0,.3);
12 -webkit-border-radius: .5em;
13 -moz-border-radius: .5em;
14 border-radius: .5em;
15 -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
16 -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
17 box-shadow: 0 1px 2px rgba(0,0,0,.2);
18}
19.button:hover {
20 text-decoration: none;
21}
22.button:active {
23 position: relative;
24 top: 1px;
25}
view plain print about
1/* it's just to create color manipluation */
2
3.orange {
4 color: #fef4e9;
5 border: solid 1px #da7c0c;
6 background: #f78d1d;
7 background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
8 background: -moz-linear-gradient(top, #faa51a, #f47a20);
9 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
10}
11.orange:hover {
12 background: #f47c20;
13 background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
14 background: -moz-linear-gradient(top, #f88e11, #f06015);
15 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
16}
17.orange:active {
18 color: #fcd3a5;
19 background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
20 background: -moz-linear-gradient(top, #f47a20, #faa51a);
21 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a');
22}

view plain print about
1<!--- usage --->
2<input class="button pink" type="button" value="Submit" />

Very thanks to : http://www.webdesignerwall.com/tutorials/css3-gradient-buttons/

Rounded Corner for IE

If you want to make rounded corner box for everything, you may use integrating with images and css. Unless, For firefox, you can set border-radius by prefixing "-moz" to the css property. And ofcource for webkit use "-webkit. For IE, border-radius doesn't work on it. That's why we need to integrate images and css for doing rounded corner. If you're sick of doing so, you can use following coding:

CSS

view plain print about
1.curved {
2    padding:4px 0px 0px 0px;
3    width:80px;
4    height:20px;
5    border:#666666 solid 1px;
6    color:#000000;
7    text-align:center;
8    -moz-border-radius:20px;
9    -webkit-border-radius:10px;
10    behavior:url(border-radius.htc);
11}

The HTML:

view plain print about
1<div class="curved">rouneded div</div>

Best Credit to : http://www.htmlremix.com/files/20080924-border-radius.zip

Embedding windows media player WMV

I'm now creating misspeople2008 section for www.people.com.mm. In these days, I need to do one video file into index page. First of all, I was thinking about how about embed flv player into my site. But, it's problem that my server hasn't installed Flash Player Server. That's why I decided to use with window media player. Blow is coding how to embed Video Player in HTML Page.

view plain print about
1<invalidTag
2     id="MediaPlayer"
3    width=253
4    height=204
5    classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
6    standby="Loading Windows Media Player components..."
7    type="application/x-oleobject"
8    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

9     <param name="filename" value="URL File">
10     <param name="Showcontrols" value="True">
11     <param name="autoStart" value="True">
12     <invalidTag
13         type="application/x-mplayer2"
14        src="URL File"
15        name="MediaPlayer"
16        width=253
17        height=204>
</embed>
18 </object>

How? It's easy, isn't it?

Access the value in frame

In my project, I need to access some value in top frame from my current working frame which is below of top frame. I was dilemma when I encounter this problem. Finally, I gotcha how to access.

Here you go,

view plain print about
1window.frames['frame_name'].document.form_name.input_field_name.value

Remove spacing in textarea

It's simple problem for web developers. Sometimes, such problem make us to stop our progress by finding how to solve these problems. This problem is, when we cursor in our textarea box, this cursor isn't arrived to left align, it stays at center or somewhere else when we create our textarea box as so:

view plain print about
1<textarea name="mytextarea">
2Here is Value....
3</textarea>
But, how to solve this problem is kinda simple. Just do so.
view plain print about
1<textarea>Here is value</textarea>
How? It's simple, isn't it?

More Entries

Top of Page