DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Ajax & Javascript
Reload this Page Eclipse add \n in my JS files
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Default Eclipse add \n in my JS files - 01-04-2009, 08:40 AM

Hello everyone!

I'm really annoyed about a problem I've been having for a long time. I've been searching and spending lots of hours trying to solve that but nothing.

The problem:

Sometimes, when I write some javascrpit code in eclispe and after that I try to run it on the browser (every browsers) it doesn't run properly, an example:

Code:
function util(){}
function util.alertProblem(problem){
var x = navigator;
alert("La espiral fractal no soporta tu navegador,\n" +
"por favor, para ayudar el buen desarrollo de la web\n" +
"conacta con 'dev@laespiralfractal.es' con el mensage:\n" +
"Problema: " + problem +
"\nDatos de tu navegador:" +
"\nCodeName=" + x.appCodeName +
"\nName=" + x.appName +
"\nVersion=" + x.appVersion +
"\nPlatform=" + x.platform +
"\nUA=" + x.userAgent +
" \n\n ˇˇMUCHAS GRACIAS POR TU COLABORACIÓN!!.");
}
And I try to load the page and firefox gets this error:

Quote:
missing ( before formal parameters
function util.alertProblem(problem){\n
I don't know the reason, sometimes it fixes itself, but I really want to know how not to get that.

Could someone help me?

{SEMI-SOLVED}

I can run properly the script doing it like that:
Code:
var util = {};
util.alertProblem = function(problem)
{
	var x = navigator;
	alert("La espiral fractal no soporta tu navegador,\n" +
	  		"por favor, para ayudar el buen desarrollo de la web\n" +
	  		"conacta con 'dev@laespiralfractal.es' con el mensage:\n" +
	  		"Problema: " + problem + 
	  		"\nDatos de tu navegador:" +
	  		"\nCodeName=" + x.appCodeName +
	  		"\nName=" + x.appName + 
	  		"\nVersion=" + x.appVersion +
	  		"\nPlatform=" + x.platform +
	  		"\nUA=" + x.userAgent + 
	  		" \n\n ˇˇMUCHAS GRACIAS POR TU COLABORACIÓN!!.");
}

Last edited by kalpo; 01-04-2009 at 09:07 AM. Reason: semi.solved
Reply With Quote
Reply

Tags
carriage return, explise, firefox, javascrpit, line feed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up my eclipse project to build a jar file from two jar files powah Java 0 11-13-2008 03:55 PM
Identifying Modified files in eclipse vemuriswayam Eclipse 0 10-17-2008 05:48 AM
Can't receive any PDF files... brendancunnie Ajax & Javascript 2 06-04-2008 01:27 PM
Editing .dox files with HTML code in Eclipse? dangerdg Eclipse 0 05-22-2008 11:48 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com