+ Post New Thread
Results 1 to 7 of 7
Scripts Thread, Javascript - Change text in Coding and Web Development; I need a bit of javascript to change and ( ` ) to a ( ' ) The text gets ...
  1. #1

    Join Date
    Apr 2006
    Location
    UK
    Posts
    940
    Thank Post
    39
    Thanked 70 Times in 54 Posts
    Rep Power
    25

    Javascript - Change text

    I need a bit of javascript to change and ( ` ) to a ( ' )

    The text gets output in simple html

    <p>Jame`s was amazing</p>

    but needs to be

    <p>Jame's was amazing</p>

    Any ideas?

  2. IDG Tech News

  3. #2
    Jona's Avatar
    Join Date
    May 2007
    Location
    Aberystwyth
    Posts
    442
    Thank Post
    9
    Thanked 45 Times in 44 Posts
    Rep Power
    18

  4. #3

    Join Date
    Apr 2006
    Location
    UK
    Posts
    940
    Thank Post
    39
    Thanked 70 Times in 54 Posts
    Rep Power
    25
    Thats great, but i need it to do the replace across a whole html page not just the string i specify in the script?

    Can anyone help?

  5. #4
    lasercat's Avatar
    Join Date
    Nov 2007
    Location
    Bradford
    Posts
    45
    Thank Post
    6
    Thanked 5 Times in 3 Posts
    Rep Power
    10
    Probably not what you need, but could you take the html into notepad and do a good ol' find and replace?

  6. #5
    rrichmond's Avatar
    Join Date
    Jul 2007
    Location
    Brisbane
    Posts
    109
    Thank Post
    3
    Thanked 7 Times in 7 Posts
    Rep Power
    11
    Quote Originally Posted by danIT View Post
    I need a bit of javascript to change and ( ` ) to a ( ' )

    The text gets output in simple html

    <p>Jame`s was amazing</p>

    but needs to be

    <p>Jame's was amazing</p>

    Any ideas?
    Yes.

    You need to learn how to use an apostrophe! It tends to indicate ownership or missing letters. Sorry, but I've had to many people telling me off so I had to correct you.

    http://www.apostrophe.fsnet.co.uk/

  7. #6


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    3,743
    Thank Post
    661
    Thanked 639 Times in 493 Posts
    Rep Power
    154
    What's the application - you may have a hard time getting js to work across the whole doc.... explain what you are trying to do and someone may have a better trick...

  8. #7
    Jona's Avatar
    Join Date
    May 2007
    Location
    Aberystwyth
    Posts
    442
    Thank Post
    9
    Thanked 45 Times in 44 Posts
    Rep Power
    18
    Theoretically you could write a javascript look to get the content of each html element and replace it but this makes me shudder just to think of it. I think you need to give us more info about what your trying to achieve and the enviroment.

    If its a static page then notepad, grep, etc will be your best bet.

    If its database driven then maybe you could do it as a sql query in the backend or in what ever language is pulling your data from the database.

    Cheers
    Jona

SHARE:
+ Post New Thread

Similar Threads

  1. Text to Speech issue
    By CheeseDog in forum Educational Software
    Replies: 0
    Last Post: 16th April 2007, 11:13 AM
  2. PHP or JavaScript password obfuscator
    By ajbritton in forum Web Development
    Replies: 2
    Last Post: 18th October 2006, 08:30 AM
  3. JavaScript. Yea or Nae?
    By Irazmus in forum General Chat
    Replies: 5
    Last Post: 30th June 2006, 09:35 PM
  4. Text WEP key for hex input
    By NetworkGeezer in forum Networks
    Replies: 2
    Last Post: 16th March 2006, 08:16 PM
  5. URLblacklist.com as text file
    By adamyoung in forum How do you do....it?
    Replies: 11
    Last Post: 9th February 2006, 03:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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