Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15

Thread: Quotation marks

  1. #1
    Regular Coder Partizan's Avatar
    Join Date
    Dec 2008
    Location
    Legoland and Ireland
    Posts
    139
    Thanks
    74
    Thanked 0 Times in 0 Posts

    Quotation marks

    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 ' ?


    PHP Code:
    <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'."

  • #2
    Regular Coder
    Join Date
    May 2008
    Posts
    135
    Thanks
    13
    Thanked 10 Times in 10 Posts
    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\"

  • Users who have thanked mike182uk for this post:

    Partizan (02-17-2009)

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello Partizan,
    Is this what your looking for? Does this work in js?
    Code:
    &quot;Vote of Confidence&quot;
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    Partizan (02-17-2009)

  • #4
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    I believe you can use what you have and just escape the code (\").
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • Users who have thanked jerry62704 for this post:

    Partizan (02-17-2009)

  • #5
    Regular Coder Partizan's Avatar
    Join Date
    Dec 2008
    Location
    Legoland and Ireland
    Posts
    139
    Thanks
    74
    Thanked 0 Times in 0 Posts
    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
    PHP Code:
    Milo&#353;evic 
    .. my question is simply whether I should not be using special characters or is it ok as I have specified:
    PHP Code:
    <!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"

  • #6
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    I think it is down to the language code that you select.

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • Users who have thanked effpeetee for this post:

    Partizan (02-17-2009)

  • #7
    Regular Coder
    Join Date
    May 2008
    Posts
    135
    Thanks
    13
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by Partizan View Post
    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:
    PHP Code:
    <!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)

  • Users who have thanked mike182uk for this post:

    Partizan (02-17-2009)

  • #8
    Regular Coder Partizan's Avatar
    Join Date
    Dec 2008
    Location
    Legoland and Ireland
    Posts
    139
    Thanks
    74
    Thanked 0 Times in 0 Posts
    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?

    PHP Code:
    <html lang="en, dk, gr"
    ?

  • #9
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    This site may be of assistance. The Unicode Character Code Charts By Script
    Also this one. Tutorial: Character sets & encodings in XHTML, HTML and CSS

    Frank
    Last edited by effpeetee; 02-17-2009 at 08:43 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #10
    Regular Coder
    Join Date
    May 2008
    Posts
    135
    Thanks
    13
    Thanked 10 Times in 10 Posts
    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.

  • #11
    Regular Coder Partizan's Avatar
    Join Date
    Dec 2008
    Location
    Legoland and Ireland
    Posts
    139
    Thanks
    74
    Thanked 0 Times in 0 Posts
    Thanks! I'll check these links out

  • #12
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,606
    Thanks
    6
    Thanked 997 Times in 970 Posts
    I would suggest the use of so-called smart quotes (a. k. a. curved quotes) for regular text.

  • #13
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I wouldn't do that. Instead, use a span element and set the language on that.
    For example:
    Code:
    
    <!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>

  • #14
    Regular Coder
    Join Date
    May 2008
    Posts
    135
    Thanks
    13
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by CyanLight View Post
    I wouldn't do that. Instead, use a span element and set the language on that.
    For example:
    Code:
    
    <!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?

  • #15
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •