RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 5151 | Replies: 2 | Thread Tools  Display Modes
Reply
Join Date: Dec 2006
Posts: 17
Reputation: pojke is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
pojke pojke is offline Offline
Newbie Poster

Java Script new line

  #1  
Feb 5th, 2007
Hi.
Perhaps a lot of you heart this problem, but i can't find a solution.
Java Script is crashing when see \n sign.
I have a lot of functions like this:
  1. function drawDocumentMainRowColor1(unique, content, align, padding, color) {
  2. drawDocumentHTML += '<tr class="stdTab" bgcolor="#' + color + '"><td>&nbsp;</td><td style="padding: ' + padding + 'px 10px;" colspan="2" align="' + align + '">' + content + '</td></tr>';
  3. }

..where content is any string. Now if in string appear \n or \r sign page is dead. (JS error)

T U for any help
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Location: India
Posts: 28
Reputation: bhuvan83 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bhuvan83's Avatar
bhuvan83 bhuvan83 is offline Offline
Light Poster

Re: Java Script new line

  #2  
Mar 13th, 2007
instead of \n use document.write("<br />"
c if it works
Bhuvan Aggarwal
There is no word impossible.
its i m possible
Reply With Quote  
Join Date: Dec 2006
Posts: 17
Reputation: pojke is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
pojke pojke is offline Offline
Newbie Poster

Re: Java Script new line

  #3  
Mar 13th, 2007
It wont work so easy, cause content is from form. Its user, who write a content, so i cant request writing <br> instead \n.
But its ok, ive solved it in another way.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:08 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC