Adding parameters to URL with fragment

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Adding parameters to URL with fragment

    This is a topic I thought I'd find in the docs, but haven't.
    I've also searched these newsgroups, but it hasn't come up
    recently. Please point me to the appropriate document ...

    From a form, I'm posting the same .cfm file a second time.
    I have parameters, which at the moment I'm including in the
    URL, as

    a.cfm?parm1=a&parm2=b

    When CF (MX 6.1 on Apache and Windows 2000) redisplays the document,
    I also want it to display a fragment within the HTML document,
    so the URL also includes a fragment identifier, like

    a.cfm#loc?parm1=a&parm2=b

    CF doesn't seem to like this syntax. The document displays at the
    top of the document, rather than at the location of the fragment,
    and the parameters are undefined.

    From the standards, this appears to be the right syntax to use.
    I tried the other way around

    a.cfm?parm1=a&parm2=b#loc

    (escaping the # in the CF code so I get the single # I want in the
    generated URL), but CF then interprets the #loc as part of the last
    parameter. I think, from the standard, that way around is incorrect
    anyway.

    I can get around this by using form parameters rather than
    URL parameters. I would like to understand what's happening and
    how to get it right with the parameters in the URL.

    Thanks!

    --
    Glenn Holliday [email]holliday@acm.org[/email]
    Glenn Holliday Guest

  2. Similar Questions and Discussions

    1. Adding Dynamic User Control WITH PARAMETERS
      Is there a way to dynamically add a user control to a page, AND before the page_load of the user control fires, that you have some of the public...
    2. adding parameters
      i have a datagrid set up with a parameter @User which calls from the database all of a users contacts and places them in the grid. each contact...
    3. fragment caching problem
      I have a custom control that generates client scripts and uses viewstate This control is placed in a user control that is placed in my application...
    4. html fragment use
      This code won't display anything. The link will be in the code but you have nothing to click and engage it. The code you have here is just the back...
    5. HTML Fragment
      I have inserted some HTML fragments. One was a small banner which worked fine, but none of the others see to work. I checked to be sure that it...
  3. #2

    Default RE: Adding parameters to URL with fragment

    "a.cfm?parm1=a&parm2=b#loc" is the correct syntax.
    I use this, all the time, to jump to anchors in my pages -- and the anchor
    name does not get added to any URL variable.

    What CF version are you running? Webserver?

    Please post the code that generates the URL.


    MikerRoo Guest

  4. #3

    Default Re: Adding parameters to URL with fragment

    Glenn Holliday wrote:
    >
    > This is a topic I thought I'd find in the docs, but haven't.
    > I've also searched these newsgroups, but it hasn't come up
    > recently. Please point me to the appropriate document ...
    >
    > From a form, I'm posting the same .cfm file a second time.
    > I have parameters, which at the moment I'm including in the
    > URL, as
    >
    > a.cfm#loc?parm1=a&parm2=b
    >
    > CF doesn't seem to like this syntax. The document displays at the
    > top of the document, rather than at the location of the fragment,
    > and the parameters are undefined.
    Got it figured out. The CF form was using the HTML form action
    to re-post the form several times, to handle several states in
    a use case. I hadn't yet found that one time it was actually
    using <CFLOCATION> rather than posting from the form.
    It appears to be the <CFLOCATION> that does not like combining
    parameters and fragments. Once I replaced that with a more
    ordinary post from a form action, everything was well.

    --
    Glenn Holliday [email]holliday@acm.org[/email]
    Glenn Holliday Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139