I use this two functions to set and reset scale values when I instigate a JS app from an HTML page.

function setMeta(){
        alert("meta set");
        oldcontent=$('meta[name=viewport]').attr('content') //store the current value
        $('meta[name=viewport]').attr('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0');
}

function resetMeta(){
        alert("meta reset");
        $('meta[name=viewport]').attr('content', oldcontent);

}

The code works fine except if the HTML page is scaled to a larger value it doesn't get set to 1.0 as in setMeta method. Other values like user-scalable work fine. Example: In the HTML page we are alowed to scale but in the app we are not.

This doesnt work either: document.body.style.zoom="100%"; why isn't the reseting of scale to 1.0 working?

Edit
Report