+ 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
    939
    Thank Post
    39
    Thanked 70 Times in 54 Posts
    Rep Power
    30

    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. #2
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24

  3. #3

    Join Date
    Apr 2006
    Location
    UK
    Posts
    939
    Thank Post
    39
    Thanked 70 Times in 54 Posts
    Rep Power
    30
    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?

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

  5. #5
    rrichmond's Avatar
    Join Date
    Jul 2007
    Location
    Brisbane
    Posts
    108
    Thank Post
    3
    Thanked 7 Times in 7 Posts
    Rep Power
    17
    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/

  6. #6


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,507
    Thank Post
    871
    Thanked 862 Times in 681 Posts
    Rep Power
    199
    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...

  7. #7
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24
    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, 12:13 PM
  2. PHP or JavaScript password obfuscator
    By ajbritton in forum Web Development
    Replies: 2
    Last Post: 18th October 2006, 09:30 AM
  3. JavaScript. Yea or Nae?
    By Irazmus in forum General Chat
    Replies: 5
    Last Post: 30th June 2006, 10:35 PM
  4. Text WEP key for hex input
    By NetworkGeezer in forum Wireless 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
  •