Wednesday 4 August 2010
Wednesday 28 July 2010
Tuesday 6 July 2010
Exmple - Generate External XML file
// generate caption/subtitle xml file
$doc = new DOMDocument('1.0');
$tt = $doc->appendChild($doc->createElement("tt"));
$head = $tt->appendChild($doc->createElement("head"));
$styling = $head->appendChild($doc->createElement("styling"));
$styling->setAttribute("xmlns:tts", "http://www.w3.org/2006/10/ttaf1#style");
$style = $styling->appendChild($doc->createElement("style"));
$style->setAttribute("xml:id", "s1");
$style->setAttribute("tts:color", "white");
$style->setAttribute("tts:fontFamily", "proportionalSansSerif");
$style->setAttribute("tts:fontSize", "20px");
$style->setAttribute("tts:textAlign", "center");
$body = $tt->appendChild($doc->createElement('body'));
$div = $body->appendChild($doc->createElement('div'));
// save begin, end, style and text
$para = $div->appendChild($doc->createElement('p'));
$para->setAttribute("begin", "1");
$para->setAttribute("end", "5");
$para->setAttribute("style", "s1");
$para->appendChild($doc->createTextNode("Testing par"));
$doc->save($finalDest);
Labels:
XML
Friday 2 July 2010
get url parameter (by specific para name)
get url parameter (For example if the current URL is "...?delete=1&id=testid" then calling getURLParam("id") will return "testid")
http://mattwhite.me/11tmr.nsf/D6Plinks/MWHE-695L9Z
http://mattwhite.me/11tmr.nsf/D6Plinks/MWHE-695L9Z
Labels:
Javascript
Friday 25 June 2010
Bookmaklet overlay javascript
Bookmarklet overlay javascript means put the javascrit into Browser Bookmark which let any website to call that javascript and overlay the current load page.
(Google it if u want to know more)
(Google it if u want to know more)
Labels:
Javascript
Wednesday 9 June 2010
How to detect iPhone/iPad user coming to my site
See -> Miki's comment, Haven't tried it yet. but it works hopefully!
http://www.askdavetaylor.com/detect_apple_iphone_user_web_site_server.html
http://www.askdavetaylor.com/detect_apple_iphone_user_web_site_server.html
Labels:
Javascript
Thursday 25 February 2010
Tuesday 2 February 2010
Friday 29 January 2010
Monday 25 January 2010
Tuesday 19 January 2010
Calling PHP file from javascript
$("#test").load("abc.php");
id test should only use div tag. it doesn't work with span tag.
id test should only use div tag. it doesn't work with span tag.
Labels:
PHP
Thursday 14 January 2010
IE 6 detect with PHP
// IE6 string from user_agent
$ie6 = "MSIE 6.0";
// detect browser
$browser = $_SERVER['HTTP_USER_AGENT'];
// yank the version from the string
$browser = substr("$browser", 25, 8);
// if IE6 set the $alert
if($browser == $ie6){
echo 'yes IE 6';
}
Ref: http://stackoverflow.com/questions/1042176/php-getbrowser-how-to-identify-ie7-versus-ie6
$ie6 = "MSIE 6.0";
// detect browser
$browser = $_SERVER['HTTP_USER_AGENT'];
// yank the version from the string
$browser = substr("$browser", 25, 8);
// if IE6 set the $alert
if($browser == $ie6){
echo 'yes IE 6';
}
Ref: http://stackoverflow.com/questions/1042176/php-getbrowser-how-to-identify-ie7-versus-ie6
Labels:
PHP
Subscribe to:
Posts (Atom)