Results 1 to 10 of 10

Thread: Setting functions to Events in Explorer fails.

  1. #1
    Join Date
    Nov 2008

    Setting functions to Events in Explorer fails.

    The code below is part of a tool tip set of functions. Currently this fails in Explorer as soon as it tries to set the event handlers to an instance of the functions. So in this case "initToolTipElements" is only printed once to the alert box and then the script stops. The code works fine in Firefox.

    This is the doc type to the HTML page.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Failing function.
    function initToolTipElements()
    	var ttEls=document.getElementsByName('toolTip');
    	//Looks like this is only being run once in explorer. 
    	for (i=0;i<=5;i++)
    Can any one tell me where to look for the problem?

  2. #2
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    what kind of elements (what tags) are those with the name="toolTip"?

    On the other hand, your javascript code is embedded or external?

  3. #3
    Join Date
    Nov 2008
    Thanks for responding. I have two tests running. One is what I'm aiming at which is an <area> tag

    <map name="EarthMap_600_imageMap_Map" id="EarthMap_600_imageMap_Map">
         <area shape="rect" coords="70,86,95,103" href="#" alt="BritishColumbia" name="toolTip" toolTip="British Columbia"/>
    and the other is this test that is on line.

    When the mouse is over the blue rectangle it should pop up a simple tool tip.

    Thanks for any help that you can provide.

  4. #4
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    First: the name attribute is not to be used upon all the HTML elements. In fact, for the modern browsers and under the last Doctype versions, there are only several elements which can bear a name (and which are to be found on using DOM getElementsByName() method. <AREA> is not one of them.

    Have you considered the use of the simple HTML attribute TITLE (no javascript code needed)?

  5. #5
    Join Date
    Nov 2008
    Ah I see, OK so is there a getElementsByTitle function in JS? If now how would I go about collecting all the elements with a known title? Would this require a recursive function and go through all tags in the body and collect them?

  6. #6
    Join Date
    Nov 2008
    Is there no more advise on this?

  7. #7
    Join Date
    Jan 2007
    I think he's referring to this

    <Div title="this could be your tool tip">Put your mouse here</Div>

    Put that on a page and see what it does

  8. #8
    Join Date
    Nov 2008
    Thanks, I didn't know about those tool tips how ever that is not what I'm looking for in the final product. I really do need to use JS to get more data into a nicely formated popup that tracks the mouse.

    What I have works, just not in IE, so I gather that I need to find another way to collect the correct tags that will get the popups.

    What I have is a parameter in any given tag that is called toolTip="someName" and I use that property value to display the correct information.

    At the moment I'm looking at writing a recursive function that will search the page for any tab with a toolTip property. Is that the best way to go about doing that? The tag could be a div, an area, or other.

  9. #9
    Join Date
    Nov 2008
    So can you tell me why this recursive function doesn't continue. It only runs down the first branches and stops and does not continue after that.

    function initToolTipRecursive(el)
    	for (i=0;i<el.children.length;i++)

  10. #10
    Join Date
    Nov 2008
    Thanks for the help, here is what I was shooting for and so far it is working on several browsers correctly. It is the map section of the site that now has nice little pop ups to display the clientele in that area.


    If any one sees any problems in any browser please let me know. I don't care about old browsers as any one coming to our site will be on the latest machines and software as a two year old machine is way out of date for us.

Thread Information

Users Browsing this Thread

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

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.19392 seconds
  • Memory Usage 2,945KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (10)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates