Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Maintaining an apostrophe!
nholland
Newbie

Posts: 1
Registered: 1/4/2003
Member Is Offline
posted on 1/4/2003 at 09:59 PM Reply With Quote
Maintaining an apostrophe!


I am currently developing a website that uses the tree menu within a FAQ application. Some question and answer have apostrophes in them. These aprostrophes cause a Javascript error.

Any ideas on how I can display these without errors?

By the way, the Tree Menu is superb, thanks.
View User's Profile View All Posts By User U2U Member
Ulukai
Member

Posts: 40
Registered: 11/27/2002
Location: Frankfurt, Germany
Member Is Offline
posted on 1/6/2003 at 10:00 PM Reply With Quote
Possible Solutions


Hi.

One Solution is to reverse the order the quotes and apostrophes appear in the tree-script. This is a lot to do and does not fit if the user enters a quote.

Another solution is to parse the strings for critical characters like the quote and replace them by the corresponding javascript / html escape-sequences.
This would be \" for a quote in javascript and " for html.

I wrote such a stringparser which should be easy to modify. It was written for private purposes, so I made no hard tests on it and it may be not elegant and even slow but it works.

You are free to use it.

The arrays defined at the beginning of the file are pairs of search/replace String-Arrays. Modify them for fitting your needs.

Have fun

Ulukai

Attachment: stringparse.js (6.6kb)
This file has been downloaded 764 times
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Tree Menu
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   
Tigra Tree Menu PRO
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004