Adding elements to <li>
Hello Everyone :)
I have very annoying problem, that I cant solve. I have a <div> that is generated from dll, to which I do not have access. I need to take content of that <DIV> and rearrange it, for display purposes.
Problem is I am getting some extra characters that ruin the link.
This is the JS that I use:
After second alert in the code, after I added the variable using innerHTML there are some things that were not there before, underlined in red in the image 2:
I have seen somewhere there are problems using innerHTML, but I dont know th eother way of doing it.
Can someone please help me with this issue?
Thank you very much.
As you can see, the browser's parser has added the missing double quotes to wrap your attribute values. Even though some people don't like to use them, strictly speaking they are mandatory. If you don't provide them, the browser will have to add them which might fail terribly (qed).
So you should add those double quotes yourself at the right positions and it should work.
What I see is that in the original link you aren’t putting the attribute values into quotes which confuses the parser if there are spaces, as there are in the onclick event handler.
Thank you so much.
I did not even suspect missing quotes... I thought it is something entirely else!!!
It works now :)
HTML is perfectly fine without, BUT it applies apropriate rules then (like, attribute value ends at the next space character). HTML is made to be extremely forgiving towards errors (unlike XHTML) and thus your assumption on what HTML should do (may) turn out wrong.
|All times are GMT +1. The time now is 10:34 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.