User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 425,929 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,706 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 4511 | Replies: 2
Reply
Join Date: Dec 2006
Posts: 17
Reputation: pojke is an unknown quantity at this point 
Rep Power: 2
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: 2
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.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:08 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC