www.webdeveloper.com
Results 1 to 3 of 3

Thread: Cannot 'find' element using GetElementByID

  1. #1
    Join Date
    Dec 2013
    Posts
    1

    Cannot 'find' element using GetElementByID

    Hi,

    Im having difficulties getting html elements with GetElementByID
    it works fine with div "eRule131", but fails for div "elinBanner1", and I dont know why
    what I really want is "grdApproversXML" but cant seem to get that either
    I have tried GetElementByID & GetElementByClassname but no luck

    any ideas?
    Many thanks in advance

    <iframe style="display:none" src="blank.htm" id="eHiddenFrame" name="eHiddenFrame" class="hd" title=""></iframe>

    <div id="eRule131" style="top:73px;left:29px;width:999px;height:18px;z-index:2;overflow:hidden;background-color:#6699CC"></div>
    <div id="elinBanner1" style="top:92px;left:29px;width:999px;height:458px;z-index:3;overflow:hidden;background-color:#DCDCDC"></div>

    <div id="grdApproversContentHolder" style="overflow:auto;width:100%;height:388px">
    <xml id="grdApproversXML">
    <data><row _ID="1" eFolderID="0000000000000000000000000747993" ApproverEMail="BAU RAN Implemetation" ApproverStatus="Approved"/</data>
    </xml>

  2. #2
    Join Date
    Oct 2013
    Posts
    595
    Need a > at the end of your <row> tag to begin with. You may have just not copy/pasted it, but you also need a closing </div> for your opening <div id="grdApproversContentHolder" [blah]> tag. Both are shown in red below:
    Code:
    <div id="grdApproversContentHolder" style="overflow:auto;width:100%;height:388px">
    <xml id="grdApproversXML">
    <data><row _ID="1" eFolderID="0000000000000000000000000747993" ApproverEMail="BAU RAN Implemetation" ApproverStatus="Approved"/></data>
    </xml>
    </div>
    This may or may not fix your problems, but for sure XML will fail on its own if not properly coded.

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,498
    Please wrap your code in forum tags please, it makes reading your code far more simpler.

    HTML Code:
    <iframe style="display:none" src="blank.htm" id="eHiddenFrame" name="eHiddenFrame" class="hd" title=""></iframe>
    
    <div id="eRule131" style="top:73px;left:29px;width:999px;height:18px;z-index:2;overflow:hidden;background-color:#6699CC"></div>
    <div id="elinBanner1" style="top:92px;left:29px;width:999px;height:458px;z-index:3;overflow:hidden;background-color:#DCDCDC"></div>
    
    <div id="grdApproversContentHolder" style="overflow:auto;width:100%;height:388px">
    <xml id="grdApproversXML">
    <data><row _ID="1" eFolderID="0000000000000000000000000747993" ApproverEMail="BAU RAN Implemetation" ApproverStatus="Approved"/</data>
    </xml>
    ================================

    Vs.

    ================================

    <iframe style="display:none" src="blank.htm" id="eHiddenFrame" name="eHiddenFrame" class="hd" title=""></iframe>

    <div id="eRule131" style="top:73px;left:29px;width:999px;height:18px;z-index:2;overflow:hidden;background-color:#6699CC"></div>
    <div id="elinBanner1" style="top:92px;left:29px;width:999px;height:458px;z-index:3;overflow:hidden;background-color:#DCDCDC"></div>

    <div id="grdApproversContentHolder" style="overflow:auto;width:100%;height:388px">
    <xml id="grdApproversXML">
    <data><row _ID="1" eFolderID="0000000000000000000000000747993" ApproverEMail="BAU RAN Implemetation" ApproverStatus="Approved"/</data>
    </xml>

    ================================


    It will also get you a faster response to your problem.

    On the subject of debugging, your web browser is a good tool to use, FireFox and Chrome, can't say anything about others but... F12 key opens up the console, set to all errors and see what it says. It may help you find your code problems faster.

    I have to admit that Chrome is acting strange of late, keeps on complaining about JQuery and I don't use JQuery code at all so IDK quite whats happening and have to fall back to FireFox which is not my second choice, I usually fall back to Opera but I haven't got it installed on this PC It being my first choice of web browser, then Chrome and FF in 3rd place.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

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



Recent Articles