Results 1 to 8 of 8
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Passing a text string to an html file

    Here is the HTM file to go with the previous post.
    Attached Files Attached Files
    Regards
    John



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Passing a text string to an html file

    > This post is behaving oddly.

    Including a % character followed by a hexadecimal number causes havoc with the Lounge software. You can avoid this by using the <!t>[%]<!/t> tag: <!t>[%]<!/t>1 becomes %1 when posted, without causing the problems you experienced.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Passing a text string to an html file

    Added by John This post is behaving oddly. I keep getting two copies of the whole post. I will move the html to an attachment in a second post.

    The thread beginning with <!post=Image fit to new window,581,163>Image fit to new window<!/post> prompted me to solve a problem on my "to do" list.

    I produce auction catalogues in html. For each lot there is a lot description, and a thumbnail image. Currently, if you click on the thumbnail, it displays the full size graphic. Nothing fancy here, it just shows the image file.<pre> A href="images/lot50.jpg"</pre>


    I have been asked to change it so that when you see the full sized image, you also see the lot description. Now I don't want to have a separate html file for each lot. My new plan, courtesy of <!post=Image fit to new window,581,163>Image fit to new window<!/post> is to have a single html file and pass it two parameters: the path/name of the graphic and the lot description.

    I have a solution that works with IE but not with Firefox. The problem is that the Lot Description contains spaces (and potentially a + sign, which I use to separate the two parameters.)

    The HTML for the file that will display the photo and its descrption is attacxhed to the next post.

    The link that calls this page looks like this:

    <pre>A HREF="photo.html?DemonstrationAuctionmedallion.jpg +description***of***medallion"</pre>


    As you cannot see I have replaced the spaces in the lot description with a no break space, but if I put that in does not show. I have put in *** where there should be a no break space.

    This works perfectly in IE, but In Firefox it looks like this: the no break spaces are displayed as %AO


    If I don't replace the spaces with no break spaces , both Firefox and IE display %20 in the lot descriptions where the spaces occur.
    ********************
    A related question. Some of the lot descriptions are quite long. Is there a limit to how much text I can add the url as a query string?

    Edited again by John- following Hans post
    Attached Images Attached Images
    Regards
    John



  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Passing a text string to an html file

    Thanks Hans

    I have modifed the post a bit.

    Is there anywhere I can display an html no-break space code in a post?
    Regards
    John



  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Passing a text string to an html file

    It's very tricky to try to include HTML code in a post, since the Lounge software tends to convert it. So it's best either to attach a screenshot, or a text file (which will be modified slightly by the Lounge software to prevent unwanted code execution)

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Passing a text string to an html file

    <P ID="edit" class=small>(Edited by jscher2000 on 19-Jun-06 16:01. )</P>> This works perfectly in IE, but In Firefox it looks like this: the no break spaces are displayed as %AO

    This issue was recently mentioned on the mozillaZine web development board, in a another context.

    Perhaps you can do a find and replace on the parameter before inserting it into the page? I'm not very handy with regular expressions, but you could look up the JavaScript string method replace and see whether it makes sense for your situation.

    (I'm working on a personal site using ASP and an .MDB file to get around the "need a page for everything" problem.)

    Added

    > Is there a limit to how much text I can add the url as a query string?

    Yes, but it is quite a large number, at least in more recent browsers: Maximum URL length is 2,083 characters in Internet Explorer (IE 4-5-6)

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Passing a text string to an html file

    Thanks

    I was reading up on the javascript replace method as I received your post.

    I do have an asp/mdb version of this, but I need a plain html version also.

    I think I will use the first 1000 characters of the lot description. The lot description is actually stored as a memo field in an mdb file, so in theory it could be up to 64,000.
    Regards
    John



  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Passing a text string to an html file

    I now have this to work (with a bit of limited testing).

    When I write up the html I replace spaces, + and ? in the lot description with zxz.

    Then when I show the large photo I use:

    document.write(lotdescription.replace(/zxz/g," ")
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •