想建个网页,要求网页内的iframe地址为动态JS获取地址栏参数的地址

想建个网页,要求网页内的iframe地址为动态JS获取地址栏参数的地址,第1张

你好根据你的需求,写了一个:

<body>

    <iframe id="iframe"></iframe>    

</body>

<script>

var str = locationsearchsubstr(1);

documentgetElementById('iframe')src = str;

</script>

有什么问题可以留言,希望我的回答能帮到你哈,有问题可以追问,觉得好就点个赞,有用就采纳!

看到了楼下的回答,考虑的更加仔细。

jsp动态树形菜单须用到递归算法,比如在数据库有张表,parent表,parent的字段有id,name,depth,leve,ID自增,depth设置为级数,如这条数据最大,为0,如为字菜单就为1,而leve就指定它父节点的id,给段代码自己可以摸索下 public Vector getModuleTree()

{

Vector pclass = new Vector();

try

{

stmt =concreateStatement();

String sql = "select from Module where parentid = 0";

rs = stmtexecuteQuery(sql);

Module cvo = null;

while(rsnext())

{

cvo = new Module();

cvosetModule_id(rsgetInt("Module_id"));

cvosetModule_name(rsgetString("Module_name"));

cvosetModule_url(rsgetString("Module_url"));

cvosetParentid(rsgetInt("parentid")); cvosetRootid(rsgetInt("rootid")); cvosetDepth(rsgetInt("depth")); pclassadd(cvo);

}

for (int i = 0; i < pclasssize(); i++)

{

Module pcvo = (Module) pclassget(i);

ShowTreeMenu(pcvo);

}

concommit(); } catch (SQLException e)

{

eprintStackTrace();

} finally

{

try

{

if(rs!=null)

{

rsclose();

}

if(stmt!=null)

{

stmtclose();

}

if(con!=null)

{

conclose();

}

}

catch (SQLException e)

{

eprintStackTrace();

}

}

return classList;

}

public void ShowTreeMenu(Module c)

{

Module ccvo = null;

String sql = "select from Module where parentid = " + cgetModule_id();

Vector cclass = new Vector();

try

{

Module cvotemp;

stmt =concreateStatement();

rs = stmtexecuteQuery(sql);

while(rsnext())

{

cvotemp = new Module();

cvotempsetModule_id(rsgetInt("Module_id"));

cvotempsetModule_name(rsgetString("Module_name"));

cvotempsetModule_url(rsgetString("Module_url"));

cvotempsetParentid(rsgetInt("parentid")); cvotempsetRootid(rsgetInt("rootid")); cvotempsetDepth(rsgetInt("depth")); cclassadd(cvotemp);

}

Systemoutprintln(cclasssize()+"(((((((((((((((((((((((((9");

if (cclasssize() > 0)

{

csetHasChild("have");

classListadd(c);

for (int j = 0; j < cclasssize(); j++)

{

ccvo = (Module) cclassget(j);

ShowTreeMenu(ccvo);

} } else

{

classListadd(c);

}

} catch (SQLException e)

{

eprintStackTrace();

}

}

以上就是关于想建个网页,要求网页内的iframe地址为动态JS获取地址栏参数的地址全部的内容,包括:想建个网页,要求网页内的iframe地址为动态JS获取地址栏参数的地址、JSP动态树形菜单,菜单项从数据库中获得、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9489283.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-28
下一篇2023-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存