繁体   English   中英

iframe根据javascript和php进行更改

[英]Iframe changing according to javascript and php

我正在尝试在发生onChange事件时重新加载iframe

这是我在标头中的javascript标签中得到的


`

function getSchedule(oEvent) { var n = document.getElementById("wantedTherapist"); var newn = n.options[n.selectedIndex].value; window.frames['schedule'].src = "schedule.php?therapist="+newn; }

`

然后是我的iframe广告代码


iframe id="schedule" name="schedule" src="schedule.php"></iframe>
最后是我的选择框
  <select id="wantedTherapist" name="wantedTherapist" onchange="getSchedule(Event)"> ?php $query = "SELECT therapistTable.* FROM therapistTable WHERE therapistTable.activated = 'true' "; $result = mysql_query($query) or die (mysql_error()); while($array = mysql_fetch_assoc($result)) { extract($array); echo "<option value=\\"$username\\">$username - $city</option>"; } ? </select> 

我从php标签上取下了箭头,从iframe上取下了第一个箭头,这样它就会显示出来。 它在iframe中加载了schedule.php,但没有将其发送给变量,我在做什么错? 谢谢您的任何建议

将iFrame的URL设置为什么? 您可以通过右键单击iFrame并选择“在新窗口中打开框架”来确认(在Firefox中)

如果URL是schedule.php?therapist= ,则错误与您在此处发布的代码有关。 如果URL包含therapist的值(例如schedule.php?therapist=bob ,则错误发生在schedule.php

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM