Results 1 to 5 of 5

Thread: Adding a Querystring

  1. #1
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Adding a Querystring

    I know nothing about JS. Absolutely nothing.

    soooo..with that said, I need to add a varible from my url into the following

    linkset[0]='<a href="../admin/blahblah.cfm?job=front&type=database&sub=none">blahblah</a>'

    I need to add the variable #url.sport#. Can it be done?


  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, you could just write it in:

    ../admin/blahblah.cfm?job=front&type=database&sub=none&#url.sport#

    But, is this truly a query? You already have a query:

    ?job=front&type=database&sub=none

    The #url.sport# part looks like a hash - the sort of thing that is used with a named anchor to get the page to scroll to a specific spot when loading. Is that what it is? If so:

    ../admin/blahblah.cfm?job=front&type=database&sub=none#url.sport#

    If it truly is a part of the query though, the # characters may need to be escaped:

    ../admin/blahblah.cfm?job=front&type=database&sub=none&%23url.sport%23

    Or, do you mean that you want #url.sport# to operate as a server-side data retrieval token and be resolved before the link gets clicked?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, its not an anchor...

    its a variable passed from page to page so the db knows which information to pull.

    in cf I would simply do the url and add &sport=#url.sport# and enclose it in output tags.

    But becase the code in question is part of a JS mouse over link it doesn't quite work that way. It only outputs the exact text typed, that is #url.sport#.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If resolving #url.sport# requires that the page have - say, a .php extension, make sure your page has that extension. If the script is external, it needs that extension too.

    Quote Originally Posted by SMDSports View Post
    &sport=#url.sport# and enclose it in output tags.
    What's that look like?

    You should be able to do the same, but the output tag syntax may need to be treated a certain way so as not to confuse the javascript parser.

    Give me an example and I'll see if I can escape it for you.

    However, if the #url.sport# value changes after the page has loaded and before the link is clicked, this change will not be reflected in the link.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks

    John

    Thank you for your offer. I have decided to skip it. I have bigger fish to fry right now and making it pretty can be put on the back burner. If I decide to revisit this, I will let you know.


    Thanks Again
    Sharon
    www.smdsports.com

Bookmarks

Posting Permissions

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