Skip to content

Error With Search Params #104

@JAA17

Description

@JAA17

My code starts with:

var g_IsWINJS = (typeof Windows != "undefined" && typeof MSApp != "undefined") ? true : false;
var g_IsLocalHtml = window.location.protocol == 'file:' ? true : false; // OR window.location.href.indexOf("href") > -1
//var g_IsNodeWebkit = (typeof process == "object" /*&& process.versions['nw']*/) ? true : false;
var g_IsDesktop = (/*g_IsNodeWebkit ||*/ g_IsWINJS || g_IsLocalHtml) ? true : false;
var g_UseBase64 = (g_IsDesktop && !g_IsWINJS) ? true : false;

var g_ResizeTimeoutId = -1;
var g_Game = null;

function MaintainSearchParametersOnRefresh(){
    const params = new URLSearchParams(window.location.search);
    //params.set('newParam', 'newValue'); // Adding new ones
    window.history.pushState({}, '', `${window.location.pathname}?${params}`);
};
MaintainSearchParametersOnRefresh();

However, I get an error when trying to compress with the line window.history.pushState({}, '', ${window.location.pathname}?${params});

This obviously works in the javascript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions