我需要点击ahref
打开iframe窗口。这是我的代码,我需要打开ahref
作为iframe的链接。
有人可以帮我这么做吗?
代码:
function selectRepair()
{
$this->content_jscript = <<<End_Of_String
End_Of_String;
$data = graphsCreationSQL::getRepairList ();
$reapirList = "";
foreach ( $data as $row )
{
$reapirList .= "<a href='create-graphs-repair.php?{$this->htmlID_type}={$this->type_generategraphs}&{$this->htmlID_reapirName}=$row->clientName'>$row->clientName</a></br>";
}
$this->content_html = <<<End_Of_String
{$reapirList}
End_Of_String;
}
答案 0 :(得分:1)
不是100%确定这是否可以从通过网址的角度来看,我的基本javascript有点生疏,尽管你应该能够找到一些与之相关的东西。
foreach ( $data as $row )
{
$repairList .= "<a href=\"#\" onclick=\"makeIFrame('create-graphs-repair.php?{$this->htmlID_type}={$this->type_generategraphs}&{$this->htmlID_reapirName'}=$row->clientName)\">$row->clientName</a>"
}
然后在Javascript中
function makeIFrame(url) {
iframe = document.createElement("iframe");
iframe.setAttribute("src", url);
iframe.style.width = 640+"px";
iframe.style.height = 480+"px";
document.body.appendChild(iframe);
}