Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORDWRAP: This Problem occurs ONLY in FIREFOX:

Status
Not open for further replies.

dododidi

MIS
Mar 11, 2009
2
HI Folks...


WORDWRAP: This Problem occurs ONLY in FIREFOX:

I am attempting to include a JS "wordwraping" script on a site using the <WBR> Tag because CSS3

wordwrap does not yet function in FIREFOX, it works to an extent pretty well, BUT with one major problem.

The script error seems to be dependant upon which <a href I go to, once having clicked on the box(DIV) AND then having pressed the

BACK-BUTTON.

EXAMPLE:-

Please take a look at what I mean, with this sample page that I have written extra for this Forum regarding the problem:

http://www.nigels.de/test.html"][/URL]

the first box(div) leaves a lot of <WBR> tags in there having visited this page and then having pressed the "Back-Button".

It is linked to this HTML:

http://www.nigels.de"][/URL] (my homepage, I do stress that I am not spamming)

but in the second box(div), everything is as it should be after pressing the "Back-Button", there are no

<WBR> tags showing up. it is linked to this HTML :

http://www.nigels.de/new.html"][/URL]

I dont understand too much about JS, so please bear that in mind when you answere.

This is the script that I am using:

Code:
<script type="text/javascript">
 window.onload = function()
            {		
                if (window.attachEvent == undefined)
                {
                    var tag = document.getElementsByTagName("span");
                    for (var i = 0; i < tag.length; i++)
                    {	
                        if (tag.item(i).className == "wordwrap")
                        {
                            var text = tag.item(i).innerHTML;
                            tag.item(i).innerHTML = text.replace(/(.*?)/g, "<wbr />");
                        }
                    }
                }
            }
</script>
</head>

THX
Nigel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top