...

View Full Version : Quotation marks



Partizan
02-17-2009, 08:30 PM
Any way I can use something that looks like " marks to replace 's in this code?

So in other words, 'Vote of Confidence' would look like "Vote of Confidence".

I have noticed before that there are different types of ", for example if copied in from MS word. So is there any trick people use or must I restort to the plain ' ?




<script type="text/javascript">
<!--

var img = new Array();
var caption = new Array();

var path = "http://www.minifigtimes.com/"

img[0] = path + "images-2009/news/2009-02-14-p1.png"
caption[0] = "LFC have given Marco Van Basten the dreaded 'Vote of Confidence' making the under-fire manager the number one favourite to be the next Serie A boss to be shown the door. Van Basten told The Minifig Times that reports LFC had already lined up Francesco Pedone as his successor were 'unsettling the team'.";

mike182uk
02-17-2009, 08:49 PM
hey

this is more of a javascript syntax question.

check out:

http://www.w3schools.com/jS/js_special_characters.asp

see if thats what your after.

use \" were you want the quotes in the string.

so \"Vote of Confidence\"

Excavator
02-17-2009, 08:49 PM
Hello Partizan,
Is this what your looking for? Does this work in js?

&quot;Vote of Confidence&quot;

jerry62704
02-17-2009, 08:50 PM
I believe you can use what you have and just escape the code (\").

Partizan
02-17-2009, 09:05 PM
Thanks all!

Yes the \" works a treat :)

&quot; doesn't appear to work in js but I will remember it for possible use use elsewhere...

BTW can you tell me if its wrong to copy and paste names such as Milošević straight into a document. After I save my pages it seems they are automatically converted or droped. E.g Milošević becomes
Miloševic.. my question is simply whether I should not be using special characters or is it ok as I have specified:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

effpeetee
02-17-2009, 09:09 PM
I think it is down to the language code that you select.

Frank

mike182uk
02-17-2009, 09:12 PM
Thanks all!

Yes the \" works a treat :)

&quot; doesn't appear to work in js but I will remember it for possible use use elsewhere...

BTW can you tell me if its wrong to copy and paste names such as Milošević straight into a document. After I save my pages it seems they are automatically converted or droped. E.g Milošević becomes Miloševic... my question is simply whether I should not be using special characters or is it ok as I have specified:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


its always going to be best to use special charcters because js will reserve certain charcters for its own functionality, just like the ".
and so will other languages. sometimes browsers wont even bother to render the charcters if you have not used the special charcter. its good practice to use the special charcters, then theres no confusing when it comes to what should be displayed. (and not just guessing at what the browser is going to do)

Partizan
02-17-2009, 09:15 PM
I see but what if you are using characters from many languages that have unique characters such as Danish or Serb..

Do I need to change the lang to a list of languages?


<html lang="en, dk, gr"> ?

effpeetee
02-17-2009, 09:22 PM
This site (http://unicode.org/charts/)may be of assistance. The Unicode Character Code Charts By Script
Also this one. (http://www.w3.org/International/tutorials/tutorial-char-enc/) Tutorial: Character sets & encodings in XHTML, HTML and CSS

Frank

mike182uk
02-17-2009, 09:22 PM
The HTML lang attribute can be used to declare the language of a Web page or a portion of a Web page. This is meant to assist search engines and browsers.


check out these urls on special charcters:

http://www.w3schools.com/tags/ref_language_codes.asp

http://www.w3schools.com/tags/ref_charactersets.asp

http://www.w3schools.com/tags/ref_ascii.asp

i wouldnt of thought the lang attribute would provide information to the browser about how the charcters need rendering.

Partizan
02-17-2009, 09:37 PM
Thanks! I'll check these links out :)

VIPStephan
02-17-2009, 11:29 PM
I would suggest the use of so-called smart quotes (http://en.wikipedia.org/wiki/Quotation_mark_glyphs#Quotation_marks_in_English) (a. k. a. curved quotes) for regular text.

Apostropartheid
02-17-2009, 11:32 PM
I wouldn't do that. Instead, use a span element and set the language on that.
For example:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Good morning. <span class="la">civis Britanniae sum.</span></p>
</body>
</html>

mike182uk
02-17-2009, 11:53 PM
I wouldn't do that. Instead, use a span element and set the language on that.
For example:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Good morning. <span class="la">civis Britanniae sum.</span></p>
</body>
</html>

would that tell the browser how to render the charcters visually?

Apostropartheid
02-18-2009, 04:20 AM
No, it just gives the element's appropriate language. This can be quite useful if you're bilingual and regularly write in both. For web work, UTF-8 is highly recommended for maximum compatibility with other languages. ISO 8859-1 & -15 are very limited and don't support a full range of characters from the vast majority of alphabets. Seeing as you're including these types of characters, I would advise you to switch over.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum