13 Replies - 822 Views - Last Post: 20 July 2012 - 06:24 AM

#1 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

document.getElementById() Warning

Posted 17 July 2012 - 06:44 AM

When debugging, I get this warning in Firebug: "Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead."

Since I'm fairly new to this, I'm not sure what is going on and how to fix it. I'm also having issues with the same line causing a "is not a function" error. This is the script with the errors. It is complaining about osmplayer and playlist.xml

 <script type="text/javascript">
            var $jq = jQuery.noConflict();
            $jq(function() {
                $jq("#osmplayer").osmplayer({
                    width: '600px',
                    height: '400px',
                    playlist: 'playlist.xml'
                });
            });
        </script>


Is This A Good Question/Topic? 0
  • +

Replies To: document.getElementById() Warning

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2894
  • View blog
  • Posts: 7,541
  • Joined: 08-June 10

Re: document.getElementById() Warning

Posted 17 July 2012 - 06:45 AM

do you have an ID/name of "jq" anywhere in your document?
Was This Post Helpful? 0
  • +
  • -

#3 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

Re: document.getElementById() Warning

Posted 17 July 2012 - 06:50 AM

I don't think so, I searched for uses. I used noConflict to try to clear up the "not a function" error.
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2894
  • View blog
  • Posts: 7,541
  • Joined: 08-June 10

Re: document.getElementById() Warning

Posted 17 July 2012 - 06:50 AM

which "not a function" error?
Was This Post Helpful? 0
  • +
  • -

#5 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

Re: document.getElementById() Warning

Posted 17 July 2012 - 06:53 AM

Firebug is halting and saying "$jq("#osmplayer").osmplayer is not a function

Line 55" (line 07 here)
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2894
  • View blog
  • Posts: 7,541
  • Joined: 08-June 10

Re: document.getElementById() Warning

Posted 17 July 2012 - 06:54 AM

then you failed to load the osm plugin. either because there is a syntax error in the plugin (improbable) or you just didn’t load the source file. (or the plugin doesn’t work with noconflict jQuery?)

This post has been edited by Dormilich: 17 July 2012 - 06:55 AM

Was This Post Helpful? 0
  • +
  • -

#7 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

Re: document.getElementById() Warning

Posted 17 July 2012 - 07:02 AM

Probably error on my part. All of the plug-in files are in the project, am I running it incorrectly? I am using NetBeans and running as a script in the command line.
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2894
  • View blog
  • Posts: 7,541
  • Joined: 08-June 10

Re: document.getElementById() Warning

Posted 17 July 2012 - 07:07 AM

so you’re not actually parsing HTML?
Was This Post Helpful? 0
  • +
  • -

#9 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

Re: document.getElementById() Warning

Posted 17 July 2012 - 07:40 AM

No, I don't think I am. How should I do that?
Was This Post Helpful? 0
  • +
  • -

#10 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 994
  • View blog
  • Posts: 3,547
  • Joined: 05-June 09

Re: document.getElementById() Warning

Posted 17 July 2012 - 08:34 AM

Use a browser?!
Was This Post Helpful? -1
  • +
  • -

#11 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

Re: document.getElementById() Warning

Posted 17 July 2012 - 08:39 AM

View PostRudiVisser, on 17 July 2012 - 08:34 AM, said:

Use a browser?!


I mentioned I was using Firebug, which is an add-on to Firefox, which is a browser last time I checked. I'm obviously not a web developer so a little help is what I posted for.
Was This Post Helpful? 0
  • +
  • -

#12 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2894
  • View blog
  • Posts: 7,541
  • Joined: 08-June 10

Re: document.getElementById() Warning

Posted 17 July 2012 - 10:53 AM

well, if you say you’re running the JS from CLI and you’re using FireBug via Firefox, that is somewhat confusing to us.
Was This Post Helpful? 0
  • +
  • -

#13 roxya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-March 11

Re: document.getElementById() Warning

Posted 17 July 2012 - 11:16 AM

View PostDormilich, on 17 July 2012 - 10:53 AM, said:

well, if you say you’re running the JS from CLI and you’re using FireBug via Firefox, that is somewhat confusing to us.


On NetBeans, when I press F6/run, it opens the result in a browser. Under the properties, it is set to run as script in command line. Sorry if that was confusing.
Was This Post Helpful? 0
  • +
  • -

#14 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 994
  • View blog
  • Posts: 3,547
  • Joined: 05-June 09

Re: document.getElementById() Warning

Posted 20 July 2012 - 06:24 AM

View Postroxya, on 17 July 2012 - 07:16 PM, said:

On NetBeans, when I press F6/run, it opens the result in a browser. Under the properties, it is set to run as script in command line. Sorry if that was confusing.

It's still confusing, is your code running in the browser or not?

Are you referencing (via the use of a <script .. /> tag) the osmplayer plugin?

Also; There's no need to downvote me, you said you was running it on the command line and your code is obviously not command-line based and should be run in the browser. You can do remote debugging with Firebug so that's not particularly relevant.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1