Search code examples
urlwebgethttprequestyahoo-api

Change prefix of URL in GET request


I'm making a get with a relative URL with YAHOO.util.Connect.asyncRequest. Example:

var myurl = "newpagetotest?something="something");
var myCallback = {
   success: function(data) {
      console.log("success");
   },
};
var transaction =
YAHOO.util.Connect.asyncRequest('GET', myurl, callback);

And this makes, for example, get to the

localhost:8080/share/page/newpagetotest

But if I want to change the "localhost:8080/share/page", i.e., the prefix of URL absolute. How can I change? It's possible? Or how can I get this prefix for example, for one variable?

Thanks in advance.


Solution

  • I made this by using location.pathname.

    It solves the problem.