?
Solved

&nbsp appears in a dynamic url

Posted on 2008-06-12
8
Medium Priority
?
246 Views
Last Modified: 2010-04-16
0
Comment
Question by:mraconnor
[X]
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
  • 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 200 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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 

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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

762 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