The web page I need help with is at http://djdavid98.zymichost.com/.bio/
My problem is, as you will be able to see in the source code, I have 2 divs on my page:
(Note the “hu” and “en” attrrubutes, they’re used by JS)
<div hu>
- content -
<table>
<tr><td>- stuff -</td></tr>
</table>
</div>
<div style="display:none;" en>
- content -
<table>
<tr><td>- stuff -</td></tr>
</table>
</div>
Here is the JS I use inc. jQuery:
//readCookie() is a different function for reading a cookie that was set before.
if (readCookie('lang') == "en"){
$('*[hu]').hide()
$('*[en]').show()
}
Accordingly, if the lang cookie is set with the value of en, it will hide anything that has the hu attribute, and will show anything that has the en attribute.
The problem comes in when I check how Google Chrome loads the page content:
(The second div gets appended to the first one, and when the first one gets hidden, the second won’t show either)
<div style="display:none;" hu>
- content -
<table>
<tr><td>- stuff -</td></tr>
</table>
<div en>
- content -
<table>
<tr><td>- stuff -</td></tr>
</table>
</div>
</div>
I tried changing the first div to span, same with the second, but neither solved the merging issue. I’m guessing this has to do something with the tables since other parts of the page is not affected by this problem.
So, how can I fix this?
Note: On the page, you can use the JS console to set cookies, just use createCookie(‘lang’,[‘en’|’hu’],2)
You have not closed the
table-tags in your HTML source – but you have posted it above without errors. Next time please paste the code from your page into a question…view-source:http://djdavid98.zymichost.com/.bio/