Enter your email address:


feedburner count

window.showModalDialog problem in IE

I'm recently encounter a problem when using showModalDialog in IE. I want to access to parent window, but window was opened by showModaldialog doesn't supply full features like normal window.open method . When using window.open, you have window.opener propery that references to parent window, so you can access all properties / method of parent window. In order to solve this problem, pass window.self second parameter of showModaldialog method. In pop-up dialog, access to parent by dialogArguments object. Follow codes snippet will show you how to display a Modal Window, insert a hyperlink to rich text area , work both on IE and FireFox :

  • In parent page :
function insertHyperLink() {
saveRange();
if (window.showModalDialog)
showModalDialog("insert_link.htm", window.self, "status:false;dialogWidth:312px;dialogHeight:265px");
else {
window.open('insert_link.htm', window, 'width=312, height=265, toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,modal=yes');
}
}
  • In child window :
function insertLink() {
var txtText = document.getElementById('txtText');
var txtUrl = document.getElementById('txtUrl');
var txtToolTip = document.getElementById('txtToolTip');
var ddlTarget = document.getElementById('ddlTarget');
var parent;
parent = (window.opener) ? window.opener : dialogArguments;
var url = '' + txtText.value + '';
parent.insertHTML(url);
}




Viet Nam become siliconvalley ?

The techies from Vietnam and Silicon Valley came together in pursuit of an ambitious goal: Helping their homeland become the next India of the high-tech world.

Nobody is expecting Vietnam to become the world's primary software outsourcing destination anytime soon. But a fledgling software industry is taking root here, and Vietnamese from both sides of the Pacific are determined to nurture it.

In pursuit of that goal, about 15 technology-industry executives, many of them Vietnamese-American, came to Ho Chi Minh City recently for a forum with their counterparts in Vietnam, many of whom are Vietnamese-Americans who moved back here to go into business.

``I'm asking you to champion our cause and build a bridge between Vietnam and Silicon Valley so that our industry can grow,'' said Thinh Nguyen, a forum organizer whose firm, Pyramid Software Development, has its headquarters in Fremont but employs nearly all of its 40 engineers in Vietnam.

Organized by the Vietnamese Silicon Valley Network and the American Chamber of Commerce in Ho Chi Minh City, the forum is one of many recent indicators suggesting that Vietnam is gaining increasing attention as a potential software outsourcing destination.

Ho Chi Minh City now has some 650 software companies, mostly small, that collectively employ 20,000 people. A handful do low-cost outsourcing for Citibank, IBM, Microsoft, Merrill Lynch, Lucent Technologies, the Hilton Corp. and Novellus.

IDG, the U.S. technology publishing company, recently established a $100 million venture-capital fund to nurture Vietnamese tech companies. Meanwhile, Vietnam's national government has approved tax breaks for high-tech firms and mapped out ambitious goals for training software engineers.

``Things are on the move,'' said Seth Winnick, the U.S. consul-general in Ho Chi Minh City, speaking at a recent forum. ``We have a sector here that is on the verge of a takeoff.''

Daunting challenges

Vietnam's software pioneers are daunted by the challenges -- a dearth of experienced managers, a mediocre education system, an improving but still inadequate infrastructure, a poorly developed legal system and a slow-moving bureaucracy.

But they are buoyed by the opportunities. A flood of bright young Vietnamese are entering the workforce each year, eager to make their mark in the technology world.

Among those who believe that the sector's prospects are bright is Kevin Nguyen, chief marketing officer and co-founder of Global CyberSoft, a Santa Clara-based firm with more than 400 engineers working in Ho Chi Minh City.

The company's slogan: ``IT outsourcing is our passion.''

``Customers, especially in Japan, are starting to look at Vietnam as an alternative to India and China,'' said Nguyen, whose firm has roughly doubled in size each year since its founding in 2000. ``They don't want to put all their eggs in one basket.''

Like Global CyberSoft, many of the leading software outsourcing firms with operations in Vietnam have close ties to California. Among them are Sacramento-based ATVN and Glass Egg Digital, a gaming software firm whose founder, Phil Tran, came to Vietnam from Oakland.

Tran thinks China, not Vietnam, will become the next India. But he does believe that outsourcing can flourish here.

``To stay competitive, Vietnamese companies should try to be highly specialized,'' said Tran, 41, whose clients include Microsoft and Atari. ``We can compete well in the lower-volume, higher-value market segment.''

Firms that have ties to the West have an edge over those that don't.

``You must understand the customer culture,'' said Nguyen Huu Le, chairman of TMA Solutions, Vietnam's biggest software outsourcing firm. ``You need to understand their needs and their language.''

Over and over, software executives here extol Vietnamese engineers as smart, determined and loyal. Nevertheless, many American companies remain hesitant about tapping Vietnam.

They feel more comfortable sending programming work to India, which has a longer track record in outsourcing.

``India is still the destination of choice,'' said Hung Truong, who works at Lucent Technologies' Sunnyvale lab. ``It was an uphill battle for me to sell Vietnam to my executives.''

Selling the idea required reassuring his colleagues that ``offshoring'' the work, as Hung prefers to call it, would not mean cutting jobs at Lucent. And he had to persuade his bosses that Vietnamese engineers were up to the job.

Of course, Vietnamese professionals can be hired for a fraction of what their American or Indian counterparts earn. The engineer who commands a $100,000 salary in the U.S. earns about $60,000 in India, $30,000 in China and $20,000 in Vietnam.

But most of the Vietnamese engineers require intensive training before they can do the job. Vietnam lacks the network of top-flight technology universities that has trained much of India's computer workforce.

Intensive training

Duytan Tran, president of Silicon Design Solutions, a Milpitas chip-design firm, put each of the 80 engineers who work at the company's Ho Chi Minh City operation through two years of intensive training.

``We had to invest a lot in training,'' Tran said. ``But we've done very well. We were pretty much profitable from Day One.''

Many of the software firms locating in Vietnam are setting up shop in technology parks such as the Ho Chi Minh City Software City, where 63 companies now employ 3,300 workers. A half-dozen new buildings are being erected at the site, including a seven-story tower that will be occupied by a Silicon Valley firm that officials would not yet name.

The park is home to several software programming training centers, including the Cisco Academy, where students learn to use the company's networking software.

On the outskirts of the city, a difficult commute from downtown, the park nevertheless drew Frank Schellenberg because of its low rents and generous tax incentives.

Schellenberg's firm, GHP, digitalizes documents for firms in his homeland, Germany. Among other things, the 25 software designers at his firm enter sports results into computers and design sports pages for German newspapers.

The time difference between Asia and Europe allows the Vietnamese workers to do the job during the day and transmit the pages in time for the next morning's paper. The newspapers save by eliminating a night shift.

Schellenberg pays his page designers $150 to $200 a month -- roughly a designer's daily pay in Germany.

``It works well,'' he said. ``Everybody wants to outsource.''

Source : Siliconvalley





Finally, I was on top 5 MCP Hall of Fame !





I will be on until middle of august. Vote for me. Thanks.

Note : this competition is just only for MCps who meet requirement from Microsoft. Entrants may enter the contest by fully completing and submitting the nomination form online at www.windowsitpro.com/MCPhalloffame once per month throughout the duration of the contest. And Nominee don't need to describe all true about real life, you can write , brag to attract people vote for you.





Refactory my WYSIWYG html editor



I'm currently rewritting my WYSIWYG html editor that I developed last year for my V-CMS (Viet Nam Content Management System) to support more browsers (Mozilla base, fire fox. Many things must rewrite to support mozilla DOM api, since the new Mozilla Rich Text Editing API have differed from Microsoft one, these are some note when porting app from IE to Mozilla:

  1. Using document.getElementById('element') instead of document.all.element. You must make sure that all your elements have a "id" attribute.
  2. You can't use directly the focus() method for IFrame on Mozilla the same as on IE:
    • In IE : iframe.focus()
    • In Mozilla : document.getElementById("iframe").contentWindow.focus()

  3. document.designMode should be in onLoad() event of body tag rather than in script section in head tag.
  4. You can access document object in IE like this iframe.document, but not the same in Mozilla , you must use document.getElementById("iframename").contentWindow.document
  5. Use Title= attribute to supply Tooltip in both IE and Mozilla.
  6. The command "createlink" does not support displaying a user interface. In order to do that, you can use this code fragment :
    var szURL = prompt("Enter the URL", "");
    .
    .
    .
    getDocument().execCommand('createlink',false,szURL);
  7. When using "formatblock" for execCommand , you can't use "Preformatted", "Normal", "Heading 1", "Heading 2", "Heading 3"... in Mozilla , look at this convertion table:

    Localized Version Equivalent
    Normal

    <P>

    Heading 1

    <H1>

    Heading 2

    <H2>


    Heading 3

    <H3>


    Heading 4

    <H4>


    Heading 5
    <H5>

    Heading 6
    <H6>

    Paragraph

    <P>




  8. The backcolor option to execCommand behaves differently on Mozilla than on IE. Use hilitecolor in Mozilla instead of backcolor. This change take me a lot of time to figure out.

  9. Switching between Design and Source mode :
    • From Source to Design :
      • In IE :
        iText = getDocument().body.innerText;
        getDocument().body.innerHTML = iText;
      • In Mozilla :
        var html = getDocument().body.ownerDocument.createRange();
        html.selectNodeContents(getDocument().body);
        getDocument().body.innerHTML = html.toString();

    • From Design to Source :
      • In IE :
        iHTML = getDocument().body.innerHTML;
        getDocument().body.innerText = iHTML;
      • In Mozilla :
        var html = document.createTextNode(getDocument().body.innerHTML);
        getDocument().body.innerHTML = "";
        getDocument().body.appendChild(html);






Google Earth – Explore, Search and Discover

Want to know more about a specific location? Dive right in -- Google Earth combines satellite imagery, maps and the power of Google Search to put the world's geographic information at your fingertips.
*Fly from space to your neighborhood. Type in an address and zoom right in.
*Search for schools, parks, restaurants, and hotels. Get driving directions.
*Tilt and rotate the view to see 3D terrain and buildings.
*Save and share your searches and favorites. Even add your own annotations.
Head to Google earth and try yourself