Re: FireFox and IE respond differently to my site.

Discussion in 'HTML' started by zalek, Nov 6, 2007.

  1. zalek

    zalek Guest

    On Nov 5, 10:09 pm, RobG <> wrote:
    > On Nov 6, 12:22 pm, zalek <> 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?

    Thanks,

    Zalek
     
    zalek, Nov 6, 2007
    #1
    1. Advertising

  2. zalek

    Randy Webb Guest

    zalek said the following on 11/5/2007 10:53 PM:
    > On Nov 5, 10:09 pm, RobG <> wrote:
    >> On Nov 6, 12:22 pm, zalek <> 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/
     
    Randy Webb, Nov 6, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Honn
    Replies:
    3
    Views:
    3,307
    Teemu Keiski
    Apr 4, 2005
  2. Christopher Richards
    Replies:
    12
    Views:
    1,054
    neredbojias
    Nov 22, 2004
  3. InfiniteVoid
    Replies:
    3
    Views:
    498
    BootNic
    Mar 26, 2006
  4. usgog
    Replies:
    2
    Views:
    181
  5. zalek
    Replies:
    7
    Views:
    134
    Thomas 'PointedEars' Lahn
    Nov 9, 2007
Loading...

Share This Page