Solved

&nbsp appears in a dynamic url

Posted on 2008-06-12
8
237 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now