| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi all, I'm struggling with a problem of how to get an %-encoded Unicode URL from a DHTML anchor into a script variable but maintaining the encoding. See this example code. I've used { } instead of angle brackets to avoid this mail getting mangled by your viewer: {A id=x href=ftp:%E3%82%B9}hi{/A} {script} alert(x.outerHTML); alert(x.href); {/script} The alert for outerHTML shows the href still has % codes in it, but the alert for href doesn't, it shows odd characters. I'd like just the href part, but with the % codes in place. I've experimented with using 'escape', 'encodedURI' and 'encodedURIComponent' but they all change other things too, I want the originally encoded URL without any other characters such as spaces additionally encoded. It doesn't seem so much to ask, can anyone point me in the right direction? Thanks, DaveW |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.