Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7895203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:35:10+00:00 2026-06-03T07:35:10+00:00

below is a java script function and the html for the clicked item that

  • 0

below is a java script function and the html for the clicked item that calls this function. I was able to tell by using alerts that the four values passed into the function are undefined when using firefox, but work when using IE. Please let me know if anyone sees the mistake and how to pass these values in correctly. Thank you.

            function LoadChild(lnEntityID, lnEntityCat, FullExpand, EquipID) {

            document.getElementById('dropTypes').disabled = false;
            document.getElementById('dropTypes').style.background = "white";
            DescStatus = 0;

            alert('lnEntityCat : ' + lnEntityCat);
            if (lnEntityCat == 0) {

                alert('First if is hit');
                PageMethods.LoadChild(lnEntityID, lnEntityCat, GLOBALEQUIPID, FullExpand, 0, 0, 1, LoadChildCallback);

            }
            else if (document.getElementById('img' + lnEntityID + lnEntityCat).canExpand == "true") {
                if (document.getElementById('div' + lnEntityID + lnEntityCat).style.display == 'none') {
                    document.getElementById('div' + lnEntityID + lnEntityCat).style.display = 'block';
                    document.getElementById('img' + lnEntityID + lnEntityCat).src = "../images/minus.gif"

                    PageMethods.LoadChild(lnEntityID, lnEntityCat, GLOBALEQUIPID, FullExpand, 0, 0, 1, LoadChildCallback);

                }
                else {
                    document.getElementById('div' + lnEntityID + lnEntityCat).style.display = 'none';
                    document.getElementById('img' + lnEntityID + lnEntityCat).src = "../images/plus.gif"
                }
            }
        }

Here is the dynamic html which is generated by server side code which generates the item which when clicked,calls loadChild

<img canExpand="true" style="cursor:hand" id="img72635" src="../images/plus.gif" EntityID="726" EntityCat="35" onclick="LoadChild(this.EntityID, this.EntityCat, 0, this.lnEquip);">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:35:11+00:00Added an answer on June 3, 2026 at 7:35 am

    You’re relying on non-standard attributes on the element being reflected as properties on the element object. You can’t reliably, um, rely on that; you need to use getAttribute instead:

    onclick="LoadChild(this.getAttribute('EntityID'), this.getAttribute('EntityCat'), 0, this.getAttribute('lnEquip'));">
    

    (Not quite sure where lnEquip was coming from, I don’t see it in the attributes on the element; if you’re adding it as an expando elsewhere, then remove the getAttribute call from that particular one.)


    Note that using non-standard attributes means your HTML will not validate. You can do this in a conforming way, now, by prefixing those attributes with data- as described in the HTML5 specification. Though that remains invalid in HTML4 and earlier, it works in all browsers, and becomes valid as of HTML5.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML and the java script below to simulate the background
I have this Javascript below using jQuery that shows a div on a page
I am using the below function of javascript to enable and disable the radio
I have Javascript as below: <script type="text/javascript" language="javascript"> function redirectToPrevious(abcURL) { window.location.replace(abcURL); } function
In my HTML file, I have a JavaScript function named CheckCaptcha. I am using
Here is the JavaScript I am using: <script type=text/javascript> $(document).ready(function(){ var left_pos= document.getElementById('login_button').offsetLeft; var
With the script below I append 3 elements when the append button is clicked.
What does the below JavaScript mean? Why is the function embedded inside ()? (function()
Below is the extend function in core javascript. It is same as $.extend() in
I have JavaScript of ajax uploader as below; $(document).ready(function(){ var qwerty = $('#qwerty').val(); $('#demo1').ajaxupload({

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.