[jQuery] Re: problem with spaces between html elements in ie
i got it solved, it wasn't a html problem (creating the same tagcloud statically worked without problems). it was probably a jquery bug related to space trimming, i was using jquery 1.1.3.1, upgrading to 1.2 got it solved. thanks to all. On Sep 13, 12:27 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: Good call on option B Richard, I will second that. On 9/13/07, Richard D. Worth [EMAIL PROTECTED] wrote: I know this doesn't answer the question you're asking, but I wonder if you have/would consider: A. Using css to space each link, instead of the space character - or - B. Using an unordered list of links, and then with css float them in the cloud. Here's a great article that argues for Option B (UL LI A) as more semantic than DIV A, and then goes on to show a way of making the tag cloud accessible: http://24ways.org/2006/marking-up-a-tag-cloud - Richard On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Re: problem with spaces between html elements in ie
yes, i tried that but i need to have breakable spaces so that the text jumps to the next line if there is no enough horizontal space in the div. On Sep 12, 11:46 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: I have you tried appending a nbsp instead of a blank space? I can only imagine the the blank space is being trimmed at some point. On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com
[jQuery] Re: problem with spaces between html elements in ie
I got ya, not terribly sure what to say, do you have a live example we can look at? On 9/13/07, mrsheep [EMAIL PROTECTED] wrote: yes, i tried that but i need to have breakable spaces so that the text jumps to the next line if there is no enough horizontal space in the div. On Sep 12, 11:46 pm, Benjamin Sterling [EMAIL PROTECTED] wrote: I have you tried appending a nbsp instead of a blank space? I can only imagine the the blank space is being trimmed at some point. On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion? -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: problem with spaces between html elements in ie
On Sep 13, 7:16 am, mrsheep [EMAIL PROTECTED] wrote: yes, i tried that but i need to have breakable spaces so that the text jumps to the next line if there is no enough horizontal space in the div. This is a shot in the dark, but have you tried using multiple spaces? It might be that the browser engine then collapses those into a single space. Another kludge might be to use \n instead of a pure space. As a rule, browsers will collapse runs of whitespace to a single space when rendering HTML, but i've never heard of a browser collapsing a single whitespace into nothing (but hey... it's MSIE...).
[jQuery] Re: problem with spaces between html elements in ie
This the unicode for space \u00A0, so maybe: $(#tagcloud).append(newTag).append(\u00A0); document.write('ben\u00A0sterling'); gives me ben sterling, so I can only assume the above would work. On 9/13/07, Stephan Beal [EMAIL PROTECTED] wrote: On Sep 13, 7:16 am, mrsheep [EMAIL PROTECTED] wrote: yes, i tried that but i need to have breakable spaces so that the text jumps to the next line if there is no enough horizontal space in the div. This is a shot in the dark, but have you tried using multiple spaces? It might be that the browser engine then collapses those into a single space. Another kludge might be to use \n instead of a pure space. As a rule, browsers will collapse runs of whitespace to a single space when rendering HTML, but i've never heard of a browser collapsing a single whitespace into nothing (but hey... it's MSIE...). -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: problem with spaces between html elements in ie
I know this doesn't answer the question you're asking, but I wonder if you have/would consider: A. Using css to space each link, instead of the space character - or - B. Using an unordered list of links, and then with css float them in the cloud. Here's a great article that argues for Option B (UL LI A) as more semantic than DIV A, and then goes on to show a way of making the tag cloud accessible: http://24ways.org/2006/marking-up-a-tag-cloud - Richard On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion?
[jQuery] Re: problem with spaces between html elements in ie
Good call on option B Richard, I will second that. On 9/13/07, Richard D. Worth [EMAIL PROTECTED] wrote: I know this doesn't answer the question you're asking, but I wonder if you have/would consider: A. Using css to space each link, instead of the space character - or - B. Using an unordered list of links, and then with css float them in the cloud. Here's a great article that argues for Option B (UL LI A) as more semantic than DIV A, and then goes on to show a way of making the tag cloud accessible: http://24ways.org/2006/marking-up-a-tag-cloud - Richard On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion? -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: problem with spaces between html elements in ie
I have you tried appending a nbsp instead of a blank space? I can only imagine the the blank space is being trimmed at some point. On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion? -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: problem with spaces between html elements in ie
I can only imagine the the blank space is being trimmed at some point. Wow, did I just state the obvious? Sorry, long day :) On 9/12/07, Benjamin Sterling [EMAIL PROTECTED] wrote: I have you tried appending a nbsp instead of a blank space? I can only imagine the the blank space is being trimmed at some point. On 9/12/07, mrsheep [EMAIL PROTECTED] wrote: hi, i'm trying to load tags into a tagcloud dynamically doing something like: ... div id=tagcloud/div tags= [first, second, third]; $.each (tags, function (i, textval) { var newTag= $(a href='#'/a).text(textval).attr (tagId, i); newTag.addClass (tag); $(#tagcloud).append(newTag).append( ); }); and that works fine in ff and opera but in ie (6-7) the tags appear without spaces in between ('firstsecondthird'). any suggestion? -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com