Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HTML Problem

Reply
Thread Tools

HTML Problem

 
 
kchayka
Guest
Posts: n/a
 
      07-15-2005
CyberDroog wrote:
>
> The part: onclick="location.href='%item-url%' seems to be the problem since
> it is surrounded by single quotes. When it comes across a folder name such
> as: CD's


If you insist on using quote marks in file or folder names, you should
url-encode them in the HTML, i.e.

item-url = "CD%27s"

Do this with any character other than letters, numbers, dashes,
underscores or periods, and you won't have any browser troubles.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
 
Reply With Quote
 
 
 
 
CyberDroog
Guest
Posts: n/a
 
      07-15-2005
On Fri, 15 Jul 2005 11:09:14 -0500, kchayka <(E-Mail Removed)> wrote:

>CyberDroog wrote:
>>
>> The part: onclick="location.href='%item-url%' seems to be the problem since
>> it is surrounded by single quotes. When it comes across a folder name such
>> as: CD's

>
>If you insist on using quote marks in file or folder names, you should
>url-encode them in the HTML, i.e.
>
>item-url = "CD%27s"
>
>Do this with any character other than letters, numbers, dashes,
>underscores or periods, and you won't have any browser troubles.


The problem is that this is a dynamic process. The code simply reads any
folder/file tree it is pointed at.



--
To make an apple pie from scratch, you must first invent the universe.

 
Reply With Quote
 
 
 
 
Martin Jay
Guest
Posts: n/a
 
      07-15-2005
In message <(E-Mail Removed)>, CyberDroog
<(E-Mail Removed)> writes
>At least I think it is... I have been playing with HttpFileServer
>v2.0beta23 (http://www.rejetto.com/sw/) along with some user created
>templates.


>One of the template has a problem with file names that contain a single
>quote character. The forum for the software doesn't seem to have much
>traffic, so maybe someone here can see what the problem is and how to fix
>it.


>An example line from the code to display a file name: <tr class="mout"
>onmouseover="this.className='mover'" onmouseout="this.className='mout'"
>onclick="location.href='%item-url%'">


>The part: onclick="location.href='%item-url%' seems to be the problem since
>it is surrounded by single quotes. When it comes across a folder name such
>as: CD's, that seems to translate in the code to 'CD's', and the code
>chokes. Clicking the link does nothing, and reloading the file list can
>produce an "Error expecting ;" for every file or folder name that contains
>a single quote.


If you're willing to use Javascript, as you appear to be, there may be a
solution.

Assign %item-url% to a variable;

replace ' with %27 in the variable's contents;

then, replace %item-url% in onclick="location.href='%item-url%' with the
new variable name.
--
Martin Jay
 
Reply With Quote
 
kchayka
Guest
Posts: n/a
 
      07-15-2005
CyberDroog wrote:
> On Fri, 15 Jul 2005 11:09:14 -0500, kchayka <(E-Mail Removed)> wrote:
>
>>If you insist on using quote marks in file or folder names, you should
>>url-encode them in the HTML

>
> The problem is that this is a dynamic process. The code simply reads any
> folder/file tree it is pointed at.


No excuse. PHP has a built-in function that does this, as do other
languages. And then there are always regular expressions...

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
problem with index.html .(page is automatically gettin redirected to index.html) karthikeyavenkat Java 2 03-17-2005 10:01 PM
How do I identify word<html><html>other word? Laura Perl 1 06-04-2004 11:32 PM
how to redirect to a frames-based html page and load the right html when coming from an ASP.NET page Mark Kamoski ASP .Net 1 08-13-2003 05:51 AM
How to use HTML::Parser to remove HTML tags and print result Mitchua Perl 1 07-15-2003 02:02 PM



Advertisments