Welcome to TalkGraphics.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2007
    Location
    Sunshine Coast BC, Canada. In a beautiful part of BC's temperate rainforest
    Posts
    9,864

    Default editing a javascript array for use in a xara created website.

    I'm not sure if this is the right place to ask this but I have a javascript that basically calls up random quotes from an array. I need to edit the quotes as the client wants different ones. I have been trying to learn a little of this through W3schools and I understand that words that have apostrophes or are surrounded by quotes need to have backslashes to keep the javascript from executing something I don't want it to, but what I am wondering about is some of the quotes supplied to me have the authors name preceded by ~ will that mess things up, should I either remove it or replace it?

    Any help that anyone can give me with this will be much appreciated, and again I apologize if this is the wrong place for this question.
    [SIGPIC][/SIGPIC]
    My current Xara software: Designer Pro 365 12.6

    Good Morning Sunshine.ca | Good Morning Sunshine Online(a weekly humorous publication created with XDP and exported as a web document) | Angelize Online resource shop | My Video Tutorials | My DropBox |
    Autocorrect: It can be your worst enema.

  2. #2

    Default Re: editing a javascript array for use in a xara created website.

    Hello Frances,

    Did you simply try it with the tilde character? I didn't know if it needed escaped or not either.

    http://www.wenzloffandsons.com/temp/random.html

    Looks like a tilde is fine without escaping.

    Take care, Mike

  3. #3
    Join Date
    Dec 2007
    Location
    Sunshine Coast BC, Canada. In a beautiful part of BC's temperate rainforest
    Posts
    9,864

    Default Re: editing a javascript array for use in a xara created website.

    Thanks Mike, I've been dealing with 3 pages worth of quotes that the client wants to have randomly cycled, so been having fun with this one lol And now I've learned that adding those backslashes is called escaping, thanks for that too.
    [SIGPIC][/SIGPIC]
    My current Xara software: Designer Pro 365 12.6

    Good Morning Sunshine.ca | Good Morning Sunshine Online(a weekly humorous publication created with XDP and exported as a web document) | Angelize Online resource shop | My Video Tutorials | My DropBox |
    Autocorrect: It can be your worst enema.

  4. #4

    Default Re: editing a javascript array for use in a xara created website.

    Hi Frances,

    You are welcome. Please note that one can also use html special characters--html encoding of characters--rather than escaping with slashes.

    Some pertinent examples for your quote file:

    Code:
    – – – en dash
    — — em dash
    " " quotation mark
    “ “ left double curly quote
    ” ” right double curly quote
    ' ' apostrophe (single quote)
    ‘ ‘ ‘ left single curly quote
    ’ ’ ’ right single curly quote
    I updated the above web page and you can look at it for examples of the quote marks.

    Take care, Mike

  5. #5

    Default Re: editing a javascript array for use in a xara created website.

    BTW, and this may be more pertinent to more web sites. One can use this for customer quotes on a web site as well. Just replace the quotes with customer testimonials.

    Take care, Mike

  6. #6
    Join Date
    Dec 2007
    Location
    Sunshine Coast BC, Canada. In a beautiful part of BC's temperate rainforest
    Posts
    9,864

    Default Re: editing a javascript array for use in a xara created website.

    Thanks Mike. And I like the idea of using this for customer customer testimonials. Another idea to tuck away into my bag of tricks!
    [SIGPIC][/SIGPIC]
    My current Xara software: Designer Pro 365 12.6

    Good Morning Sunshine.ca | Good Morning Sunshine Online(a weekly humorous publication created with XDP and exported as a web document) | Angelize Online resource shop | My Video Tutorials | My DropBox |
    Autocorrect: It can be your worst enema.

 

 

Bookmarks

Posting Permissions

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