Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] Find and Replace
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
[Completed] [ZB] Find and Replace
Tweet Topic Started: Sep 28 2009, 10:21 PM (362 Views)
Flavius Sep 28 2009, 10:21 PM Post #1
Member Avatar


Posts:
283
Group:
Member
Member
#360
Joined:
Jul 29, 2008
Coding language
HTML/CSS
Find a comma within a dd and replace it with a <br> as in place anything after it on a new line.
Posted Image
Offline Profile Goto Top
 
RedBldSandman Sep 29 2009, 02:04 PM Post #2
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Something like this?
Code:
 
$("dd").each( function() {
$(this).html($(this).html().replace(",","<br />"))
})
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Reid Sep 29 2009, 02:58 PM Post #3
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
RedBldSandman
Sep 29 2009, 02:04 PM
Something like this?
Code:
 
$("dd").each( function() {
$(this).html($(this).html().replace(",","<br />"))
})
It would be better to be something like this..
Code:
 
<script type='text/javascript'>
// <![CDATA[
$("dd").each(function(){
$(this).html($(this).html().replace(/,/g, "<br />"));
});
// ]]>
</script>
Your code will only replace one comma - mine will replace all.
The Resource Board
Offline Profile Goto Top
 
RedBldSandman Sep 29 2009, 04:10 PM Post #4
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Oh yeah, didn't think about that :P
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Dorith Oct 22 2009, 07:18 PM Post #5
Member Avatar
Has just entered the Matrix

Posts:
2,069
Group:
Former Staff
Member
#1,854
Joined:
Dec 23, 2008
Is this complete l1r72?
Posted Image
Posted Image
(Made emoticon using Codes Rock's Smiley Generator)
Offline Profile Goto Top
 
Flavius Oct 24 2009, 01:53 AM Post #6
Member Avatar


Posts:
283
Group:
Member
Member
#360
Joined:
Jul 29, 2008
Coding language
HTML/CSS
Yes.
Posted Image
Offline Profile Goto Top
 
Gorgor Oct 24 2009, 11:30 AM Post #7
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
You're welcome.
See? We can read thoughts too. ;)

Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first!

Thanks,
The ZBCode Staff
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Completed Requests · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy