EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: frankgao on October 12, 2015, 06:56:23 PM



Title: How can get the window href url parameters?
Post by: frankgao on October 12, 2015, 06:56:23 PM
Two pages.
Such as 'A.html' and 'B.html',
A.html have a windows div, the id name is 'emwindows'. when I click the button.
The 'B.html' popup, I want to get the B.html url parameters on B.html.
How can do it?

Code:
<a href="#" class="easyui-linkbutton" style="width:20px;height:20px;" onclick="dlgEmploye()">...</a>

<div id="emwindows" class="easyui-window" closed="true" title="My Window" style="width:0px;height:0px"></div>

function dlgEmploye() {
    $("#emwindows").empty();
    var $win;
    $win = $("#emwindows").window({
        width: 700,
        height: 500,
        modal: true,
        href: 'B.html?formid=abc&pmodel=id_name&cid=xyz&cname=123',
        title: 'Choice',
        collapsible: false,
        maximizable: true,
        minimizable: false,
        onResize: function () {
            $(this).window('center');
        }
    });
    $win.window('open');
}



Title: Re: How can get the window href url parameters?
Post by: stworthy on October 13, 2015, 07:44:30 PM
You can call 'options' method of window to get the 'href' property value in your 'B.html' page.
Code:
<button onclick="alert(getHref())">test</button>
<script>
function getHref(){
var opts = $('#emwindows').window('options');
return opts.href;
}
</script>