Results 1 to 4 of 4

Thread: Old code, new developer

  1. #1
    Join Date
    Dec 2008

    Old code, new developer

    Hi -- I'm taking over an old assignment from someone who left.

    I have a field that is being populated from a list of cities which doesn't activate until the user selects a state (context-sensitive drop down list).

    So, this is throwing the following errors in Firebug:

    1. + element is null
    (?)()()carbon_calc.js (line 397)
    item_disable(select#state.third)carbon_calc.js (line 379)
    (?)()()carbon_calc.js (line 480)
    [Break on this error] element.addClass('disabled');
    carbon_calc.js (line 397)

    2. + Ajax is not defined
    loadCity(select#state.third, 1)carbon_calc.php (line 1462)
    onchange(change )u6YUL3F1...GvA%3D%3D (line 2)
    [Break on this error] new Ajax('http://www.wwfmaps.org/CC/we...es
    /ws_city_search.php', { // url to post

    So, I decided to just go back to the beginning of the function in error # 1 and start interpreting what the code does.

    However, I encounter something called getTag(), which I am not familiar with. I have search on this forum and also on Google but can't seem to find out what this does. It would seem to be something fairly straightfoward, but yet can't seem to find it. Does anyone know what it is?

    This is the code at the beginning of the function:

    function item_disable(element)

    // define el variable
    var el;

    if(element.getTag() == 'select')
    el = element.id;

  2. #2
    Join Date
    Dec 2008
    the URL for my application is: http://www.wwfmaps.org/CC/carbon_calc.php

    Click [Full Diagnostic], then put a fake e-mail, then [Start Test], then choose a state.

  3. #3
    Join Date
    Jul 2003
    The City of Roses
    Just by looking at your post, I'd assume "getTag()" is a method the former programmer wrote for the DOM Element class to get the tag name of that element as a string -- such as "div", "p" or "select".

  4. #4
    Join Date
    Oct 2008
    getTag is defined in mootools.js. I'd take a look at that and see if you can figure it out. I didn't bother because of the formatting stripped from it. Theres a note from the author in the file, maybe his website provides some documentation.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center