traport
asked on
HREF with named anchor and CF variable
I have a link that contains a variable and an anchor. The anchor is PRAStab + a variable.
Without any additional variables, when this is clicked:
<a href="dsp_trackingAdminTes t.cfm?PRAS tab#qry_ge tTracking. trackingUn itID#">Lin k</a>
this is the url in the browser:
http://staffnetdev.rti.org/research/pdo/apps/spdr_rev/dsp_trackingAdminTest.cfm?PRAStab6
This one works.
My problem is, I can't seem to add any additional variables or it stops reading the anchor. When I try to add another variable (sortOrder) like this:
<a href="dsp_trackingAdminTes t.cfm?sort Order=clie nt_org_nam e##PRAStab #qry_getTr acking.tra ckingUnitI D#">link</ a>
The browser reads it like this:
http://staffnetdev.rti.org/research/pdo/apps/spdr_rev/dsp_trackingAdminTest.cfm?sortOrder=client_org_name#PRAStab6
I don't know how to include this anchor along with this variable. I've tried switching the # around. Nothing seems to work.
Without any additional variables, when this is clicked:
<a href="dsp_trackingAdminTes
this is the url in the browser:
http://staffnetdev.rti.org/research/pdo/apps/spdr_rev/dsp_trackingAdminTest.cfm?PRAStab6
This one works.
My problem is, I can't seem to add any additional variables or it stops reading the anchor. When I try to add another variable (sortOrder) like this:
<a href="dsp_trackingAdminTes
The browser reads it like this:
http://staffnetdev.rti.org/research/pdo/apps/spdr_rev/dsp_trackingAdminTest.cfm?sortOrder=client_org_name#PRAStab6
I don't know how to include this anchor along with this variable. I've tried switching the # around. Nothing seems to work.
According to the RCF the URL is split by the fragment identifier first (#), if present, and *then* parsed as an address. It's therefore imperative that the fragment identifier is placed last in the URL, which may also be combined with a query string
you can put it into the variable and then pass it to the url.
<cfset url_variable= ID>
Also i noticed that in your url you have an extra #.
Also in order to pass multiple url variables they need to be separated by &
For example
<a href="page.cfm?Variable1=# id#&variab le2="#id2# ""
<cfset url_variable= ID>
Also i noticed that in your url you have an extra #.
Also in order to pass multiple url variables they need to be separated by &
For example
<a href="page.cfm?Variable1=#
You might try <a href="dsp_trackingAdminTes t.cfm?sort Order=clie nt_org_nam e&1=1##PRA Stab#qry_g etTracking .trackingU nitID#">li nk</a>
Since you don't care about the 1=1, it doesn't matter if it gets corrupted.
Since you don't care about the 1=1, it doesn't matter if it gets corrupted.
ASKER
Thanks all for the replies.
HyperBPP: I don't understand what you're saying. The anchor is the last in the URL here if that's what you mean. Changing it to add the 1=1 doesn't work for some reason, either.
erikTsomik: I'm going to try your suggestion and may not be back until tomorrow just to let you know. I have an extra # b/c that's what you have to have in CFML so that it reads # which I used to indicate it was an anchor (in CFML I have to use double # when I'm w/in cfoutput).
HyperBPP: I don't understand what you're saying. The anchor is the last in the URL here if that's what you mean. Changing it to add the 1=1 doesn't work for some reason, either.
erikTsomik: I'm going to try your suggestion and may not be back until tomorrow just to let you know. I have an extra # b/c that's what you have to have in CFML so that it reads # which I used to indicate it was an anchor (in CFML I have to use double # when I'm w/in cfoutput).
What broswer are you using?
you only need to use double when you need to dispaly 1#
ASKER
I'm using IE8.
correct me if i'm wrong but you want the end result to look something like <a href="dsp_trackingAdminTes t.cfm?sort Order=clie nt_org_nam e#PRAStab1 2345">link </a>
if so, do something like
<cfset AnchorId = "PRAStab#qry_getTracking.t rackingUni tID#">
<a href="dsp_trackingAdminTes t.cfm?sort Order=clie nt_org_nam e###Anchor Id#">link< /a>
if so, do something like
<cfset AnchorId = "PRAStab#qry_getTracking.t
<a href="dsp_trackingAdminTes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah... thank you! Thank you!