Solved

&nbsp appears in a dynamic url

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

770 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