[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

&nbsp appears in a dynamic url

Posted on 2008-06-12
8
Medium Priority
?
247 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
Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

 

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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

650 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