473,473 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Java Script and Double Quotes

4 New Member
Dear Forum,

First, thanks for reading my Post. So basically I have a Java Script program. To add more to the Data base I can not use " Double Quotes inside the string. How do I work around this irritant and where to I locate the fix. I have done some research about quote blocker script and the use of /" /". But where to exactly place the fix I am unsure..


Thanks, Louis





Thanks, Louis
Oct 16 '07 #1
8 6286
pbmods
5,821 Recognized Expert Expert
Heya, Louis. Welcome to TSDN!

I'm going to go ahead and move this thread to the JavaScript forum, where our resident Experts will be better able to help you out.
Oct 16 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Can you show some code which demonstrates the problem?

If the double quotes are within double quotes, you'll need to escape them:
Expand|Select|Wrap|Line Numbers
  1. "a double quote \" "
Oct 16 '07 #3
MrIT
4 New Member
Can you show some code which demonstrates the problem?

If the double quotes are within double quotes, you'll need to escape them:
Expand|Select|Wrap|Line Numbers
  1. "a double quote \" "




Expand|Select|Wrap|Line Numbers
  1. <script language="javascript"> <!--
  2. //          ligHTCC's Joke Generator  
  3. // copy as you like. But please try to find
  4. // some better jokes (or quotes, or ???'s)
  5. //
  6. //NOTE: each joke is one long string of words with no 
  7. //      linefeeds and enclosed in "-s (There may be no "-s 
  8. //      inside the string)
  9.  

Explain: Would I do the command above only once or each time..?
Would you explain where this would go in the script?


Thanks a lot , Louis
Oct 16 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
Can you show more of the code? For example, some strings and how they are used in the code?
Oct 16 '07 #5
MrIT
4 New Member
Expand|Select|Wrap|Line Numbers
  1. ligHTCC21="My girlfriend told me I should be more affectionate. So I got a second girlfriend.";
  2.  
  3.  
  4. nrOfLines = 69; // total number of jokes.
  5.  
  6. nr = Math.round(0.5+(Math.random()*nrOfLines));
  7.  
  8. self.document.write(eval('ligHTCC'+nr));
  9.  
  10. function dummy() {};
  11.  
  12. function reload() {};
  13.  
  14. // --> </script>
Oct 16 '07 #6
acoder
16,027 Recognized Expert Moderator MVP
Please use code tags when posting code:
[CODE=javascript]
Your JavaScript code here..
[/code]

As an example, see this:
Expand|Select|Wrap|Line Numbers
  1. "My \"girlfriend\" told me..."
Wherever you need to use double quotes within double quotes, escape them in this manner. Alternatively, use single within double and vice versa.
Oct 16 '07 #7
MrIT
4 New Member
acoder,



Thanks..... I appreciate it very much. !!!



Louis
Oct 16 '07 #8
acoder
16,027 Recognized Expert Moderator MVP
No problem, you're welcome.
Oct 17 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: melih.onvural | last post by:
Group, I want to get into a remote server, tail a file, and see if the last line is an error or not. I think that I've figured out how to shell over and tail the file. I have the specific server...
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
3
by: Hans-Dieter Franz | last post by:
Hello, I have a problem with a Java user-defined stored procedure and the "alter sequence" statement. I use DB2 8.1.2 and had the same problem with 8.1.0, but not with 7.*. I get the following...
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
33
by: patrick_woflian | last post by:
hey guys, im just writing a basic calculation at the moment, before building on it for an A-Level piece of work. i can add/divide etc... two numbers together yet i am having a major problem with...
2
by: Curtiosity | last post by:
I have done a create or replace view called creditcard1. If I do a "select * from creditcard1" it retrieves the data just fine. If I try to do a statement where I am listing the column names it...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
2
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
0
by: r035198x | last post by:
Inheritance We have already covered one important concept of object-oriented programming, namely encapsulation, in the previous article. These articles are not articles on object oriented...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.