Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Current Version (Old)
 Need to replace ? and & in the url
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ahugedeal
Starting Member

20 Posts

Posted - 26 April 2001 :  19:40:16  Show Profile  Visit ahugedeal's Homepage
I need to be able to replace all the non alpha characters in the url, such as the following:
Char : should be %3A
Char / should be %2F
Char . should be %2E
Char ? should be %3F
Char & should be %26

Anyway, I think it needs to be done in the edit_hrefs function, but I am terrible at javascript, so I was hoping someone could help me!

Thanks!
Terry
===

<script language="javascript1.2" runat=server>
function edit_hrefs(s_html, type){
s_str = new String(s_html);
if (type == 1) {
s_str = s_str.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=http://www.ahugedeal.com/jump.asp?link=\$1\ target=\"_blank\">$1<\/a>");
}
</script>

http://www.ahugedeal.com

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 26 April 2001 :  20:02:54  Show Profile  Visit HuwR's Homepage
you can use server.URLEncode(string) do accomplish what you want

Go to Top of Page

ahugedeal
Starting Member

20 Posts

Posted - 26 April 2001 :  21:29:50  Show Profile  Visit ahugedeal's Homepage
Thanks for the response, I put the server.urlencode around the strArray2(0) in every instance in the replaceurl function. Seems to be working now!

Thanks

Edited by - ahugedeal on 26 April 2001 21:39:45
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 26 April 2001 :  21:33:09  Show Profile
deja vu?

======
Doug G
======
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07