Skip to main content

Posts

Showing posts from 2010

Emulate IE7

Every time browsers upgrade their version, programmer also will face headache on the application compatibility. I got one application that run on IE7 but somehow some customer complained that it won't work on their browser which is IE8. But I found solution , so I posted it here so I don't have to Google every time I forget. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> Put the code inside inside head tag like below: <head><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /></head> I got this from   Introducing IE=EmulateIE7  . Not sure what happen if they upgrade to version 9, but for time being just enjoy.

XSLT Transformation using JQuery

A few weeks ago, I was facing this problem - HTML is not rendering in Chrome and Safari while it works perfectly in Firefox and IE. After did some study and some try and errors at last I got the solution. Using JQuery Transform plugin .But still need to do some changes. Once you downloaded it, open jquery.transform.js. Replace the var safariimportincludefix = function(xObj,rootConfig){} with var safariimportincludefix = function ( xObj , rootConfig ) { var vals = $ . merge ( $ . makeArray ( xObj . getElementsByTagName ( "import" )), $ . makeArray ( xObj . getElementsByTagName ( "include" ))); for ( var x = 0 ; x < vals . length ; x ++ ) { var node = vals [ x ]; $ . ajax ({ passData : { node : node , xObj : xObj , rootConfig : rootConfig }, dataType : "xml" , async : false , url : replaceref ( node . getAttribute ( "href" ), roo

Display special character

I have problem when user key in single quote or double quote in textfield and view it in textfield. I am using jsp where by I put the code like this user input >> display output >> It saved successfully in Oracle database , but problem happen when it want to display in input field. Then I change my code into Yes, it save a day but only for awhile because the user might be key in input such user input >> display output >> See, it cannot read the double quote because it stop at double quote. At last this morning, I found out the solution. public String convSpecialChar ( String htmlString ) { htmlString = htmlString . replaceAll ( "\\&lt;.*?\\&gt;" , "" ); htmlString = htmlString . replaceAll ( "\r" , " " ); htmlString = htmlString . replaceAll ( "\n" , " " ); htmlString = htmlString . replaceAll ( "\"" ,