Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 2:16 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ]  Bookmark and Share
Author Message
 Post subject: hit unknown error
PostPosted: Wed Dec 26, 2007 10:49 am 
Offline

Joined: Wed Dec 26, 2007 2:30 am
Posts: 4
I had hit by one error in javascript.

I got 5 data which is 326195,A00148,A004\592. When i click on A004\592 the data will automatically change to A004|592. May i know wat the meaning for the "\" in javascript?


Top
 Profile  
 
 Post subject: Re: hit unknown error
PostPosted: Wed Dec 26, 2007 4:13 pm 
Offline
100+ Club
User avatar

Joined: Tue Dec 18, 2007 8:11 am
Posts: 147
Location: Switzerland
hhheng wrote:
I got 5 data which is 326195,A00148,A004\592.
No idea what you are talking about.

hhheng wrote:
May i know wat the meaning for the "" in javascript?
The backslash '\' is normally used to write a String on multiple lines:

Code:
alert('this will work');

Code:
alert('this will
NOT work');

Code:
alert('this however \
will work again');


cheers
- leonard

_________________
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 2:28 am 
Offline

Joined: Wed Dec 26, 2007 2:30 am
Posts: 4
hello leonard
I had try the solution you give me. The \ actually is like a space that can separate two sentences. My question is when i onclick the data which is A004\592. The data will auto change to A004|592 when this data pass through javascript. May I know what the problem I facing now?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 7:40 am 
Offline
100+ Club
User avatar

Joined: Tue Dec 18, 2007 8:11 am
Posts: 147
Location: Switzerland
The description of your problem is too vague.

Please post the code here or give us a link to your problem.

cheers!
- leonard

_________________
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 9:11 am 
Offline

Joined: Wed Dec 26, 2007 2:30 am
Posts: 4
errr. The data i retrieve from database is A004\592. When i choose this data from the table. the data appear as A004|592 . thus my another related become undefined value. Because ' \ ' have a meaning in javascript. my data become undefined value. If i change the data as A004/592 then the data is normal. Sorry i don have image for u.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 10:11 am 
Offline
100+ Club
User avatar

Joined: Tue Dec 18, 2007 8:11 am
Posts: 147
Location: Switzerland
the most easy solution would probably be:
modify your database select-statement so that you replace '\' with '\\'

Your data will then be 'A004\\592' and will be displayed as 'A004\592'

cheers!
- leonard

_________________
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 10:16 am 
Offline
100+ Club
User avatar

Joined: Tue Dec 18, 2007 8:11 am
Posts: 147
Location: Switzerland
the escape codes for a String in JavaScript are:

\b Backspace
\& Ampersand
\f Formfeed
\n New Line
\r Carriage Return
\t Tabulator
\' single quote
\" double quote
\\ Backslash

aparently \5 is somehow substituted by |

_________________
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.


Last edited by leonard on Thu Dec 27, 2007 10:25 am, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 10:22 am 
Offline

Joined: Wed Dec 26, 2007 2:30 am
Posts: 4
Your data will then be 'A004\\592' and will be displayed as 'A004\592'

I already try this method. But still facing the same error.

Anyways thanks. I still looking for solution.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley