Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1003939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:03:19+00:00 2026-05-16T08:03:19+00:00

I have tried some tips I was given on regards URL encoding but I

  • 0

I have tried some tips I was given on regards URL encoding but I have no success so far. First, I was given this format,

var url = "http://www.polyvore.com/cgi/add?title=" 
      + encodeURIComponent(%%GLOBAL_ProductName%%) 
      + "&url=" + encodeURIComponent("http://lilaboutique.co.uk/products/" 
          + encodeURIComponent(%%GLOBAL_ProductName%%) 
          + "&imgurl=" + encodeURIComponent(%%GLOBAL_ThumbImageURL%%) 
          + "&desc=" + encodeURIComponent(%%GLOBAL_ProductDesc%%) 
          + "&price=" + encodeURIComponent(%%GLOBAL_ProductPrice%%));

which never got to be passed to the href dunno for what reason. Then I played with it some more,

var url = "http://www.polyvore.com/cgi/add?title=encodeURIComponent(%%GLOBAL_ProductName%%)&url=http://lilaboutique.co.uk/products/encodeURIComponent(%%GLOBAL_ProductName%%)&imgurl=encodeURIComponent(%%GLOBAL_ThumbImageURL%%)&desc=encodeURIComponent(%%GLOBAL_ProductDesc%%)&price=encodeURIComponent(%%GLOBAL_ProductPrice%%)";

this time the URL was passed but the values were mixed between the appropriate and other fields displaying the encoding function itself.

Any help clarifying my mistakes is greatly appreciated. I would like to encode just price and description, seems to be the fields giving problems.

A regular link does render without problems

var url = "www.google.com";

var myAnchor = document.getElementById('myAnchor');

myAnchor.href = url;

Thanks for any help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:03:20+00:00Added an answer on May 16, 2026 at 8:03 am

    Nicer, cleaner way of doing this:

    var toEncode = {
      title:    '%%GLOBAL_ProductName%%',
      url:      'http://lilaboutique.co.uk/products/%%GLOBAL_ProductName%%',
      imgurl:   '%%GLOBAL_ThumbImageURL%%',
      desc:     '%%GLOBAL_ProductDesc%%',
      price:    '%%GLOBAL_ProductPrice%%'
    };
    
    var index, queryString = '';
    
    for (index in toEncode)
    {
      queryString += index + '=' + encodeURIComponent(toEncode[index]) + '&';
    }
    
    var url = "http://www.polyvore.com/cgi/add?" + queryString;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is odd. I have a WPF application that works just fine in XP
I've tried to find som good how to, or some example that is good
I'm trying to play an audio in background from a WebView. This audio is
So I have the foundation of my Rails app, then I went ahead and
Hey, I am trying to make my datagrid printable. To do this, I am
I have a page like for example: http://www.stackoverflow.com/how-many-users-visited I have inside that page already
I hope somebody can assist in pointing out my ignorance by solving this problem...
Here goes my first question. First of all I'm new with Java and still
Possible Duplicate: Python '==' vs 'is' comparing strings, 'is' fails sometimes, why? Hi. I
Suddenly, local file access using jQuery's .getJSON is not working for me on Firefox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.