SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get and Post in JavaScript

    I want to get variables from a URL and write it to an href, for example:

    URL:

    http://www.xyz1.com/?sk=app_19032254...campaign=FP-IT

    HREF:

    http://www.xyz2.com/?sk=app_19032254...campaign=FP-IT

    How's that possible using only Javascript?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by talon21 View Post
    I want to get variables from a URL and write it to an href

    How's that possible using only Javascript?
    Code javascript:
    document.getElementById('identifierOfLink').href = window.location.href;
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •