LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 03:52 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
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, 04: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, 05:00 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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, 05: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, 05:05 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:02 PM
pdftotext - How to output to html with ampersand entities ? narc Linux - Software 2 01-04-2006 03:34 PM
use grep and execute a command if string is found plisken Linux - General 6 07-28-2005 12:06 PM
[php] comparing found username with string Erhnam Programming 4 03-15-2005 10:34 PM
java test if string in string array is null. exodist Programming 3 02-21-2004 02:39 PM


All times are GMT -5. The time now is 01:11 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration