English 中文(简体)
观察表
原标题:observe form submit response targetting an iframe

我有一个新窗口。 产生人民抵抗力量出口的几种形式。 当我提交其中一种表格时,窗户失去重点,原始窗户在下载时再次涌现。

我创建了一个框架,因此,表格可以瞄准框架,而目前的窗口则失去重点。 它发挥了巨大作用,但我不知道如果一切都正确,如何在一线内观察反应。

这正是它迄今为止的工作。 I m 采用原型JS。

<iframe id="pdf_frame" name="pdf_frame" style="display:none;"></iframe>

<form id="PDF_gen" name="PDF_gen" target="pdf_frame" action="pdf.pl">
      <input type="hidden" name="size" value="">
      <!-- more hidden inputs -->
</form>
<input type="button" id="pdf_submit" value="generate pdf">

JS:

$( pdf_submit ).observe( click , function(){
    //write stuff to hidden inputs
    $( PDF_gen ).submit();
});

如果情况不正确,下载对话就没有出现。 在使用原型表格时,请浏览器不知道如何处理答复,也不进行下载对话。 我怎么能这样做?

提前感谢!

最佳回答

在<代码>iframe上出现错误时 您可以尝试将<代码>iframe的某一活动引向上级窗口(假设我们在同一领域重新工作;赢得双手工作):

parent.document.fire( something:went_wrong )

并且由上级文件聆听这次活动:

document.observe( something:went_wrong , function() {...});
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签