Iframe parameter transfer problem

in a page index.html, iframe is used

 <iframe name="iFrame" allowtransparency="true" src="/aaa/bbb.html?name="tom"&sex="male" width="100%" height="100%" 
  id="student" style="border: none;">

this iframe introduces another page, bbb.html, and passes in two parameters, name and sex, but how do you get these two parameters in the bbb.html page? I have always been undefined? on the page.

Mar.11,2021

the method is as follows:

//URL
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //
    var r = window.location.search.substr(1).match(reg); //
    if (r != null) return unescape(r[2]);//
    return null; 
}

take your page as an example:
in the bbb.html page, call getUrlParam ('name') and getUrlParam (' sex') to

.
Menu