LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-22-2006, 02:52 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question JS: can html entities be found in a string?


suppose I give you this code:

Code:
function test() {
var temp = "Just a test: á";
}
(Well... that didn't take much time to write).

Is there a function (or number of functions) I can call to transform that variable into "Just a test: á"?
 
Old 08-22-2006, 03:04 PM   #2
demon_vox
Member
 
Registered: May 2006
Location: Argentina
Distribution: SuSE 10
Posts: 173

Rep: Reputation: 30
Hi,
there is a function that does that, html_entity_decode, which can be extremely easy to find in the online PHP site... why didnt you start there? its the best place to start!
 
Old 08-22-2006, 04:00 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Thanks for replying, demon.... but the problem is not in PHP, but in a JS script running on the client side.... however, I kind of found the solution to my problem.

On PHP, I send the string passed by rawurlencode and then in JS I decode it back with unescape. It worked it all in IE and FF... I guess god exists after all. :-)
 
Old 08-22-2006, 04:03 PM   #4
demon_vox
Member
 
Registered: May 2006
Location: Argentina
Distribution: SuSE 10
Posts: 173

Rep: Reputation: 30
hehehe now that explains why that wasnt such a trivial question
Make sure you mention the language next time but good thing you found a solution (but beware, god does exists, but he uses his free time make anormal thing in programmers lifes )

Cheers!
 
Old 08-22-2006, 04:05 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Por cierto... por qué estamos hablando en inglés? :-D jejeje
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sajax, php, entities, JS and IE eantoranz Programming 2 08-22-2006 04:02 PM
pdftotext - How to output to html with ampersand entities ? narc Linux - Software 2 01-04-2006 02:34 PM
use grep and execute a command if string is found plisken Linux - General 6 07-28-2005 11:06 AM
[php] comparing found username with string Erhnam Programming 4 03-15-2005 09:34 PM
java test if string in string array is null. exodist Programming 3 02-21-2004 01:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration