Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

&nbsp appears in a dynamic url

Posted on 2008-06-12
8
240 Views
Last Modified: 2010-04-16
0
Comment
Question by:mraconnor
  • 3
  • 3
  • 2
8 Comments
 

Expert Comment

by:Kripz
ID: 21767451
Hi,
While creating the URL dynamically replace the " " with "%20"... Now the above URL will be something like this,
http://www.ansador.co.uk/card_access_swipe_cards_and_card_access_systems.asp?category=Card%20Access&subcategory=Swipe%20Cards%20and%20Card%20Access%20Systems

Cheers...
Saran
http://www.thesysteminfo.com
0
 

Author Comment

by:mraconnor
ID: 21767485
cn you explain why this is
0
 
LVL 26

Accepted Solution

by:
Leon Fester earned 50 total points
ID: 21767517
" "  is a HTML tag
i.e. it must be parsed through a HTML browser in order to render the "space"
%20 is the standard "space" placeholder for URL's
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:mraconnor
ID: 21767532
any idear wherer the &nbsp are coming from as i don't think they are in the code
0
 

Author Comment

by:mraconnor
ID: 21767561
is it to do with this line of code in the page

mm_menu_0410170422_0.addMenuItem("<img src='images/arrow_red.gif' align='middle'>&nbsp;Swipe&nbsp;Cards&nbsp;and&nbsp;Access&nbsp;Cards","location='card_access_swipe_cards_and_card_access_systems.asp?category=Card Access&subcategory=Swipe&nbsp;Cards&nbsp;and&nbsp;Card&nbsp;Access&nbsp;Systems'");
0
 
LVL 26

Expert Comment

by:Leon Fester
ID: 21767602
yip that is the problem...
Your URL is enclosed in quotes("") so anything inbetween is treated as part of the string.
Hence in your example the &nbsp is included in the actual string.

You should be able to just leave the spaces in the string, and it will be updated accordingly.
try entering a URL with spaces directly in your browser and you'll see that it automatically replaces the spaces with %20.
e.g.
Entering http://www.this is  a test.com in your browser
results in this http://www.this%20is%20a%20test.com/ when it returns that the page is not available.
0
 

Expert Comment

by:Kripz
ID: 21768490
Yes, Please replace that line with this,
mm_menu_0410170422_0.addMenuItem("<img src='images/arrow_red.gif' align='middle'>&nbsp;Swipe&nbsp;Cards&nbsp;and&nbsp;Access&nbsp;Cards","location='card_access_swipe_cards_and_card_access_systems.asp?category=Card Access&subcategory=Swipe%20Cards%20and%20Card%20Access%20Systems'");

Cheers...
Saran
0
 

Expert Comment

by:Kripz
ID: 21768513
Alternatively you can also use this,

mm_menu_0410170422_0.addMenuItem("<img src='images/arrow_red.gif' align='middle'>&nbsp;Swipe&nbsp;Cards&nbsp;and&nbsp;Access&nbsp;Cards","location='card_access_swipe_cards_and_card_access_systems.asp?category=Card Access&subcategory=Swipe Cards and Card Access Systems'");

Cheers...
Saran
http://www.thesysteminfo.com
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question