How to use the url.stringify function in url

To help you get started, we’ve selected a few url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kissyteam / kissy / src / io / - / src / io / methods.js View on Github external
_getUrlForSend: function () {
            // for compatible, some server does not decode query
            // uri will encode query
            // x.html?t=1,2
            // =>
            // x.html?t=1%3c2
            // so trim original query when process other query
            // and append when send
            var c = this.config,
                uri = c.uri;
            var search = uri.search || '';
            delete uri.search;
            if (search && !util.isEmptyObject(uri.query)) {
                search = '&' + search.substring(1);
            }
            return url.stringify(uri, c.serializeArray) + search;

        }
    }
github kissyteam / kissy / src / io / - / src / io / xhr-transport-base.js View on Github external
function getIfModifiedKey(c) {
    var ifModified = c.ifModified,
        ifModifiedKey;
    if (ifModified) {
        ifModifiedKey = c.uri;
        if (c.cache === false) {
            ifModifiedKey = util.clone(ifModifiedKey);
            // remove random timestamp
            // random timestamp is forced to fetch code file from server
            delete ifModifiedKey.query._ksTS;
        }
        ifModifiedKey = url.stringify(ifModifiedKey);
    }
    return ifModifiedKey;
}
github kissyteam / kissy / src / io / src / io / xhr-transport-base.js View on Github external
function getIfModifiedKey(c) {
    var ifModified = c.ifModified,
        ifModifiedKey;
    if (ifModified) {
        ifModifiedKey = c.uri;
        if (c.cache === false) {
            ifModifiedKey = util.clone(ifModifiedKey);
            // remove random timestamp
            // random timestamp is forced to fetch code file from server
            delete ifModifiedKey.query._ksTS;
        }
        ifModifiedKey = url.stringify(ifModifiedKey);
    }
    return ifModifiedKey;
}
github kissyteam / kissy / src / router / src / router.js View on Github external
function dispatch(backward, replace) {
    var urlStr = getUrlForRouter();
    var uri = url.parse(urlStr, true);
    var query = uri.query;
    uri.search = '';
    uri.query = {};
    // normalize to '/'
    var path = url.stringify(uri) || '/';
    var request = new Request({
        query: query,
        // backward or forward
        backward: backward === true,
        // replace history
        replace: replace === true,
        forward: (backward === false && replace === false),
        path: path,
        url: urlStr,
        originalUrl: urlStr
    });
    var response = {
        redirect: exports.navigate
    };
    exports.fire('dispatch', {
        request: request,
github kissyteam / kissy / src / io / src / io / sub-domain-transport.js View on Github external
}

        if (!iframeDesc) {
            iframeDesc = iframeMap[hostname] = {};
            iframe = iframeDesc.iframe = doc.createElement('iframe');
            Dom.css(iframe, {
                position: 'absolute',
                left: '-9999px',
                top: '-9999px'
            });
            Dom.prepend(iframe, doc.body || doc.documentElement);
            iframeUri = {};
            iframeUri.protocol = uri.protocol;
            iframeUri.host = uri.host;
            iframeUri.pathname = proxy;
            iframe.src = url.stringify(iframeUri);
        } else {
            iframe = iframeDesc.iframe;
        }

        Event.on(iframe, 'load', _onLoad, self);

    }
});
github kissyteam / kissy / src / io / - / src / io / sub-domain-transport.js View on Github external
}

        if (!iframeDesc) {
            iframeDesc = iframeMap[hostname] = {};
            iframe = iframeDesc.iframe = doc.createElement('iframe');
            Dom.css(iframe, {
                position: 'absolute',
                left: '-9999px',
                top: '-9999px'
            });
            Dom.prepend(iframe, doc.body || doc.documentElement);
            iframeUri = {};
            iframeUri.protocol = uri.protocol;
            iframeUri.host = uri.host;
            iframeUri.pathname = proxy;
            iframe.src = url.stringify(iframeUri);
        } else {
            iframe = iframeDesc.iframe;
        }

        DomEvent.on(iframe, 'load', _onLoad, self);

    }
});