[英]How do I modify an iframe using CGI in Perl?
So I have figured out how to "create" an iFrame using cgi, but I have no idea how to manipulate it (ie change size, change source, disable scrolling, etc). 所以我已经想出如何使用cgi“创建”iFrame,但我不知道如何操作它(即更改大小,更改源,禁用滚动等)。 This is what I have written in Perl:
这是我用Perl编写的:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
my $page = new CGI;
print $page->header;
print $page->start_html;
print $page->iframe("http://www.nasa.gov/");
print $page->end_html;
But here is the HTML I receive: 但这是我收到的HTML:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head><title>Untitled Document</title>
</head><body><iframe>http://www.nasa.gov/</iframe></body></html>
Of course, when adding the source and size attributes, the info must go inside of the > symbol, like so: 当然,在添加source和size属性时,信息必须在>符号内部,如下所示:
<iframe src="http://www.nasa.gov/"> Enter Text Here </iframe>
Instead, CGI closes the iframe header, like so: 而是,CGI关闭iframe标头,如下所示:
<iframe>http://www.nasa.gov/</iframe>
How am I supposed to modify the iframe in this case? 在这种情况下我该如何修改iframe? Can it be done?
可以吗?
print $page->iframe({src => "http://www.nasa.gov/"}, "");
您需要将地址放入src
属性,而不是iframe
内容(这是不支持该元素的浏览器的后备内容 - 主要是理论上的功能)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.