scr einer iframe aendern in neuem window
Ina
- javascript
Hi there,
WAERE SUPER DANKBAR WENN MIR JEMAND HELFEN KOENNTE!!!
Ich habe ein document (document1.htm) von dem ich auf eine neu geoeffnetes (djPop.htm) zufreifen muss, in dem wiederum ein iframe sitzt dessen scr ich veraendern moechte.
Also, auf knopfdruck neues window oeffnen, darin in einer form ein textfield (djNameBox) text darstellen, und im iframe (id="djFrame") scr aendern.
Manchmal klappt's mit dem text, manchmal nicht ( gibt als fehlermeldung an, dass djNameBox kein object ist )....
und das mit der source im Iframe geht gar nicht.
document1.htm beinhaltet folgendes script:
<script language="JavaScript" type="text/JavaScript">
var windowObj
var djName
var srcID
function openWindow(theURL,winName,features) {
windowObj = window.open(theURL,winName,features);
}
function sendText(djName) {
windowObj.document.form1.djNameBox.value = djName
}
function setFrame(srcID) {
windowObj.djFrame.location.href = srcID
}
</script>
und hat mehrere buttons die folgender weise aufrufen:
<a href="javascript:;" onMouseDown="openWindow('djPop.htm','djPopUp','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=500,height=370')" onMouseUp=" sendText('Javi Munoz'); setFrame('javi.html')"> button </a>
djpop.htm:
<body >
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1">
<input name="djNameBox" type="text" class="hiddenTxtbx" id="djNameBox" value="dj name">
</form></td>
</tr>
<tr>
<td align="left" valign="top">
<iframe src="djcesar.html" name="djFrame" id="djFrame" width="452" height="313" marginwidth="0" marginheight="0" align="centre" scrolling="no" frameborder="0">
</iframe></td>
</tr>
...
Vielen Lieben Dank....
Hi.. Nicht sicher, aber sollte da nicht auch ein "document" rein?
Also so?
function setFrame(srcID) {
windowObj.document.djFrame.location.href = srcID
}
hey,
jetzt ruft's mir das richtige document,
DANKE
... allerdings scheint das problem mit der object erkennung nicht zu verschwinden, es macht das nach lust und laune... logisch ist es ja dass es nicht erkannt wird weil es noch nicht "da" ist... was sonst machen als erst das window.open ( zB onMouseDown) und dann die sendText(); zB onMouseUp ...
Kind regards
hi,
Manchmal klappt's mit dem text, manchmal nicht ( gibt als fehlermeldung an, dass djNameBox kein object ist )....
das ist in den allermeisten fällen ein anzeichen dafür, dass du versuchst auf etwas zuzugreifen, was zu diesem zeitpunkt _noch_ nicht existiert.
gruß,
wahsaga