弹出窗口的问题。 [英] problem with popups.

查看:59
本文介绍了弹出窗口的问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着按照htmlsource.com上的教程,但即使我复制并且

粘贴它,我仍然无法获得弹出窗口。

此代码有什么问题吗?

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">

< html>

< head>

< meta http-equiv =" CONTENT-TYPE" content =" text / html;

charset = windows-1252">

< title>

音乐

< / title>

< link rel =" STYLESHEET" HREF =" virtue.css" type =" text / css">


< / head>

< body>


< script type =" text / javascript">

<! -

var newwindow;

function poptastic(url )

{

newwindow = PrivoxyWindowOpen(url,'name'',''height = 400,width = 300'');

if(window.focus){newwindow.focus()}

}

// - >

< / script>


< p>

您想看看< a

href =" javascript :poptastic(''/ chords.html'');">

和弦< / a>还是歌词?

< / p>


< / body>

< / html>

Hi, I tried to follow the tutorial on htmlsource.com, but even if I copy and
paste it, I still can''t get a window to popup. Is there something wrong with
this code?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=windows-1252">
<title>
Music
</title>
<link rel="STYLESHEET" href="virtue.css" type="text/css">

</head>
<body>

<script type="text/javascript">
<!--
var newwindow;
function poptastic(url)
{
newwindow=PrivoxyWindowOpen(url,''name'',''height=400 ,width=300'');
if (window.focus) {newwindow.focus()}
}
// -->
</script>

<p>
Would you like to see <a
href="javascript:poptastic(''/chords.html'');">
chords</a> or lyrics?
</p>

</body>
</html>

推荐答案

" Colin MacIntyre" <共同*** @ clanmacintyre.ca>在消息中写道

news:43 *********************** @ taz.nntpserver.com。 ..
"Colin MacIntyre" <co***@clanmacintyre.ca> wrote in message
news:43***********************@taz.nntpserver.com. ..
我试着按照htmlsource.com上的教程,但即使我复制
并粘贴它,我仍然无法获得弹出窗口。这个代码是否有错误的


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< meta http-equiv =" CONTENT-TYPE" content =" text / html;
charset = windows-1252">
< title>
音乐
< / title>
< link rel = QUOT;样式表" HREF =" virtue.css" type =" text / css">

< / head>
< body>

< script type =" text / javascript" >
<! -
var newwindow;
函数poptastic(url)
{
newwindow = PrivoxyWindowOpen(url,''name'',''' height = 400,width = 300'');
if(window.focus){newwindow.focus()}
}
// - >
< /脚本>

< p>
你想看看< a
href =" javascript :poptastic(''/和弦。 html'');">
和弦< / a>或歌词?
< / p>
< / body>
< / html>
Hi, I tried to follow the tutorial on htmlsource.com, but even if I copy and paste it, I still can''t get a window to popup. Is there something wrong with this code?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=windows-1252">
<title>
Music
</title>
<link rel="STYLESHEET" href="virtue.css" type="text/css">

</head>
<body>

<script type="text/javascript">
<!--
var newwindow;
function poptastic(url)
{
newwindow=PrivoxyWindowOpen(url,''name'',''height=400 ,width=300'');
if (window.focus) {newwindow.focus()}
}
// -->
</script>

<p>
Would you like to see <a
href="javascript:poptastic(''/chords.html'');">
chords</a> or lyrics?
</p>

</body>
</html>




在调用它的Web服务器的根目录中是/chords.html吗?


如果没有,则使用完全限定的URL。



Is ''/chords.html'' in the root of the Web server invoking it?

If not then use a fully qualified URL.


Colin MacIntyre写道:
Colin MacIntyre wrote:
我试着按照htmlsource.com上的教程,但即使我复制并粘贴它,我仍然可以没有弹出窗口。这段代码有什么问题吗?


您收到错误消息吗?如果是这样,它是什么?是否类似

PrivoxyWindowOpen是注释定义的?


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< meta http-equiv =" CONTENT-TYPE" content =" text / html;
charset = windows-1252">
< title>
音乐
< / title>
< link rel = QUOT;样式表" HREF =" virtue.css" type =" text / css">

< / head>
< body>

< script type =" text / javascript" >
<! -


不要在脚本元素中使用HTML注释分隔符,它们不提供

有用的目的,并且可能有害。


var newwindow;
函数poptastic(url)
{new / newwindow = PrivoxyWindowOpen(url,''name'',''' height = 400,width = 300'');


PrivoxyWindowOpen()有什么作用?在哪里定义?


if(window.focus){newwindow.focus()}
}
// - >
< ; / script>

< p>
你想看看< a
href =" javascript :poptastic(''/ chords.html'');">
和弦< / a>或歌词?
Hi, I tried to follow the tutorial on htmlsource.com, but even if I copy and
paste it, I still can''t get a window to popup. Is there something wrong with
this code?
Do you get an error message? If so, what is it? Is it something like
"PrivoxyWindowOpen is note defined"?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=windows-1252">
<title>
Music
</title>
<link rel="STYLESHEET" href="virtue.css" type="text/css">

</head>
<body>

<script type="text/javascript">
<!--
Don''t use HTML comment delimiters inside script elements, they serve no
useful purpose and are potentially harmful.

var newwindow;
function poptastic(url)
{
newwindow=PrivoxyWindowOpen(url,''name'',''height=400 ,width=300'');
What does PrivoxyWindowOpen() do? Where is it defined?

if (window.focus) {newwindow.focus()}
}
// -->
</script>

<p>
Would you like to see <a
href="javascript:poptastic(''/chords.html'');">
chords</a> or lyrics?




在A元素的href属性中使用javascript伪协议

已知具有不寻常的副作用一些浏览器。这也意味着没有脚本的
用户会看到一个什么都不做的链接。相反,在href中放置一个真正的

URL并使用onclick属性打开弹出窗口。

< p>你想看看< a

href =" /chtml.html"

onclick =" poptastic(''/ chords.html''); return false;"> chords< / a>

或歌词?< / p>

在onclick上添加return false表示如果启用了脚本,则

链接赢了''接下来。一些弹出窗口拦截器可能仍会停止你的脚本

然后打开一个弹出窗口。

[...]


-

Rob



Using the javascript pseudo-protocol in the href attribute of an A element
is known to have unusual side-effects in some browsers. It also means that
users without script see a ''link'' that does nothing. Instead, put a real
URL in the href and use an onclick attribute to open the popup.
<p>Would you like to see <a
href="/chords.html"
onclick="poptastic(''/chords.html'');return false;">chords</a>
or lyrics?</p>
Adding return false to the onclick means that if scripting is enabled, the
link won''t be followed. Some popup blockers may still stop your script
from opening a popup however.
[...]

--
Rob


我认为来自Dreamweaver的元标记已经引起了我的问题,

尝试删除它。

That meta tag from Dreamweaver I think, has caused problems with me,
try deleting it.


这篇关于弹出窗口的问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆