This is a very specific question, so sorry if it sounds repetitive.
I have a block of code that manipulates a WordPress’s “Press This” feature that allows for quick blogging about a remote site, including copying a selection of text.
What I’m wanting to manipulate it to, is to re-blog (with credit) an entire blog post from a wordpress engine site. WordPress.com has this feature built into their site, but if you have your own hosted site, this feature isn’t present.
I have managed to select the correct DIV, along with getting the pop-up to work, however the content isn’t there.
The results from :
y = d.getElementsByClassName('entry'),
is that y = [Object Node List]
z = y.innerHTML,
the result is ‘undefined’
for (var i = 0; i < y.length; ++i) {
z = z + y[i];}
the result is ‘[object HTMLDivElement][object HTMLDivElement]’
(The result is the same as if it pulls from y.innerHTML)
I’ve searched extensively for help, yet can not introduce a solution to the code.
Can anybody help?
Not sure why you put a ‘,’ at the end where a ‘;’ should be
Your problem is that getElement s ByClassName(‘entry’) returns an array of all elements which share the class name ‘entry’;
If you want to access the first you should use
Or you can use for to go through all: