You are here: Re: FireFox and IE respond differently to my site. « HTML « IT news, forums, messages
Re: FireFox and IE respond differently to my site.

Posted by Randy Webb on 11/06/07 05:01

zalek said the following on 11/5/2007 10:53 PM:
> On Nov 5, 10:09 pm, RobG <rg...@iinet.net.au> wrote:
>> On Nov 6, 12:22 pm, zalek <zalekbl...@hotmail.com> wrote:
>>
>>> Here is my site:http://www.geocities.com/zalekbloom/a2.html
>> The rubbished added by your host inserts scripts that cause errors in
>> Firefox, and they make your page invalid HTML.
>>
>>> When I open this site with FireFox - Select fields "Date from (yyyyy/
>>> mm/dd)" and "Date to (yyyyy/mm/dd)" are not initialized, but they are
>>> initialized when I open this site with IE.
>>> The code that is not working in FireFox but working in IE is:
>>> var option0 = new Option(curr_year,curr_year) ;
>>> document.form1.f_from_yyyy.add(option0) ;
>> You are mixing DOM 0 (new Option) and DOM 1 (add method) and Firefox
>> doesn't like it. Instead, use just DOM 0 (wrapped for posting):
>>
>> var sel = document.form1.f_from_yyyy;
>> if (sel) {
>> sel.options[sel.options.length] =
>> new Option(curr_year, curr_year);
>> }
>>
>> --
>> Rob
>
> Thanks Rob,
>
> It worked!
>
> Now another question - I want to display a date on a page.
> I used command:
>
> document.write(....)
>
> but after I put this code in function that starts "onLoad" - this code
> is not working.
> So how to display a date, or other string built by a function?

You use something like DynWrite that is in the group FAQ. If you use
document.write after the page has loaded then it replaces the current
page with a new one.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация