3
I have a div
that will serve as a menu.
The problem is I get these weird characters formatting the code and I didn’t put them there:
These characters are not visible by the code, but are visible through the "Inspect Element" of the internet.
I created this FIDDLE to show the error.
HTML/Jquery
<div id="menuOpt" data-theme="c" data-dismissible="false">
<div data-role="header" class="ui-bar-b">
<h1>Opções</h1>
</div>
<div role="main" class="ui-content" data-theme="b">
<button type="button" class="ui-btn-b" ></button>
<button type="button" class="ui-btn-b" ></button>
<button type="button" class="ui-btn-b" ></button>
<button type="button" class="ui-btn-b" ></button>
</div>
</div>
JS referencing the menu
//atribuir largura ao menu das opçoes
$('#menuOpt').css({
'width': nav_width + 'px',
// 'atributo':'Valor',
});
$("#menuOpt").slideToggle("slow");
Question
Why do these characters appear? How do I remove them?
I can’t reproduce. Here it’s right.
– Jorge B.
@Jorgeb. Don’t you see these characters? I’m using google Chrome. Can that be why? I’m finding it weird is that it’s the first time this comes to me and I have much more code
– msm.oliveira
It is your Javascript that is creating the
– Jorge B.
@Jorgeb. how can Javascript be? These are the only references I make to this menu in JS
$('#menuOpt').css({
 'width': nav_width + 'px',
// 'atributo':'Valor',
 });
and$("#menuOpt").slideToggle("slow");
. The rest is HTML and CSS– msm.oliveira
@Jorgeb. If you click to inspect element in that spacing between 4
divs
you can see that in the HTML code. I think this is being implemented purposefully by the codeJS
to create these spacings, because if you look everywhere there are spacings that code is there.– Chun
You copied the code from your site/app and brought the
with you. I keep saying it’s the JS you’re using.– Jorge B.
http://jsfiddle.net/d38a9dhk/1/
– Jorge B.
@Jorgeb. this fiddle works well. But then I don’t understand why it’s the JS is doing this? But if the app step appears again the characters
– msm.oliveira
Look at the JS you are using, you should have one that makes you add it. If you want to put the code.
– Jorge B.
Can you give more information? what application is this, what technology does it use
– Ricardo
That’s all you have Javascript?
– Jorge B.
@Jorgeb. I passed your code once and it didn’t work after refreshing. I tried again, but this time I emptied the cache and made a heavy refresh and already worked and solved. but if I try to do with my code does not. Thank you very much and sorry for the confusion. I will use the fiddle you made available and change it to what I want :P
– msm.oliveira
@msm.oliveira but solved the problem?
– Jorge B.
@Ricardo used Jorgeb. fiddle in my app and only after emptying the cache and doing a heavy refresh did it start working. With my code, it keeps popping up, but I’m gonna change the fiddle that Jorgeb made available to me. I want it. Sorry for the headaches I caused you, but thank you so much for your help
– msm.oliveira
@Jorgeb. solved yes. I just still don’t understand how that piece of JS caused this
– msm.oliveira
@msm.oliveira I don’t know if JS may have been your HTML editor, it may have been a lot.
– Jorge B.
The
is a representation of white space. I did not understand what is the need to delete this, but you can simply delete the empty space and break the line again manually that these elements will disappear.– Ivan Ferrer