image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Design & Media

Reply
 
Thread Tools
  #1  
Old September 28th, 2004, 12:12 PM
3mors's Avatar
HampCake Studios
 
Join Date: Oct 2001
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
3mors is on a distinguished road
javascript "eval" problem

i have this piece of js code:
Code:
string = "document.getElementById(\"infouser1\").innerHTML = \"<a href=\"idcard.html\">idcard<\/a>\";";
eval(string);
it works perfectly on safari and mac ie, but on ie for windows i get an unknown runtime error.
the problem is <a that has to be written inside infouser1 tag.
i've already tried to escape the < usign \< but without luck.

any help?
thank u.
__________________
3mors
------------------------------------------------------
iMac G5 20"/MacBook Pro 17"/PowerBook G4
------------------------------------------------------
Reply With Quote
  #2  
Old October 1st, 2004, 07:24 PM
ElDiabloConCaca's Avatar
U.S.D.A. Prime
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 10,377
Thanks: 3
Thanked 124 Times in 113 Posts
ElDiabloConCaca is a jewel in the roughElDiabloConCaca is a jewel in the roughElDiabloConCaca is a jewel in the rough
What's this at the end of the line?

";";

That seems out of place.
__________________
Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT
MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM
iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k
http://www.jeffhoppe.com
Reply With Quote
  #3  
Old October 2nd, 2004, 05:00 AM
3mors's Avatar
HampCake Studios
 
Join Date: Oct 2001
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
3mors is on a distinguished road
the ";"; is correct

the ";" belongs to the string that has to be evaled
the second ; is for string line
__________________
3mors
------------------------------------------------------
iMac G5 20"/MacBook Pro 17"/PowerBook G4
------------------------------------------------------
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 01:43 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.