Hello,
I'm trying to write an extension that will copy the data within an
element into a file using
getElementsByName in a firebug extension.
When I'm executing the next code in the firebug console it works fine:
"
alert(document.getElementsByClassName("elementOne")[0].textContent);
"
But when I'm trying to execute it via my extension (this is the full
JS of my extension):
"
FBL.ns(function() { with (FBL) {
function HelloWorldPanel() {}
HelloWorldPanel.prototype = extend(Firebug.Panel,
{
name: "HelloWorld",
title: "Hello World!",
initialize: function() {
Firebug.Panel.initialize.apply(this, arguments);
alert(document.getElementsByClassName("level_green")
[0].textContent); },
});
Firebug.registerPanel(HelloWorldPanel);
}});
"
There is no alert message...
I must say that when I change the extension code from
"document.getElementsByClassName("level_green")[0].textContent"
to "hello"
the alert is popping as it should saying "Hello".
Why is that? What should I do?
P.S. the JS code is based on the HelloWorld example of Jan Odvarko,
www.janodvarko.cz.
--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug