Monday, March 30, 2009
A fragment identifier is defined by RFC 3986 as an optional component of a URI reference, and it must conform to a certain syntax. The syntax requires that the fragment identifier be separated from the rest of the URI reference by a # (number sign) character. The separator is not considered part of the fragment identifier.
Basically it looks like http://www.foo.org/foo.html#fragment-identifier.
To use it in Javascript, it is simply "window.location.hash"
Labels: Javascript, Web Programming
This is an imitation of PHP $_GET, in pure Javascript.
From http://www.11tmr.com/11tmr.nsf/D6Plinks/MWHE-695L9Z
function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 )
{
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return unescape(strReturn);
}
Labels: Javascript, Web Programming
Friday, March 20, 2009
網頁瀏覽器: 火狐狸
附件:
- IE Tab
- Firebug
- Multiple IE
(待改)
Labels: 心得
Thursday, March 19, 2009
今天又學到了一個幫助CSS在IE7、IE6和Firefox上都能跑得一樣,但屬旁門左道的小技巧。 只能心裡腹誹IE不遵守規範…
以下例的css作為例子:
.context_bar_form_field
{
height: 15px;
#height: 15px;
_height: 21px;
}
- The first setting will apply to all browsers,
- The second setting will only apply to Microsoft Internet Explorer browsers
- The third setting will only apply to IE browsers 6.0 and older
Labels: CSS, Web Programming, 他奶奶的IE, 心得
Tuesday, March 17, 2009
今天在跟BT Box的網頁頁面的css奮鬥了一整天,一直無法將下拉式選單蓋過其下面的頁面元素。 就在要放棄之餘,突然發現了這篇文章:
http://css-discuss.incutio.com/?page=OverlappingAndZIndex
才知道原來 z-index 是不能亂設的。 譬如說想要一個dd元素可以蓋過別的頁面元素,這個dd元素的母元素盡量不要設z-index, 而只為此dd元素設一個高過想要蓋過的頁面元素的 z-index 的 z-index。 但似乎這個文章所說尚不止如此,得要好好再讀一下。
以前那他媽的知道這種隱藏版規則啊! (翻桌) 唉…
Labels: CSS, Web Programming, Work Stuff, 心得